diff options
author | Russell King <rmk+kernel@armlinux.org.uk> | 2017-07-08 11:22:25 +0200 |
---|---|---|
committer | Russell King <rmk+kernel@armlinux.org.uk> | 2017-12-08 13:20:00 +0100 |
commit | d924155dae5c59fc69be98392306970510768d0b (patch) | |
tree | ae40348de23e513e7fa0fac2656f08f67b4ad996 /drivers/gpu/drm/armada/armada_overlay.c | |
parent | drm/armada: allow armada_drm_plane_work_queue() to silently fail (diff) | |
download | linux-d924155dae5c59fc69be98392306970510768d0b.tar.xz linux-d924155dae5c59fc69be98392306970510768d0b.zip |
drm/armada: avoid work allocation
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'drivers/gpu/drm/armada/armada_overlay.c')
-rw-r--r-- | drivers/gpu/drm/armada/armada_overlay.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/gpu/drm/armada/armada_overlay.c b/drivers/gpu/drm/armada/armada_overlay.c index 53edf42c5863..bad966ae6758 100644 --- a/drivers/gpu/drm/armada/armada_overlay.c +++ b/drivers/gpu/drm/armada/armada_overlay.c @@ -32,7 +32,6 @@ struct armada_ovl_plane_properties { struct armada_ovl_plane { struct armada_plane base; - struct armada_plane_work work; struct armada_ovl_plane_properties prop; }; #define drm_to_armada_ovl_plane(p) \ @@ -85,7 +84,7 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc, { struct armada_ovl_plane *dplane = drm_to_armada_ovl_plane(plane); struct armada_crtc *dcrtc = drm_to_armada_crtc(crtc); - struct armada_plane_work *work = &dplane->work; + struct armada_plane_work *work; const struct drm_format_info *format; struct drm_plane_state state = { .plane = plane, @@ -119,6 +118,8 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc, if (ret) return ret; + work = &dplane->base.works[dplane->base.next_work]; + ctrl0 = CFG_DMA_FMT(drm_fb_to_armada_fb(fb)->fmt) | CFG_DMA_MOD(drm_fb_to_armada_fb(fb)->mod) | CFG_CBSH_ENA; @@ -248,6 +249,8 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc, ret = armada_drm_plane_work_queue(dcrtc, work); if (ret) DRM_ERROR("failed to queue plane work: %d\n", ret); + + dplane->base.next_work = !dplane->base.next_work; } return 0; } @@ -434,8 +437,8 @@ int armada_overlay_plane_create(struct drm_device *dev, unsigned long crtcs) return ret; } - dplane->work.plane = &dplane->base.base; - dplane->work.fn = armada_ovl_plane_work; + dplane->base.works[0].fn = armada_ovl_plane_work; + dplane->base.works[1].fn = armada_ovl_plane_work; ret = drm_universal_plane_init(dev, &dplane->base.base, crtcs, &armada_ovl_plane_funcs, |