[COMMON] g2d: flush cmd page for secure sysmmu
authorhyesoo.yu <hyesoo.yu@samsung.com>
Wed, 14 Jun 2017 06:56:43 +0000 (15:56 +0900)
committerSeungchul Kim <sc377.kim@samsung.com>
Mon, 28 May 2018 05:27:21 +0000 (14:27 +0900)
the command page is mapped on secure sysmmu without
sharable. so, we have to flush the cmd page before
pushing the page for when the command page is mapped
on only secure sysmmu.

Change-Id: Ia9a50336aaafb3452c4089652a8369b00a938439
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
drivers/gpu/exynos/g2d/g2d_task.c

index 03fae9778e15afbcbf37cd41d110f5642fe9b9b7..8b6c0faaa4611b55ebcece3af5dd1099a1cdeef9 100644 (file)
@@ -66,6 +66,11 @@ static void g2d_secure_disable(void)
 {
        exynos_smc(SMC_PROTECTION_SET, 0, G2D_ALWAYS_S, 0);
 }
+
+static void g2d_flush_command_page(struct g2d_task *task)
+{
+       __dma_flush_area(page_address(task->cmd_page), G2D_CMD_LIST_SIZE);
+}
 #else
 static int g2d_map_cmd_data(struct g2d_task *task)
 {
@@ -89,6 +94,7 @@ static int g2d_map_cmd_data(struct g2d_task *task)
 
 #define g2d_secure_enable() do { } while (0)
 #define g2d_secure_disable() do { } while (0)
+#define g2d_flush_command_page(task) do { } while (0)
 #endif
 
 struct g2d_task *g2d_get_active_task_from_id(struct g2d_device *g2d_dev,
@@ -202,6 +208,9 @@ static void g2d_execute_task(struct g2d_device *g2d_dev, struct g2d_task *task)
 
        mod_timer(&task->timer,
                  jiffies + msecs_to_jiffies(G2D_HW_TIMEOUT_MSEC));
+
+       g2d_flush_command_page(task);
+
        /*
         * g2d_device_run() is not reentrant while g2d_schedule() is
         * reentrant g2d_device_run() should be protected with