diff options
author | Maxime Ripard <maxime@cerno.tech> | 2020-10-29 20:01:01 +0100 |
---|---|---|
committer | Maxime Ripard <maxime@cerno.tech> | 2020-11-02 12:14:43 +0100 |
commit | 171a072b4699b4bf79cd1bbbcd05a53d40903034 (patch) | |
tree | a3599950ff7be0c012f8aefd770012becf76cd1a /drivers/gpu/drm/vc4/vc4_gem.c | |
parent | e46e5330d13de67de5b614c5021730e9709de975 (diff) | |
download | linux-stable-171a072b4699b4bf79cd1bbbcd05a53d40903034.tar.gz linux-stable-171a072b4699b4bf79cd1bbbcd05a53d40903034.tar.bz2 linux-stable-171a072b4699b4bf79cd1bbbcd05a53d40903034.zip |
drm/vc4: gem: Add a managed action to cleanup the job queue
The job queue needs to be cleaned up using vc4_gem_destroy, but it's
not used consistently (vc4_drv's bind calls it in its error path, but
doesn't in unbind), and we can make that automatic through a managed
action. Let's remove the requirement to call vc4_gem_destroy.
Fixes: d5b1a78a772f ("drm/vc4: Add support for drawing 3D frames.")
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20201029190104.2181730-3-maxime@cerno.tech
Diffstat (limited to 'drivers/gpu/drm/vc4/vc4_gem.c')
-rw-r--r-- | drivers/gpu/drm/vc4/vc4_gem.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c index 9f01ddd5b932..32367980d204 100644 --- a/drivers/gpu/drm/vc4/vc4_gem.c +++ b/drivers/gpu/drm/vc4/vc4_gem.c @@ -1263,8 +1263,8 @@ fail: return ret; } -void -vc4_gem_init(struct drm_device *dev) +static void vc4_gem_destroy(struct drm_device *dev, void *unused); +int vc4_gem_init(struct drm_device *dev) { struct vc4_dev *vc4 = to_vc4_dev(dev); @@ -1285,10 +1285,11 @@ vc4_gem_init(struct drm_device *dev) INIT_LIST_HEAD(&vc4->purgeable.list); mutex_init(&vc4->purgeable.lock); + + return drmm_add_action_or_reset(dev, vc4_gem_destroy, NULL); } -void -vc4_gem_destroy(struct drm_device *dev) +static void vc4_gem_destroy(struct drm_device *dev, void *unused) { struct vc4_dev *vc4 = to_vc4_dev(dev); |