From: Joonyoung Shim Subject: [PATCH] drm: Change order to turn off the crtc and plane with fb cleanup Date: Fri, 09 Dec 2011 19:56:26 +0900 Message-ID: <1323428186-13020-1-git-send-email-jy0922.shim@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by gabe.freedesktop.org (Postfix) with ESMTP id D29BB9E70A for ; Fri, 9 Dec 2011 02:56:27 -0800 (PST) Received: from epcpsbgm2.samsung.com (mailout1.samsung.com [203.254.224.24]) by mailout1.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTP id <0LVX00FE2NQ2M6X0@mailout1.samsung.com> for dri-devel@lists.freedesktop.org; Fri, 09 Dec 2011 19:56:26 +0900 (KST) Received: from localhost.localdomain ([165.213.219.123]) by mmp1.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTPA id <0LVX00HP1NQ1GL50@mmp1.samsung.com> for dri-devel@lists.freedesktop.org; Fri, 09 Dec 2011 19:56:25 +0900 (KST) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: airlied@gmail.com Cc: kyungmin.park@samsung.com, dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org Ths plane is enabled after the crtc is setted first, so first turn off the plane than the crtc. If not, it can occur some side effects because it may have to use any information of crtc when turns off the plane. Signed-off-by: Joonyoung Shim Signed-off-by: Kyungmin Park --- drivers/gpu/drm/drm_crtc.c | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index e2c9386..73eeace 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -329,6 +329,15 @@ void drm_framebuffer_cleanup(struct drm_framebuffer *fb) struct drm_mode_set set; int ret; + list_for_each_entry(plane, &dev->mode_config.plane_list, head) { + if (plane->fb == fb) { + /* should turn off the plane */ + ret = plane->funcs->disable_plane(plane); + if (ret) + DRM_ERROR("failed to disable plane with busy fb\n"); + } + } + /* remove from any CRTC */ list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { if (crtc->fb == fb) { @@ -342,15 +351,6 @@ void drm_framebuffer_cleanup(struct drm_framebuffer *fb) } } - list_for_each_entry(plane, &dev->mode_config.plane_list, head) { - if (plane->fb == fb) { - /* should turn off the crtc */ - ret = plane->funcs->disable_plane(plane); - if (ret) - DRM_ERROR("failed to disable plane with busy fb\n"); - } - } - drm_mode_object_put(dev, &fb->base); list_del(&fb->head); dev->mode_config.num_fb--; -- 1.7.5.4