From 0b20a0f8c3cb6f74fe326101b62eeb5e2c56a53c Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Fri, 30 Jun 2017 12:36:44 +0300 Subject: drm: Add old state pointer to CRTC .enable() helper function The old state is useful for drivers that need to perform operations at enable time that depend on the transition between the old and new states. While at it, rename the operation to .atomic_enable() to be consistent with .atomic_disable(), as the .enable() operation is used by atomic helpers only. Signed-off-by: Laurent Pinchart Acked-by: Maxime Ripard # for sun4i Acked-by: Philipp Zabel # for imx-drm and mediatek Acked-by: Alexey Brodkin # for arcpgu Acked-by: Boris Brezillon # for atmel-hlcdc Acked-by: Liviu Dudau # for hdlcd and mali-dp Acked-by: Stefan Agner # for fsl-dcu Tested-by: Philippe Cornu # for stm Acked-by: Philippe Cornu # for stm Acked-by: Vincent Abriou # for sti Reviewed-by: Thomas Hellstrom # for vmwgfx Signed-off-by: Daniel Vetter Link: http://patchwork.freedesktop.org/patch/msgid/20170630093646.7928-2-laurent.pinchart+renesas@ideasonboard.com --- drivers/gpu/drm/zte/zx_vou.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/gpu/drm/zte/zx_vou.c') diff --git a/drivers/gpu/drm/zte/zx_vou.c b/drivers/gpu/drm/zte/zx_vou.c index 5fbd10b60ee5..ccb4b0bdb8c6 100644 --- a/drivers/gpu/drm/zte/zx_vou.c +++ b/drivers/gpu/drm/zte/zx_vou.c @@ -350,7 +350,8 @@ static inline void vou_chn_set_update(struct zx_crtc *zcrtc) zx_writel(zcrtc->chnreg + CHN_UPDATE, 1); } -static void zx_crtc_enable(struct drm_crtc *crtc) +static void zx_crtc_atomic_enable(struct drm_crtc *crtc, + struct drm_crtc_state *old_state) { struct drm_display_mode *mode = &crtc->state->adjusted_mode; bool interlaced = mode->flags & DRM_MODE_FLAG_INTERLACE; @@ -490,9 +491,9 @@ static void zx_crtc_atomic_flush(struct drm_crtc *crtc, } static const struct drm_crtc_helper_funcs zx_crtc_helper_funcs = { - .enable = zx_crtc_enable, .disable = zx_crtc_disable, .atomic_flush = zx_crtc_atomic_flush, + .atomic_enable = zx_crtc_atomic_enable, }; static int zx_vou_enable_vblank(struct drm_crtc *crtc) -- cgit From 64581714b58bc3e16ede8dc37a025c3aa0e0eef1 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Fri, 30 Jun 2017 12:36:45 +0300 Subject: drm: Convert atomic drivers from CRTC .disable() to .atomic_disable() The CRTC .disable() helper operation is deprecated for atomic drivers, the new .atomic_disable() helper operation being preferred. Convert all atomic drivers to .atomic_disable() to avoid cargo-cult use of .disable() in new drivers. Signed-off-by: Laurent Pinchart Acked-by: Maxime Ripard # for sun4i Acked-by: Philipp Zabel # for mediatek Acked-by: Alexey Brodkin # for arcpgu Acked-by: Boris Brezillon # for atmel-hlcdc Tested-by: Philippe Cornu # for stm Acked-by: Philippe Cornu # for stm Acked-by: Vincent Abriou # for sti Reviewed-by: Thomas Hellstrom # for vmwgfx Signed-off-by: Daniel Vetter Link: http://patchwork.freedesktop.org/patch/msgid/20170630093646.7928-3-laurent.pinchart+renesas@ideasonboard.com --- drivers/gpu/drm/zte/zx_vou.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/gpu/drm/zte/zx_vou.c') diff --git a/drivers/gpu/drm/zte/zx_vou.c b/drivers/gpu/drm/zte/zx_vou.c index ccb4b0bdb8c6..7491813131f3 100644 --- a/drivers/gpu/drm/zte/zx_vou.c +++ b/drivers/gpu/drm/zte/zx_vou.c @@ -455,7 +455,8 @@ static void zx_crtc_atomic_enable(struct drm_crtc *crtc, DRM_DEV_ERROR(vou->dev, "failed to enable pixclk: %d\n", ret); } -static void zx_crtc_disable(struct drm_crtc *crtc) +static void zx_crtc_atomic_disable(struct drm_crtc *crtc, + struct drm_crtc_state *old_state) { struct zx_crtc *zcrtc = to_zx_crtc(crtc); const struct zx_crtc_bits *bits = zcrtc->bits; @@ -491,9 +492,9 @@ static void zx_crtc_atomic_flush(struct drm_crtc *crtc, } static const struct drm_crtc_helper_funcs zx_crtc_helper_funcs = { - .disable = zx_crtc_disable, .atomic_flush = zx_crtc_atomic_flush, .atomic_enable = zx_crtc_atomic_enable, + .atomic_disable = zx_crtc_atomic_disable, }; static int zx_vou_enable_vblank(struct drm_crtc *crtc) -- cgit