From patchwork Thu Dec 6 14:46:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prathyush K X-Patchwork-Id: 1844951 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 22870DF2F9 for ; Thu, 6 Dec 2012 14:27:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 15D22E67A5 for ; Thu, 6 Dec 2012 06:27:09 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by gabe.freedesktop.org (Postfix) with ESMTP id 132B6E672D for ; Thu, 6 Dec 2012 06:24:08 -0800 (PST) Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MEM00EWE5C689N0@mailout3.samsung.com> for dri-devel@lists.freedesktop.org; Thu, 06 Dec 2012 23:24:07 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.122]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 05.3A.12699.78AA0C05; Thu, 06 Dec 2012 23:24:07 +0900 (KST) X-AuditID: cbfee61b-b7f616d00000319b-ed-50c0aa870317 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id E4.3A.12699.68AA0C05; Thu, 06 Dec 2012 23:24:06 +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 <0MEM009QO5AHQGB0@mmp2.samsung.com> for dri-devel@lists.freedesktop.org; Thu, 06 Dec 2012 23:24:06 +0900 (KST) From: Prathyush K To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/7] drm/exynos: make wait_for_vblank a manager op Date: Thu, 06 Dec 2012 20:16:00 +0530 Message-id: <1354805166-29365-2-git-send-email-prathyush.k@samsung.com> X-Mailer: git-send-email 1.7.0.4 In-reply-to: <1354805166-29365-1-git-send-email-prathyush.k@samsung.com> References: <1354805166-29365-1-git-send-email-prathyush.k@samsung.com> DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrFLMWRmVeSWpSXmKPExsWyRsSkSrd91YEAg93r2CyufH3P5sDocb/7 OFMAYxSXTUpqTmZZapG+XQJXRvuxNraCtdIVp+f9Ym5g/CbWxcjJISFgItF5ZCUThC0mceHe ejYQW0hgKaNE3ylWmJrdC18xdjFyAcWnM0pMnnGTHcJZzSSxsWs+I0gVm4C2xK85d8E6RASU Jf5OXAUWZxaQkDjSfhZsqrCAk8Sv7iVANRwcLAKqEhPP1IKEeQXcJQ6cnMAMsUxBonXZIXaQ Ek4BD4l1/zMh7nGX2PWnHWw6i4CAxLfJh1hASiQEZCU2HWAGuUZC4DKbxLSlH6DGSEocXHGD ZQKj8AJGhlWMoqkFyQXFSem5RnrFibnFpXnpesn5uZsYgQF4+t8z6R2MqxosDjEKcDAq8fBa VO8PEGJNLCuuzD3EKMHBrCTCG9NxIECINyWxsiq1KD++qDQntfgQow/QJROZpUST84HRkVcS b2hsYm5qbGppZGRmaopDWEmct9kjJUBIID2xJDU7NbUgtQhmHBMHp1QDY4DmhmnzdkxKVk2N zXz7tJa945H4xmlS38qKPF1OpS+5/3+DTwWXzu3WnwkuIWJ5wmk28xU2d607e+zQvbQbxvee y1x6+d5NatuRyVNcLt2+HtZwgym9p/C0TqCR89IZann1PVZTpbIDP3xOET6j43W94drd8G/C 6z3P+sb5ras8GZCRkaWlpMRSnJFoqMVcVJwIAAZ/IM9tAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupikeLIzCtJLcpLzFFi42I5/e+xoG7bqgMBBs/abSyufH3P5sDocb/7 OFMAY1QDo01GamJKapFCal5yfkpmXrqtkndwvHO8qZmBoa6hpYW5kkJeYm6qrZKLT4CuW2YO 0FglhbLEnFKgUEBicbGSvh2mCaEhbroWMI0Rur4hQXA9RgZoIGENY0b7sTa2grXSFafn/WJu YPwm1sXIySEhYCKxe+ErRghbTOLCvfVsXYxcHEIC0xklJs+4yQ7hrGaS2Ng1H6yKTUBb4tec u6wgtoiAssTfiavA4swCEhJH2s+ygdjCAk4Sv7qXANVwcLAIqEpMPFMLEuYVcJc4cHICM8Qy BYnWZYfYQUo4BTwk1v3PBAkLAZXs+tPOOoGRdwEjwypG0dSC5ILipPRcI73ixNzi0rx0veT8 3E2M4AB/Jr2DcVWDxSFGAQ5GJR5ei+r9AUKsiWXFlbmHGCU4mJVEeGM6DgQI8aYkVlalFuXH F5XmpBYfYvQBumkis5Rocj4w+vJK4g2NTcxNjU0tTSxMzCxxCCuJ8zZ7pAQICaQnlqRmp6YW pBbBjGPi4JRqYNS/tdf5unrDxQul/Rz7jWQe/mB8rM3jeu1LfBDf8vN/3Dek9t33CDwmPKtn 71f+zKQn4sf3+x0w9J32YsGjPkcx8Q/35fmLJpu5snRq2WTZJG160+Lw+IfFhyifdis7rrvv Jl5U+v/1FadwqEvX9m1qXMsvnVvTIJzYbNYpa7up8q1d4qIcWyWW4oxEQy3mouJEAGQPdrad AgAA X-CFilter-Loop: Reflected 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 The wait_for_vblank callback is moved from overlay ops to manager ops of exynos drm driver. Also, the check for DPMS OFF of encoder is removed before calling wait_for_vblank. Signed-off-by: Prathyush K --- drivers/gpu/drm/exynos/exynos_drm_drv.h | 6 +++--- drivers/gpu/drm/exynos/exynos_drm_encoder.c | 15 ++++----------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index 9c9c2dc..398210d 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -74,8 +74,6 @@ enum exynos_drm_output_type { * @commit: apply hardware specific overlay data to registers. * @enable: enable hardware specific overlay. * @disable: disable hardware specific overlay. - * @wait_for_vblank: wait for vblank interrupt to make sure that - * hardware overlay is disabled. */ struct exynos_drm_overlay_ops { void (*mode_set)(struct device *subdrv_dev, @@ -83,7 +81,6 @@ struct exynos_drm_overlay_ops { void (*commit)(struct device *subdrv_dev, int zpos); void (*enable)(struct device *subdrv_dev, int zpos); void (*disable)(struct device *subdrv_dev, int zpos); - void (*wait_for_vblank)(struct device *subdrv_dev); }; /* @@ -186,6 +183,8 @@ struct exynos_drm_display_ops { * @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. */ struct exynos_drm_manager_ops { void (*dpms)(struct device *subdrv_dev, int mode); @@ -200,6 +199,7 @@ struct exynos_drm_manager_ops { void (*commit)(struct device *subdrv_dev); int (*enable_vblank)(struct device *subdrv_dev); void (*disable_vblank)(struct device *subdrv_dev); + void (*wait_for_vblank)(struct device *subdrv_dev); }; /* diff --git a/drivers/gpu/drm/exynos/exynos_drm_encoder.c b/drivers/gpu/drm/exynos/exynos_drm_encoder.c index d9afb11..3014852 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_encoder.c +++ b/drivers/gpu/drm/exynos/exynos_drm_encoder.c @@ -237,8 +237,7 @@ static void exynos_drm_encoder_commit(struct drm_encoder *encoder) void exynos_drm_encoder_complete_scanout(struct drm_framebuffer *fb) { struct exynos_drm_encoder *exynos_encoder; - struct exynos_drm_overlay_ops *overlay_ops; - struct exynos_drm_manager *manager; + struct exynos_drm_manager_ops *ops; struct drm_device *dev = fb->dev; struct drm_encoder *encoder; @@ -248,21 +247,15 @@ void exynos_drm_encoder_complete_scanout(struct drm_framebuffer *fb) */ list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { exynos_encoder = to_exynos_encoder(encoder); - - /* if exynos was disabled, just ignor it. */ - if (exynos_encoder->dpms > DRM_MODE_DPMS_ON) - continue; - - manager = exynos_encoder->manager; - overlay_ops = manager->overlay_ops; + ops = exynos_encoder->manager->ops; /* * wait for vblank interrupt * - this makes sure that overlay data are updated to * real hardware. */ - if (overlay_ops->wait_for_vblank) - overlay_ops->wait_for_vblank(manager->dev); + if (ops->wait_for_vblank) + ops->wait_for_vblank(exynos_encoder->manager->dev); } }