diff options
author | Lucas Stach <l.stach@pengutronix.de> | 2023-06-07 15:02:21 +0200 |
---|---|---|
committer | Lucas Stach <l.stach@pengutronix.de> | 2023-07-17 11:32:27 +0200 |
commit | 647d817d807127cfff6dacc85992e52ab7779e94 (patch) | |
tree | 676400bf14a8a40d2b6b4d5964e26e8a4bc0f400 /drivers/gpu/drm/etnaviv/etnaviv_gpu.h | |
parent | drm/etnaviv: avoid runtime PM usage in etnaviv_gpu_bind (diff) | |
download | linux-647d817d807127cfff6dacc85992e52ab7779e94.tar.xz linux-647d817d807127cfff6dacc85992e52ab7779e94.zip |
drm/etnaviv: better track GPU state
Instead of only tracking if the FE is running, use a enum to better
describe the various states the GPU can be in. This allows some
additional validation to make sure that functions that expect a
certain GPU state are only called when the GPU is actually in that
state.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Diffstat (limited to 'drivers/gpu/drm/etnaviv/etnaviv_gpu.h')
-rw-r--r-- | drivers/gpu/drm/etnaviv/etnaviv_gpu.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.h b/drivers/gpu/drm/etnaviv/etnaviv_gpu.h index e1e1de59c38d..b4e545dce947 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.h +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.h @@ -95,6 +95,14 @@ struct clk; #define ETNA_NR_EVENTS 30 +enum etnaviv_gpu_state { + ETNA_GPU_STATE_UNKNOWN = 0, + ETNA_GPU_STATE_IDENTIFIED, + ETNA_GPU_STATE_RESET, + ETNA_GPU_STATE_INITIALIZED, + ETNA_GPU_STATE_RUNNING, +}; + struct etnaviv_gpu { struct drm_device *drm; struct thermal_cooling_device *cooling; @@ -105,8 +113,8 @@ struct etnaviv_gpu { struct workqueue_struct *wq; struct mutex sched_lock; struct drm_gpu_scheduler sched; + enum etnaviv_gpu_state state; bool initialized; - bool fe_running; /* 'ring'-buffer: */ struct etnaviv_cmdbuf buffer; |