diff options
author | Eric Anholt <eric@anholt.net> | 2018-06-06 20:48:51 +0300 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2018-06-22 00:46:04 +0300 |
commit | 7122b68b8a9692dcc3acf89595f04c492872115f (patch) | |
tree | c1bbdd237d54dca2fb474dbcc8c5b690bd26fc98 /drivers/gpu/drm/v3d/v3d_drv.h | |
parent | 6aa13402c11035a428d8c621b334734971d5d39d (diff) | |
download | linux-7122b68b8a9692dcc3acf89595f04c492872115f.tar.xz |
drm/v3d: Take a lock across GPU scheduler job creation and queuing.
Between creation and queueing of a job, you need to prevent any other
job from being created and queued. Otherwise the scheduler's fences
may be signaled out of seqno order.
v2: move mutex unlock to the error label.
Signed-off-by: Eric Anholt <eric@anholt.net>
Fixes: 57692c94dcbe ("drm/v3d: Introduce a new DRM driver for Broadcom V3D V3.x+")
Link: https://patchwork.freedesktop.org/patch/msgid/20180606174851.12433-1-eric@anholt.net
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Diffstat (limited to 'drivers/gpu/drm/v3d/v3d_drv.h')
-rw-r--r-- | drivers/gpu/drm/v3d/v3d_drv.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/v3d/v3d_drv.h b/drivers/gpu/drm/v3d/v3d_drv.h index a043ac3aae98..26005abd9c5d 100644 --- a/drivers/gpu/drm/v3d/v3d_drv.h +++ b/drivers/gpu/drm/v3d/v3d_drv.h @@ -85,6 +85,11 @@ struct v3d_dev { */ struct mutex reset_lock; + /* Lock taken when creating and pushing the GPU scheduler + * jobs, to keep the sched-fence seqnos in order. + */ + struct mutex sched_lock; + struct { u32 num_allocated; u32 pages_allocated; |