From patchwork Thu Dec 6 14:46:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prathyush K X-Patchwork-Id: 1844961 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 860963FCA5 for ; Thu, 6 Dec 2012 14:29:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6C30FE673D for ; Thu, 6 Dec 2012 06:29:07 -0800 (PST) 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 9456BE6757 for ; Thu, 6 Dec 2012 06:24:32 -0800 (PST) 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 <0MEM000SE5CVSDK0@mailout2.samsung.com> for dri-devel@lists.freedesktop.org; Thu, 06 Dec 2012 23:24:31 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.126]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 5F.3A.12699.F9AA0C05; Thu, 06 Dec 2012 23:24:31 +0900 (KST) X-AuditID: cbfee61b-b7f616d00000319b-18-50c0aa9f010a Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 3F.3A.12699.F9AA0C05; Thu, 06 Dec 2012 23:24:31 +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:31 +0900 (KST) From: Prathyush K To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/7] drm/exynos: move hdmi's wait_for_vblank to manager_ops Date: Thu, 06 Dec 2012 20:16:01 +0530 Message-id: <1354805166-29365-3-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+NgFrrFLMWRmVeSWpSXmKPExsWyRsSkTnf+qgMBBh8+qVhc+fqezYHR4373 caYAxigum5TUnMyy1CJ9uwSujNc/OtkLripXnFrSwtrAOFmui5GDQ0LAROLUftsuRk4gU0zi wr31bCC2kMBSRonFt4wh4iYSvyYvBopzAcWnM0os2PaUFcJZzSSx8NsPVpAqNgFtiV9z7oLZ IgLKEn8nrmIEsZkFJCSOtJ8Fmyos4C1xduZMJhCbRUBVYuKNn8wgNq+Au8TbC3sYIbYpSLQu O8QOchyngIfEuv+ZEAe5S+z6084K0Sog8W3yIRaI+2UlNh1gBjlHQuA6m8SZGbdZIcZIShxc cYNlAqPwAkaGVYyiqQXJBcVJ6blGesWJucWleel6yfm5mxiBAXj63zPpHYyrGiwOMQpwMCrx 8FpU7w8QYk0sK67MPcQowcGsJMIb03EgQIg3JbGyKrUoP76oNCe1+BCjD9AlE5mlRJPzgdGR VxJvaGxibmpsamlkZGZqikNYSZy32SMlQEggPbEkNTs1tSC1CGYcEwenVAPjLAMH/r5aGevt EzWy3yem+On5GR7+dyKlMeEfy+10aZ8df1+/OnU/Z2acUxbHpVBmz2o/1jeXMtcV/T4sNPvG tEd/LfKmL/K0uLt7T4bMvKbQxEyFO4evnPs149G1mYtZWsM1xGT/ijPxvz+jcyAwZhejS+Ga 7sprXe0ntSceNJsl+CTrHrOFEktxRqKhFnNRcSIAyKIDQW0CAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupmkeLIzCtJLcpLzFFi42I5/e+xoO78VQcCDDbukbG48vU9mwOjx/3u 40wBjFENjDYZqYkpqUUKqXnJ+SmZeem2St7B8c7xpmYGhrqGlhbmSgp5ibmptkouPgG6bpk5 QGOVFMoSc0qBQgGJxcVK+naYJoSGuOlawDRG6PqGBMH1GBmggYQ1jBmvf3SyF1xVrji1pIW1 gXGyXBcjJ4eEgInEr8mL2SBsMYkL99YD2VwcQgLTGSUWbHvKCuGsZpJY+O0HK0gVm4C2xK85 d8FsEQFlib8TVzGC2MwCEhJH2s+CTRIW8JY4O3MmE4jNIqAqMfHGT2YQm1fAXeLthT2MENsU JFqXHWLvYuTg4BTwkFj3PxMkLARUsutPO+sERt4FjAyrGEVTC5ILipPSc430ihNzi0vz0vWS 83M3MYJD/Jn0DsZVDRaHGAU4GJV4eC2q9wcIsSaWFVfmHmKU4GBWEuGN6TgQIMSbklhZlVqU H19UmpNafIjRB+ioicxSosn5wPjLK4k3NDYxNzU2tTSxMDGzxCGsJM7b7JESICSQnliSmp2a WpBaBDOOiYNTqoGx7XGYXYyq4hHtZ3H8i7pe5MzUZr0kyXC8cfd+3TdTU1L5LZkivm3xv/3f j837t9vBzFOrhbJObxCtbPz3rMi4dVGMeg2LfuVCNj07p0ie08vkGI6c5ntxfCaXZ92tG3av y2bdMpm6Q8ZuU8yx6ArVys+hGRW71hZvv/aQS4PdPeHdKrmcCFslluKMREMt5qLiRADcnCvg ngIAAA== 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 of hdmi and mixer is now moved from overlay_ops to manager_ops. Signed-off-by: Prathyush K --- drivers/gpu/drm/exynos/exynos_drm_hdmi.c | 22 +++++++++++----------- drivers/gpu/drm/exynos/exynos_drm_hdmi.h | 2 +- drivers/gpu/drm/exynos/exynos_mixer.c | 26 +++++++++++++------------- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c index 2d11e70..17d26e2 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c @@ -157,6 +157,16 @@ static void drm_hdmi_disable_vblank(struct device *subdrv_dev) return mixer_ops->disable_vblank(ctx->mixer_ctx->ctx); } +static void drm_hdmi_wait_for_vblank(struct device *subdrv_dev) +{ + struct drm_hdmi_context *ctx = to_context(subdrv_dev); + + DRM_DEBUG_KMS("%s\n", __FILE__); + + if (mixer_ops && mixer_ops->wait_for_vblank) + mixer_ops->wait_for_vblank(ctx->mixer_ctx->ctx); +} + static void drm_hdmi_mode_fixup(struct device *subdrv_dev, struct drm_connector *connector, const struct drm_display_mode *mode, @@ -238,6 +248,7 @@ static struct exynos_drm_manager_ops drm_hdmi_manager_ops = { .apply = drm_hdmi_apply, .enable_vblank = drm_hdmi_enable_vblank, .disable_vblank = drm_hdmi_disable_vblank, + .wait_for_vblank = drm_hdmi_wait_for_vblank, .mode_fixup = drm_hdmi_mode_fixup, .mode_set = drm_hdmi_mode_set, .get_max_resol = drm_hdmi_get_max_resol, @@ -291,21 +302,10 @@ static void drm_mixer_disable(struct device *subdrv_dev, int zpos) ctx->enabled[win] = false; } -static void drm_mixer_wait_for_vblank(struct device *subdrv_dev) -{ - struct drm_hdmi_context *ctx = to_context(subdrv_dev); - - DRM_DEBUG_KMS("%s\n", __FILE__); - - if (mixer_ops && mixer_ops->wait_for_vblank) - mixer_ops->wait_for_vblank(ctx->mixer_ctx->ctx); -} - static struct exynos_drm_overlay_ops drm_hdmi_overlay_ops = { .mode_set = drm_mixer_mode_set, .commit = drm_mixer_commit, .disable = drm_mixer_disable, - .wait_for_vblank = drm_mixer_wait_for_vblank, }; static struct exynos_drm_manager hdmi_manager = { diff --git a/drivers/gpu/drm/exynos/exynos_drm_hdmi.h b/drivers/gpu/drm/exynos/exynos_drm_hdmi.h index 54b5223..fcc3093 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_hdmi.h +++ b/drivers/gpu/drm/exynos/exynos_drm_hdmi.h @@ -65,10 +65,10 @@ struct exynos_mixer_ops { int (*iommu_on)(void *ctx, bool enable); int (*enable_vblank)(void *ctx, int pipe); void (*disable_vblank)(void *ctx); + void (*wait_for_vblank)(void *ctx); void (*dpms)(void *ctx, int mode); /* overlay */ - void (*wait_for_vblank)(void *ctx); void (*win_mode_set)(void *ctx, struct exynos_drm_overlay *overlay); void (*win_commit)(void *ctx, int zpos); void (*win_disable)(void *ctx, int zpos); diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c index 40a6e19..b6f12fb 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c @@ -788,18 +788,6 @@ static void mixer_dpms(void *ctx, int mode) } } -static void mixer_wait_for_vblank(void *ctx) -{ - struct mixer_context *mixer_ctx = ctx; - struct mixer_resources *res = &mixer_ctx->mixer_res; - int ret; - - ret = wait_for((mixer_reg_read(res, MXR_INT_STATUS) & - MXR_INT_STATUS_VSYNC), 50); - if (ret < 0) - DRM_DEBUG_KMS("vblank wait timed out.\n"); -} - static void mixer_win_mode_set(void *ctx, struct exynos_drm_overlay *overlay) { @@ -885,15 +873,27 @@ static void mixer_win_disable(void *ctx, int win) spin_unlock_irqrestore(&res->reg_slock, flags); } +static void mixer_wait_for_vblank(void *ctx) +{ + struct mixer_context *mixer_ctx = ctx; + struct mixer_resources *res = &mixer_ctx->mixer_res; + int ret; + + ret = wait_for((mixer_reg_read(res, MXR_INT_STATUS) & + MXR_INT_STATUS_VSYNC), 50); + if (ret < 0) + DRM_DEBUG_KMS("vblank wait timed out.\n"); +} + static struct exynos_mixer_ops mixer_ops = { /* manager */ .iommu_on = mixer_iommu_on, .enable_vblank = mixer_enable_vblank, .disable_vblank = mixer_disable_vblank, + .wait_for_vblank = mixer_wait_for_vblank, .dpms = mixer_dpms, /* overlay */ - .wait_for_vblank = mixer_wait_for_vblank, .win_mode_set = mixer_win_mode_set, .win_commit = mixer_win_commit, .win_disable = mixer_win_disable,