From patchwork Fri Sep 14 04:29:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 1455361 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 134A8DF280 for ; Fri, 14 Sep 2012 04:32:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E5BD5A0F0A for ; Thu, 13 Sep 2012 21:32:24 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by gabe.freedesktop.org (Postfix) with ESMTP id CF5BD9EFFC for ; Thu, 13 Sep 2012 21:30:05 -0700 (PDT) Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MAB009X0OGWAJG0@mailout2.samsung.com> for dri-devel@lists.freedesktop.org; Fri, 14 Sep 2012 13:29:41 +0900 (KST) X-AuditID: cbfee61b-b7f826d000005fb5-cf-5052b2b58662 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id A0.78.24501.5B2B2505; Fri, 14 Sep 2012 13:29:41 +0900 (KST) Received: from daeinki-desktop.10.32.193.11 ([10.90.51.53]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MAB0096DOHH7J40@mmp1.samsung.com> for dri-devel@lists.freedesktop.org; Fri, 14 Sep 2012 13:29:41 +0900 (KST) From: Inki Dae To: airlied@linux.ie, dri-devel@lists.freedesktop.org Subject: [PATCH 3/4] drm/exynos: check crtc's dpms mode at page flip Date: Fri, 14 Sep 2012 13:29:41 +0900 Message-id: <1347596981-12545-1-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 1.7.4.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrFJMWRmVeSWpSXmKPExsVy+t9jAd2tm4ICDNZ3G1lc+fqezYHR4373 caYAxigum5TUnMyy1CJ9uwSujP3ft7EWfOaomNSzg72BcSt7FyMnh4SAiUTj3BmMELaYxIV7 69m6GLk4hAQWMUrMW/aMGcJZzyTxbE0TC0gVm4CqxMQV99lAbBEBU4mOSUvB4swChRILe54C 2RwcwgIuEnfnK4CEWYDK+05MB1vGCxS+vqGPDWKZgsSCe2/ZJjByL2BkWMUomlqQXFCclJ5r pFecmFtcmpeul5yfu4kR7MNn0jsYVzVYHGIU4GBU4uGNYA0KEGJNLCuuzD3EKMHBrCTCa6sN FOJNSaysSi3Kjy8qzUktPsQozcGiJM4r/CkwQEggPbEkNTs1tSC1CCbLxMEp1cA4fUfGwrsV JrfZqvPOvF16oOpY6f19CqXPDtSenGXM0mLfarJSvL+TSXjtuuzEiZd2H8uVjrI3Uzex/N/b GiVYt3zhUf6j6xuyDOcs1dHkaYy2nb5c8PaBxKwNrz7OtSyomsmx8eSMnLQXxb1XU2tEr7Ee uS/kufa2svHG/Wlf7u1TmM30qnySEktxRqKhFnNRcSIAevq07d0BAAA= Cc: kyungmin.park@samsung.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org when page flip is requested, crtc's dpms mode should be on. if not on, return -EPERM so that the hardware can't be accessed. if user requesed dpms off and next page flip then the hardware can be accessed with dpms off to enable vblank so this patch will prevent from accessing the hardware with dpms off. Signed-off-by: Inki Dae Signed-off-by: Kyungmin Park --- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c index 8bd4d7e..5eda559 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c @@ -207,6 +207,12 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc, DRM_DEBUG_KMS("%s\n", __FILE__); + /* when the page flip is requested, crtc's dpms should be on */ + if (exynos_crtc->dpms > DRM_MODE_DPMS_ON) { + DRM_ERROR("failed page flip request.\n"); + return -EPERM; + } + mutex_lock(&dev->struct_mutex); if (event) {