diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2015-02-20 11:30:59 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2015-03-03 16:16:12 +0200 |
commit | 3e8da87d0c04e585f4af0f223376128f923cf7bc (patch) | |
tree | 1fbd6f64273d17cab059f6d8f0c62542bb7f5cb5 /drivers/gpu/drm/rcar-du/rcar_du_crtc.c | |
parent | 845f46356ba490b654194b8d5c26032841719a78 (diff) | |
download | blackbird-obmc-linux-3e8da87d0c04e585f4af0f223376128f923cf7bc.tar.gz blackbird-obmc-linux-3e8da87d0c04e585f4af0f223376128f923cf7bc.zip |
drm: rcar-du: Wire up atomic state object scaffolding
Hook up the default .reset(), .atomic_duplicate_state() and
.atomic_free_state() helpers to ensure that state objects are properly
created and destroyed, and call drm_mode_config_reset() at init time to
create the initial state objects.
Framebuffer reference count also gets maintained automatically by the
transitional helpers except for the legacy page flip operation. Maintain
it explicitly there.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Diffstat (limited to 'drivers/gpu/drm/rcar-du/rcar_du_crtc.c')
-rw-r--r-- | drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c index 169558a3ab40..6e7266c1a47b 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c @@ -15,6 +15,8 @@ #include <linux/mutex.h> #include <drm/drmP.h> +#include <drm/drm_atomic.h> +#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc.h> #include <drm/drm_crtc_helper.h> #include <drm/drm_fb_cma_helper.h> @@ -572,6 +574,8 @@ static int rcar_du_crtc_page_flip(struct drm_crtc *crtc, } spin_unlock_irqrestore(&dev->event_lock, flags); + drm_atomic_set_fb_for_plane(crtc->primary->state, fb); + crtc->primary->fb = fb; rcar_du_crtc_update_base(rcrtc); @@ -587,9 +591,12 @@ static int rcar_du_crtc_page_flip(struct drm_crtc *crtc, } static const struct drm_crtc_funcs crtc_funcs = { + .reset = drm_atomic_helper_crtc_reset, .destroy = drm_crtc_cleanup, .set_config = drm_crtc_helper_set_config, .page_flip = rcar_du_crtc_page_flip, + .atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state, + .atomic_destroy_state = drm_atomic_helper_crtc_destroy_state, }; /* ----------------------------------------------------------------------------- |