drm: etnaviv: track current execution state
authorRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 21 Jan 2016 15:20:19 +0000 (15:20 +0000)
committerLucas Stach <l.stach@pengutronix.de>
Mon, 7 Mar 2016 14:36:54 +0000 (15:36 +0100)
Add tracking of the current execution state (iow, active GPU pipe).

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
drivers/gpu/drm/etnaviv/etnaviv_buffer.c
drivers/gpu/drm/etnaviv/etnaviv_gpu.c
drivers/gpu/drm/etnaviv/etnaviv_gpu.h

index cfd08ef..950db38 100644 (file)
@@ -261,6 +261,7 @@ void etnaviv_buffer_queue(struct etnaviv_gpu *gpu, unsigned int event,
 
                if (gpu->switch_context) {
                        etnaviv_cmd_select_pipe(buffer, cmdbuf->exec_state);
+                       gpu->exec_state = cmdbuf->exec_state;
                        gpu->switch_context = false;
                }
 
index e9e66b9..2adee13 100644 (file)
@@ -628,6 +628,7 @@ int etnaviv_gpu_init(struct etnaviv_gpu *gpu)
        /* Now program the hardware */
        mutex_lock(&gpu->lock);
        etnaviv_gpu_hw_init(gpu);
+       gpu->exec_state = -1;
        mutex_unlock(&gpu->lock);
 
        pm_runtime_mark_last_busy(gpu->dev);
@@ -877,6 +878,7 @@ static void recover_worker(struct work_struct *work)
 
        etnaviv_gpu_hw_init(gpu);
        gpu->switch_context = true;
+       gpu->exec_state = -1;
 
        mutex_unlock(&gpu->lock);
        pm_runtime_mark_last_busy(gpu->dev);
@@ -1475,6 +1477,7 @@ static int etnaviv_gpu_hw_resume(struct etnaviv_gpu *gpu)
        etnaviv_gpu_hw_init(gpu);
 
        gpu->switch_context = true;
+       gpu->exec_state = -1;
 
        mutex_unlock(&gpu->lock);
 
index f233ac4..0523f73 100644 (file)
@@ -103,6 +103,7 @@ struct etnaviv_gpu {
 
        /* 'ring'-buffer: */
        struct etnaviv_cmdbuf *buffer;
+       int exec_state;
 
        /* bus base address of memory  */
        u32 memory_base;