From patchwork Thu Aug 20 02:33:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hyungwon Hwang X-Patchwork-Id: 7040381 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 277D39F373 for ; Thu, 20 Aug 2015 02:33:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2B878207CF for ; Thu, 20 Aug 2015 02:33:46 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C37132078C for ; Thu, 20 Aug 2015 02:33:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 879EA6E0D7; Wed, 19 Aug 2015 19:33:43 -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 ESMTPS id 753D06E0D7 for ; Wed, 19 Aug 2015 19:33:42 -0700 (PDT) Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NTD005GO0G3L190@mailout2.samsung.com> for dri-devel@lists.freedesktop.org; Thu, 20 Aug 2015 11:33:39 +0900 (KST) Received: from epcpsbgm2new.samsung.com ( [172.20.52.116]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id D0.08.28411.38C35D55; Thu, 20 Aug 2015 11:33:39 +0900 (KST) X-AuditID: cbfee68e-f79c56d000006efb-b4-55d53c83036f Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 5E.F1.07062.38C35D55; Thu, 20 Aug 2015 11:33:39 +0900 (KST) Received: from localhost.localdomain.localdomain ([10.252.82.145]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NTD006CE0FTMVC0@mmp1.samsung.com>; Thu, 20 Aug 2015 11:33:39 +0900 (KST) From: Hyungwon Hwang To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/2] drm/exynos: implement exynos_crtc_atomic_{begin/flush} Date: Thu, 20 Aug 2015 11:33:26 +0900 Message-id: <1440038007-32192-1-git-send-email-human.hwang@samsung.com> X-Mailer: git-send-email 2.4.3 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrNLMWRmVeSWpSXmKPExsWyRsSkRLfZ5mqoQWunvMWVr+/ZLJbO6GO1 mHR/AovFi3sXWSxmTH7J5sDqcb/7OJNH35ZVjAFMUVw2Kak5mWWpRfp2CVwZzf+fMxY0CVfM 32HfwNgp0MXIySEhYCLR8PgfK4QtJnHh3nq2LkYuDiGBFYwSc5qOsMAU3fvexASRWMoosWfL LnYIp41J4tPVc4wgVWwCehILrv1gB7FFBJQl/k5cBRZnFiiVuDN/MTOILSzgLXHv7hawqSwC qhKvpy1gArF5Bdwldj+ZxAyxTU7i3PovLCALJATus0ncvr2JHaJBQOLb5ENACQ6ghKzEpgNQ 9ZISB1fcYJnAKLiAkWEVo2hqQXJBcVJ6kZFecWJucWleul5yfu4mRmAYnv73rG8H480D1ocY BTgYlXh4V1pfDRViTSwrrsw9xGgKtGEis5Rocj4w2PNK4g2NzYwsTE1MjY3MLc2UxHkTpH4G CwmkJ5akZqemFqQWxReV5qQWH2Jk4uCUamBc90BShz2xNuqCuXZiWdfmF98TZuW/u3ZZu2P7 U0WW69eUEqRanH0mOUxdJRumdaHS8Njb9Qw3xaesuLzvAbOW9bSzlTN41Kzm+cRWLfv73Cby i9jSR61G36wEpkz9tGtaxawL03dYLuY+y5xamhW86tBajUvZvck1kT3r2mpLw2PyLrz/vMRV iaU4I9FQi7moOBEARTxKVT4CAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrBLMWRmVeSWpSXmKPExsVy+t9jAd1mm6uhBjsfi1lc+fqezWLpjD5W i0n3J7BYvLh3kcVixuSXbA6sHve7jzN59G1ZxRjAFNXAaJORmpiSWqSQmpecn5KZl26r5B0c 7xxvamZgqGtoaWGupJCXmJtqq+TiE6DrlpkDtE9JoSwxpxQoFJBYXKykb4dpQmiIm64FTGOE rm9IEFyPkQEaSFjDmNH8/zljQZNwxfwd9g2MnQJdjJwcEgImEve+NzFB2GISF+6tZ+ti5OIQ EljKKLFnyy52CKeNSeLT1XOMIFVsAnoSC679YAexRQSUJf5OXAUWZxYolbgzfzEziC0s4C1x 7+4WFhCbRUBV4vW0BWAbeAXcJXY/mcQMsU1O4tz6LywTGLkXMDKsYpRILUguKE5KzzXKSy3X K07MLS7NS9dLzs/dxAgO9WfSOxgP73I/xCjAwajEw3tB+GqoEGtiWXFl7iFGCQ5mJRFePx2g EG9KYmVValF+fFFpTmrxIUZToAMmMkuJJucD4zCvJN7Q2MTMyNLI3NDCyNhcSZxX32RTqJBA emJJanZqakFqEUwfEwenVAPjtvnb29zvf1qjWPHk/bTbn/OftIcaGh3aEtX/7yL/hU7WW2fK Zvkc+1x37tL2m/7pvnzvq5tMuhPCrz/+bqooKKq/5PH0RT56rz13il/5NN/u0LZ1a1+tmJwx 7726Tv3je132HNtPmNqJL9R2q77klXFDtPTOV7Ftr49nbPPo9SwUnj+l16T8khJLcUaioRZz UXEiAN6tDbOLAgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Cc: sw0312.kim@samsung.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP All chagnes in CRTCs of Exynos are applied in H/W, only when the protection for shadow register update is not enabled. Using these protection, every change can be applied at once. Now exynos_crtc_atomic_{begin/flush} stops or starts the update of shadow registers by calling each CRTC specific atomic_{begin/flush}. Signed-off-by: Hyungwon Hwang --- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 7 +++++++ drivers/gpu/drm/exynos/exynos_drm_drv.h | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c index c478997..0201b54 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c @@ -88,11 +88,18 @@ static void exynos_crtc_atomic_begin(struct drm_crtc *crtc, WARN_ON(drm_crtc_vblank_get(crtc) != 0); exynos_crtc->event = crtc->state->event; } + + if (exynos_crtc->ops->atomic_begin) + exynos_crtc->ops->atomic_begin(exynos_crtc); } static void exynos_crtc_atomic_flush(struct drm_crtc *crtc, struct drm_crtc_state *old_crtc_state) { + struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc); + + if (exynos_crtc->ops->atomic_flush) + exynos_crtc->ops->atomic_flush(exynos_crtc); } static struct drm_crtc_helper_funcs exynos_crtc_helper_funcs = { diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index 6b8a30f..887922d 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -95,6 +95,10 @@ struct exynos_drm_plane { * called from exynos-dp driver before powering up (with * 'enable' argument as true) and after powering down (with * 'enable' as false). + * @atomic_begin: stop the changes in the CRTC shadow registers to being + * updated the CRTC active registers + * @atomic_flush: start the changes in the CRTC shadow registers to being + * updated the CRTC active registers */ struct exynos_drm_crtc; struct exynos_drm_crtc_ops { @@ -113,6 +117,8 @@ struct exynos_drm_crtc_ops { struct exynos_drm_plane *plane); void (*te_handler)(struct exynos_drm_crtc *crtc); void (*clock_enable)(struct exynos_drm_crtc *crtc, bool enable); + void (*atomic_begin)(struct exynos_drm_crtc *crtc); + void (*atomic_flush)(struct exynos_drm_crtc *crtc); }; /*