linux-rockchip.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 13/17] drm/rockchip: Convert to using __drm_atomic_helper_crtc_reset() for reset.
       [not found] ` <20190301125627.7285-1-maarten.lankhorst-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
@ 2019-03-01 12:56   ` Maarten Lankhorst
  2019-03-18 18:07     ` Heiko Stübner
  0 siblings, 1 reply; 2+ messages in thread
From: Maarten Lankhorst @ 2019-03-01 12:56 UTC (permalink / raw)
  To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	intel-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Maarten Lankhorst,
	Sandy Huang, Heiko Stübner

Convert rockchip to using __drm_atomic_helper_crtc_reset(), instead of
writing its own version. Instead of open coding
destroy_state(), call it directly for freeing the old state.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Sandy Huang <hjc@rock-chips.com>
Cc: "Heiko Stübner" <heiko@sntech.de>
Cc: linux-rockchip@lists.infradead.org
---
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 22 ++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
index c7d4c6073ea5..1cf1658f1c01 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
@@ -1201,17 +1201,6 @@ static void vop_crtc_destroy(struct drm_crtc *crtc)
 	drm_crtc_cleanup(crtc);
 }
 
-static void vop_crtc_reset(struct drm_crtc *crtc)
-{
-	if (crtc->state)
-		__drm_atomic_helper_crtc_destroy_state(crtc->state);
-	kfree(crtc->state);
-
-	crtc->state = kzalloc(sizeof(struct rockchip_crtc_state), GFP_KERNEL);
-	if (crtc->state)
-		crtc->state->crtc = crtc;
-}
-
 static struct drm_crtc_state *vop_crtc_duplicate_state(struct drm_crtc *crtc)
 {
 	struct rockchip_crtc_state *rockchip_state;
@@ -1233,6 +1222,17 @@ static void vop_crtc_destroy_state(struct drm_crtc *crtc,
 	kfree(s);
 }
 
+static void vop_crtc_reset(struct drm_crtc *crtc)
+{
+	struct rockchip_crtc_state *crtc_state =
+		kzalloc(sizeof(*crtc_state), GFP_KERNEL);
+
+	if (crtc->state)
+		vop_crtc_destroy_state(crtc, crtc->state);
+
+	__drm_atomic_helper_crtc_reset(crtc, &crtc_state->base);
+}
+
 #ifdef CONFIG_DRM_ANALOGIX_DP
 static struct drm_connector *vop_get_edp_connector(struct vop *vop)
 {
-- 
2.20.1


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 13/17] drm/rockchip: Convert to using __drm_atomic_helper_crtc_reset() for reset.
  2019-03-01 12:56   ` [PATCH 13/17] drm/rockchip: Convert to using __drm_atomic_helper_crtc_reset() for reset Maarten Lankhorst
@ 2019-03-18 18:07     ` Heiko Stübner
  0 siblings, 0 replies; 2+ messages in thread
From: Heiko Stübner @ 2019-03-18 18:07 UTC (permalink / raw)
  To: Maarten Lankhorst; +Cc: linux-rockchip, intel-gfx, dri-devel

Am Freitag, 1. März 2019, 13:56:23 CET schrieb Maarten Lankhorst:
> Convert rockchip to using __drm_atomic_helper_crtc_reset(), instead of
> writing its own version. Instead of open coding
> destroy_state(), call it directly for freeing the old state.
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Sandy Huang <hjc@rock-chips.com>
> Cc: "Heiko Stübner" <heiko@sntech.de>
> Cc: linux-rockchip@lists.infradead.org

so I've looked up the patch2 that introduces __drm_atomic_helper_crtc_reset
in patchwork and compared results and everything looks as it should be
I think ;-) , so

Reviewed-by: Heiko Stuebner <heiko@sntech.de>




_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-03-18 18:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20190301125627.7285-1-maarten.lankhorst@linux.intel.com>
     [not found] ` <20190301125627.7285-1-maarten.lankhorst-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2019-03-01 12:56   ` [PATCH 13/17] drm/rockchip: Convert to using __drm_atomic_helper_crtc_reset() for reset Maarten Lankhorst
2019-03-18 18:07     ` Heiko Stübner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).