Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1452342

[PATCH 4/7] drm/mediatek: Use drm_atomic destroy_state helpers

From Bibby Hsieh <bibby.hsieh@mediatek.com>
Newsgroups linux.kernel
Subject [PATCH 4/7] drm/mediatek: Use drm_atomic destroy_state helpers
Date 2016-07-29 11:10 +0200
Message-ID <s0bXQ-2EU-35@gated-at.bofh.it> (permalink)
References <s0bXP-2EU-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Use the core destroy_state helpers to destroy core state to ensure we don't
leak if/when more fields get added later.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Bibby Hsieh <bibby.hsieh@mediatek.com>
---
 drivers/gpu/drm/mediatek/mtk_drm_crtc.c  |    3 +--
 drivers/gpu/drm/mediatek/mtk_drm_plane.c |    3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
index d6fbefa..733b2a3 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
@@ -112,8 +112,7 @@ static void mtk_drm_crtc_reset(struct drm_crtc *crtc)
 	struct mtk_crtc_state *state;
 
 	if (crtc->state) {
-		if (crtc->state->mode_blob)
-			drm_property_unreference_blob(crtc->state->mode_blob);
+		__drm_atomic_helper_crtc_destroy_state(crtc->state);
 
 		state = to_mtk_crtc_state(crtc->state);
 		memset(state, 0, sizeof(*state));
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_plane.c b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
index 86b7aed..17172ba 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_plane.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
@@ -73,8 +73,7 @@ static void mtk_plane_reset(struct drm_plane *plane)
 	struct mtk_plane_state *state;
 
 	if (plane->state) {
-		if (plane->state->fb)
-			drm_framebuffer_unreference(plane->state->fb);
+		__drm_atomic_helper_plane_destroy_state(plane->state);
 
 		state = to_mtk_plane_state(plane->state);
 		memset(state, 0, sizeof(*state));
-- 
1.7.9.5

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/7] drm/mediatek: cleaning up and refine Bibby Hsieh <bibby.hsieh@mediatek.com> - 2016-07-29 11:10 +0200
  [PATCH 2/7] drm/mediatek: plane: Remove plane zpos/index Bibby Hsieh <bibby.hsieh@mediatek.com> - 2016-07-29 11:10 +0200
    Re: [PATCH 2/7] drm/mediatek: plane: Remove plane zpos/index CK Hu <ck.hu@mediatek.com> - 2016-07-29 12:20 +0200
  [PATCH 5/7] drm/mediatek: plane: Merge mtk_plane_enable into mtk_plane_atomic_update Bibby Hsieh <bibby.hsieh@mediatek.com> - 2016-07-29 11:10 +0200
    Re: [PATCH 5/7] drm/mediatek: plane: Merge mtk_plane_enable into mtk_plane_atomic_update Sean Paul <seanpaul@chromium.org> - 2016-08-02 19:10 +0200
      Re: [PATCH 5/7] drm/mediatek: plane: Merge mtk_plane_enable into  mtk_plane_atomic_update Bibby Hsieh <bibby.hsieh@mediatek.com> - 2016-08-03 03:40 +0200
    Re: [PATCH 5/7] drm/mediatek: plane: Merge mtk_plane_enable into mtk_plane_atomic_update Sean Paul <seanpaul@chromium.org> - 2016-08-02 19:40 +0200
  [PATCH 6/7] drm/mediatek: plane: Use FB's format's cpp to compute x offset Bibby Hsieh <bibby.hsieh@mediatek.com> - 2016-07-29 11:10 +0200
  [PATCH 4/7] drm/mediatek: Use drm_atomic destroy_state helpers Bibby Hsieh <bibby.hsieh@mediatek.com> - 2016-07-29 11:10 +0200
  Re: [PATCH 0/7] drm/mediatek: cleaning up and refine Sean Paul <seanpaul@chromium.org> - 2016-08-01 17:30 +0200

csiph-web