From patchwork Tue Apr 5 08:27:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 8748761 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 7D5689F36E for ; Tue, 5 Apr 2016 08:27:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1CCCA20379 for ; Tue, 5 Apr 2016 08:27:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 86FB92035D for ; Tue, 5 Apr 2016 08:27:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753633AbcDEI1v (ORCPT ); Tue, 5 Apr 2016 04:27:51 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:54354 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751718AbcDEI1t (ORCPT ); Tue, 5 Apr 2016 04:27:49 -0400 Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O5502I83JIA4B70@mailout4.samsung.com> for linux-samsung-soc@vger.kernel.org; Tue, 05 Apr 2016 17:27:46 +0900 (KST) Received: from epcpsbgm1new.samsung.com ( [172.20.52.116]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id 43.B0.04781.20773075; Tue, 5 Apr 2016 17:27:46 +0900 (KST) X-AuditID: cbfee68f-f79c86d0000012ad-38-570377029b7f Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id B1.E7.06682.20773075; Tue, 5 Apr 2016 17:27:46 +0900 (KST) Received: from localhost.localdomain ([10.113.62.206]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O55005VWJI91D20@mmp2.samsung.com>; Tue, 05 Apr 2016 17:27:46 +0900 (KST) From: Inki Dae To: dri-devel@lists.freedesktop.org Cc: airlied@linux.ie, linux-samsung-soc@vger.kernel.org, Inki Dae Subject: [PATCH 1/3] drm/exynos: clean up wait_for_vblank Date: Tue, 05 Apr 2016 17:27:42 +0900 Message-id: <1459844864-12065-2-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1459844864-12065-1-git-send-email-inki.dae@samsung.com> References: <1459844864-12065-1-git-send-email-inki.dae@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrBLMWRmVeSWpSXmKPExsWyRsSkRJepnDnc4NcXLYvecyeZLK58fc9m Men+BBaLGef3MTmweGz/9oDV4373cSaPvi2rGD0+b5ILYInisklJzcksSy3St0vgytj09hhb wS2tisPP+xkbGKerdDFyckgImEjsXfSaHcIWk7hwbz1bFyMXh5DACkaJyRs3scEUzezcwQyR mMUo8WHfJBYI5wejxKk/i8Da2QRUJSauuA/WISKgLPF34ipGEJtZIEpi+eGlYDXCApYSq08u BYuzANUv2f6YFcTmFXCRePXjBBPENjmJk8cmg8U5BVwl2o7NBqsXAqrpvrCCEWSxhMBvNonp z5ewQQwSkPg2+RDQRRxACVmJTQeYIeZIShxccYNlAqPwAkaGVYyiqQXJBcVJ6UXGesWJucWl eel6yfm5mxiBAXz637P+HYx3D1gfYhTgYFTi4Z35nilciDWxrLgy9xCjKdCGicxSosn5wDjJ K4k3NDYzsjA1MTU2Mrc0UxLnXSj1M1hIID2xJDU7NbUgtSi+qDQntfgQIxMHp1QDY0C2gK8x 22HxN8kK5fV7Jrbv+PbMXagh5dGv2BWXG90M2aMXLw+5Ih/qqG7Iz35qV1Q999KW3NfWu/bO m2T/O/LqRb11mlm79HWP6RbqRBvwJmllqDLyX2Saua304z4hJvYDMwLu5K84a9ajN/XJNb/7 szsePzY0fP7N3jYiStTr0cb1S69/V2Ipzkg01GIuKk4EAMyixwNbAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprKIsWRmVeSWpSXmKPExsVy+t9jQV2mcuZwg4uXlSx6z51ksrjy9T2b xaT7E1gsZpzfx+TA4rH92wNWj/vdx5k8+rasYvT4vEkugCWqgdEmIzUxJbVIITUvOT8lMy/d Vsk7ON453tTMwFDX0NLCXEkhLzE31VbJxSdA1y0zB2inkkJZYk4pUCggsbhYSd8O04TQEDdd C5jGCF3fkCC4HiMDNJCwhjFj09tjbAW3tCoOP+9nbGCcrtLFyMkhIWAiMbNzBzOELSZx4d56 ti5GLg4hgVmMEh/2TWKBcH4wSpz6s4gdpIpNQFVi4or7bCC2iICyxN+JqxhBbGaBKInlh5eC 1QgLWEqsPrkULM4CVL9k+2NWEJtXwEXi1Y8TTBDb5CROHpsMFucUcJVoOzYbrF4IqKb7wgrG CYy8CxgZVjFKpBYkFxQnpeca5qWW6xUn5haX5qXrJefnbmIER8kzqR2MB3e5H2IU4GBU4uGd 8Z4pXIg1say4MvcQowQHs5II76pi5nAh3pTEyqrUovz4otKc1OJDjKZAh01klhJNzgdGcF5J vKGxiZmRpZG5oYWRsbmSOO/j/+vChATSE0tSs1NTC1KLYPqYODilGhgjdzys7DP4YczYKrcr PzlAefeaHu5/r01T05g3zVgR4Nhj+bs48b3kvDPswSdtlJ6wWT23+r7VOY+Th+U8j2MAz/r2 w9x+Cw9Ze12c1nzivrhXjF9+5D6JZsNd4St/G3gHXjTUF/83XU1E4GrOKkn5kO/nI4U5X214 pKy9dF4K1+K0d+UmOkosxRmJhlrMRcWJALR0HPmoAgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 This patch cleans up wait_for_vblank relevant codes. wait_for_vblank callback isn't used anymore in Exynos drm driver so it removes relevant codes. However, display controllers - FIMD and DECON - still use this function driver internally to ensure shadow registers to be updated, which resolves page fault issue so keep it. Signed-off-by: Inki Dae --- drivers/gpu/drm/exynos/exynos7_drm_decon.c | 1 - drivers/gpu/drm/exynos/exynos_drm_drv.h | 3 --- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 1 - drivers/gpu/drm/exynos/exynos_mixer.c | 39 ------------------------------ 4 files changed, 44 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c b/drivers/gpu/drm/exynos/exynos7_drm_decon.c index 9336107..f6223f9 100644 --- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c +++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c @@ -593,7 +593,6 @@ static const struct exynos_drm_crtc_ops decon_crtc_ops = { .commit = decon_commit, .enable_vblank = decon_enable_vblank, .disable_vblank = decon_disable_vblank, - .wait_for_vblank = decon_wait_for_vblank, .atomic_begin = decon_atomic_begin, .update_plane = decon_update_plane, .disable_plane = decon_disable_plane, diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index 502f750..bfe835a 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -120,8 +120,6 @@ struct exynos_drm_plane_config { * @commit: set current hw specific display mode to hw. * @enable_vblank: specific driver callback for enabling vblank interrupt. * @disable_vblank: specific driver callback for disabling vblank interrupt. - * @wait_for_vblank: wait for vblank interrupt to make sure that - * hardware overlay is updated. * @atomic_check: validate state * @atomic_begin: prepare device to receive an update * @atomic_flush: mark the end of device update @@ -141,7 +139,6 @@ struct exynos_drm_crtc_ops { void (*commit)(struct exynos_drm_crtc *crtc); int (*enable_vblank)(struct exynos_drm_crtc *crtc); void (*disable_vblank)(struct exynos_drm_crtc *crtc); - void (*wait_for_vblank)(struct exynos_drm_crtc *crtc); int (*atomic_check)(struct exynos_drm_crtc *crtc, struct drm_crtc_state *state); void (*atomic_begin)(struct exynos_drm_crtc *crtc); diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 51d484a..752c6b0 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -902,7 +902,6 @@ static const struct exynos_drm_crtc_ops fimd_crtc_ops = { .commit = fimd_commit, .enable_vblank = fimd_enable_vblank, .disable_vblank = fimd_disable_vblank, - .wait_for_vblank = fimd_wait_for_vblank, .atomic_begin = fimd_atomic_begin, .update_plane = fimd_update_plane, .disable_plane = fimd_disable_plane, diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c index 0a5a600..f272417 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c @@ -103,8 +103,6 @@ struct mixer_context { struct mixer_resources mixer_res; enum mixer_version_id mxr_ver; - wait_queue_head_t wait_vsync_queue; - atomic_t wait_vsync_event; }; struct mixer_drv_data { @@ -787,12 +785,6 @@ static irqreturn_t mixer_irq_handler(int irq, void *arg) exynos_drm_crtc_finish_update(ctx->crtc, plane); } - - /* set wait vsync event to zero and wake up queue. */ - if (atomic_read(&ctx->wait_vsync_event)) { - atomic_set(&ctx->wait_vsync_event, 0); - wake_up(&ctx->wait_vsync_queue); - } } out: @@ -1027,34 +1019,6 @@ static void mixer_atomic_flush(struct exynos_drm_crtc *crtc) mixer_vsync_set_update(mixer_ctx, true); } -static void mixer_wait_for_vblank(struct exynos_drm_crtc *crtc) -{ - struct mixer_context *mixer_ctx = crtc->ctx; - int err; - - if (!test_bit(MXR_BIT_POWERED, &mixer_ctx->flags)) - return; - - err = drm_vblank_get(mixer_ctx->drm_dev, mixer_ctx->pipe); - if (err < 0) { - DRM_DEBUG_KMS("failed to acquire vblank counter\n"); - return; - } - - atomic_set(&mixer_ctx->wait_vsync_event, 1); - - /* - * wait for MIXER to signal VSYNC interrupt or return after - * timeout which is set to 50ms (refresh rate of 20). - */ - if (!wait_event_timeout(mixer_ctx->wait_vsync_queue, - !atomic_read(&mixer_ctx->wait_vsync_event), - HZ/20)) - DRM_DEBUG_KMS("vblank wait timed out.\n"); - - drm_vblank_put(mixer_ctx->drm_dev, mixer_ctx->pipe); -} - static void mixer_enable(struct exynos_drm_crtc *crtc) { struct mixer_context *ctx = crtc->ctx; @@ -1126,7 +1090,6 @@ static const struct exynos_drm_crtc_ops mixer_crtc_ops = { .disable = mixer_disable, .enable_vblank = mixer_enable_vblank, .disable_vblank = mixer_disable_vblank, - .wait_for_vblank = mixer_wait_for_vblank, .atomic_begin = mixer_atomic_begin, .update_plane = mixer_update_plane, .disable_plane = mixer_disable_plane, @@ -1268,8 +1231,6 @@ static int mixer_probe(struct platform_device *pdev) ctx->vp_enabled = drv->is_vp_enabled; ctx->has_sclk = drv->has_sclk; ctx->mxr_ver = drv->version; - init_waitqueue_head(&ctx->wait_vsync_queue); - atomic_set(&ctx->wait_vsync_event, 0); platform_set_drvdata(pdev, ctx);