From: Prathyush K Subject: [PATCH 3/3] drm/exynos: do not disable crtc if already off Date: Tue, 04 Dec 2012 19:56:51 +0530 Message-ID: <1354631211-30346-3-git-send-email-prathyush.k@samsung.com> References: <1354631211-30346-1-git-send-email-prathyush.k@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 E02E3E6019 for ; Tue, 4 Dec 2012 06:05:29 -0800 (PST) Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MEI00AKKF525CS0@mailout1.samsung.com> for dri-devel@lists.freedesktop.org; Tue, 04 Dec 2012 23:05:29 +0900 (KST) Received: from localhost.localdomain ([107.108.73.106]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MEI00F96F2AW000@mmp2.samsung.com> for dri-devel@lists.freedesktop.org; Tue, 04 Dec 2012 23:05:28 +0900 (KST) In-reply-to: <1354631211-30346-1-git-send-email-prathyush.k@samsung.com> 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: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org The crtc disable function should not disable the overlays if the crtc is already in DPMS_OFF as this will lead to register access when clock is off. Also the crtc disable function should not call DPMS OFF of the crtc. This is required to ensure we are able to wait for vblank before freeing any framebuffers after disabling the crtc. Signed-off-by: Prathyush K --- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c index 2efa4b0..faa6ee0 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c @@ -186,8 +186,12 @@ static void exynos_drm_crtc_disable(struct drm_crtc *crtc) DRM_DEBUG_KMS("%s\n", __FILE__); + if (exynos_crtc->dpms > DRM_MODE_DPMS_ON) { + DRM_DEBUG_KMS("crtc is already off.\n"); + return; + } + exynos_plane_dpms(exynos_crtc->plane, DRM_MODE_DPMS_OFF); - exynos_drm_crtc_dpms(crtc, DRM_MODE_DPMS_OFF); } static struct drm_crtc_helper_funcs exynos_crtc_helper_funcs = { -- 1.7.0.4