From patchwork Tue Dec 11 08:53:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 1861271 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 4EF3B3FCA5 for ; Tue, 11 Dec 2012 08:53:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 44F7CE6332 for ; Tue, 11 Dec 2012 00:53:35 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by gabe.freedesktop.org (Postfix) with ESMTP id BF269E6288 for ; Tue, 11 Dec 2012 00:53:21 -0800 (PST) Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MEU00BQVZC1B6Q0@mailout1.samsung.com> for dri-devel@lists.freedesktop.org; Tue, 11 Dec 2012 17:53:19 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [203.254.230.41]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 0D.13.01231.F74F6C05; Tue, 11 Dec 2012 17:53:19 +0900 (KST) X-AuditID: cbfee61a-b7fa66d0000004cf-6b-50c6f47fb09f Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 4C.13.01231.F74F6C05; Tue, 11 Dec 2012 17:53:19 +0900 (KST) Received: from daeinki-desktop.10.32.193.11 ([10.90.51.53]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MEU00G8KZCVYF40@mmp2.samsung.com> for dri-devel@lists.freedesktop.org; Tue, 11 Dec 2012 17:53:19 +0900 (KST) From: Inki Dae To: airlied@linux.ie, dri-devel@lists.freedesktop.org Subject: [PATCH v2] drm/exynos: make wait_for_vblank a manager op Date: Tue, 11 Dec 2012 17:53:18 +0900 Message-id: <1355215998-12954-1-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 1.7.4.1 In-reply-to: <1354805166-29365-2-git-send-email-prathyush.k@samsung.com> References: <1354805166-29365-2-git-send-email-prathyush.k@samsung.com> DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrLLMWRmVeSWpSXmKPExsVy+t8zTd36L8cCDG5u1Le48vU9mwOjx/3u 40wBjFFcNimpOZllqUX6dglcGd97trAXHFaqWN48i6WB8bFMFyMnh4SAiUT/zD8sELaYxIV7 69lAbCGBZYwSLVcSYWq+/epi7mLkAopPZ5Q4umMGC4Sznkniwq5rrCBVbAKqEhNX3AfrFhEw leiYtBSsiFlgBqPE7YOv2EESwgKOEr/WzmAGsVmAGmY/3AO2mlfAReJRzyFmiHUKEgvuvQUb xCngIfF40wYmiJPcJdrnN7JB9ApIfJt8CKiXA6heVmLTAbDrJAQus0nsXNnCCjFHUuLgihss ExiFFzAyrGIUTS1ILihOSs811CtOzC0uzUvXS87P3cQICUOpHYwrGywOMQpwMCrx8GpoHQsQ Yk0sK67MPcQowcGsJMJbmgsU4k1JrKxKLcqPLyrNSS0+xOgDdMlEZinR5HxgjOSVxBsaGxgb GloamplamhrgEFYS5232SAkQEkhPLEnNTk0tSC2CGcfEwSnVwBh7xGdXcFflJp33i6MdmSaF s3MmHFXR1ju676h8+r71vqs4cnr2JPmWPPl28t78u0WZLT+SzLNLTlxna1iscHjvxvLupoTG biauP/1cNeGSft+bg75e3hdWfX/lquMmbpz7OZ9ahL/fd+Ke8EIXv9fb7txUyWS4fcF3v1d7 edR8tpyzqg+VXJRYijMSDbWYi4oTAbV53J1wAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuplkeLIzCtJLcpLzFFi42I5/e+xoG79l2MBBv2PlS2ufH3P5sDocb/7 OFMAY1QDo01GamJKapFCal5yfkpmXrqtkndwvHO8qZmBoa6hpYW5kkJeYm6qrZKLT4CuW2YO 0FglhbLEnFKgUEBicbGSvh2mCaEhbroWMI0Rur4hQXA9RgZoIGEdY8b3ni3sBYeVKpY3z2Jp YHws08XIySEhYCLx7VcXM4QtJnHh3nq2LkYuDiGB6YwSR3fMYIFw1jNJXNh1jRWkik1AVWLi ivtsILaIgKlEx6SlYEXMAjMYJW4ffMUOkhAWcJT4tXYG2FgWoIbZD/ewgNi8Ai4Sj3oOQa1T kFhw7y3YIE4BD4nHmzYwgdhCAu4S7fMb2SYw8i5gZFjFKJpakFxQnJSea6hXnJhbXJqXrpec n7uJERzmz6R2MK5ssDjEKMDBqMTDq6F1LECINbGsuDL3EKMEB7OSCG9pLlCINyWxsiq1KD++ qDQntfgQow/QVROZpUST84ExmFcSb2hsYmZkaWRmbGJubIxDWEmct9kjJUBIID2xJDU7NbUg tQhmHBMHp1QDoz4/v+bdGkbZWyeMJk6Z+manYtpcq0snJj90XD9pWuOfVOX2K1y7o+fn9hqv lzaXvvpgxY3bpRUXS3jFpBZ2zvx6Sl3zvbayhFVHM/feietXswodSVoVuU/t7Sye+Y8VtIJq dC7oXRXw54vYcmbPE+HwpQeSN8bJMsxf+jzJ1jpwZ7uu9on/+5VYijMSDbWYi4oTAQAXuxSg AgAA X-CFilter-Loop: Reflected Cc: kyungmin.park@samsung.com, sw0312.kim@samsung.com, Prathyush K 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 From: Prathyush K Changelog v2: remove unnecessay wait_for_vblank call. - with this patch, wait_for_vblank callback is moved from overlay ops to manager ops so it should be removed and it doesn't need to wait vblank signal at plane disable. Changelog v1: 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 Signed-off-by: Inki Dae --- drivers/gpu/drm/exynos/exynos_drm_drv.h | 6 +++--- drivers/gpu/drm/exynos/exynos_drm_encoder.c | 25 ++++--------------------- 2 files changed, 7 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index a4702a8..5a8c1f2 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 e5001dd..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); } } @@ -538,14 +531,4 @@ void exynos_drm_encoder_plane_disable(struct drm_encoder *encoder, void *data) if (overlay_ops && overlay_ops->disable) overlay_ops->disable(manager->dev, zpos); - - /* - * wait for vblank interrupt - * - this makes sure that hardware overlay is disabled to avoid - * for the dma accesses to memory after gem buffer was released - * because the setting for disabling the overlay will be updated - * at vsync. - */ - if (overlay_ops && overlay_ops->wait_for_vblank) - overlay_ops->wait_for_vblank(manager->dev); }