From patchwork Wed Dec 26 11:27:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prathyush K X-Patchwork-Id: 1910921 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 97620DFAC4 for ; Wed, 26 Dec 2012 11:07:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 94F4DE610B for ; Wed, 26 Dec 2012 03:07:52 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by gabe.freedesktop.org (Postfix) with ESMTP id 380F8E60BA for ; Wed, 26 Dec 2012 03:05:25 -0800 (PST) Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MFM00JGIXGI8NA0@mailout4.samsung.com> for dri-devel@lists.freedesktop.org; Wed, 26 Dec 2012 20:05:23 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.123]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id FF.7D.01231.3F9DAD05; Wed, 26 Dec 2012 20:05:23 +0900 (KST) X-AuditID: cbfee61a-b7fa66d0000004cf-30-50dad9f3685b Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id CF.7D.01231.3F9DAD05; Wed, 26 Dec 2012 20:05:23 +0900 (KST) Received: from chrome-ubuntu.sisodomain.com ([107.108.73.106]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MFM0029MXGTEU90@mmp1.samsung.com> for dri-devel@lists.freedesktop.org; Wed, 26 Dec 2012 20:05:23 +0900 (KST) From: Prathyush K To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/8] drm/exynos: add mixer apply function Date: Wed, 26 Dec 2012 06:27:38 -0500 Message-id: <1356521265-22749-2-git-send-email-prathyush.k@samsung.com> X-Mailer: git-send-email 1.8.0 In-reply-to: <1356521265-22749-1-git-send-email-prathyush.k@samsung.com> References: <1356521265-22749-1-git-send-email-prathyush.k@samsung.com> DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrDLMWRmVeSWpSXmKPExsWyRsSkWvfzzVsBBt9uilpc+fqezYHR4373 caYAxigum5TUnMyy1CJ9uwSujBvN69gLpihUTDt7ibmB8ZdUFyMHh4SAicSE07VdjJxAppjE hXvr2boYuTiEBJYySnx6eoYdImEi8XnJBCaIxCJGiXmLf7BCOBuZJN6+vA5WxSagLfFrzl1W EFtEQFni78RVjCA2s4CExJH2s2wgtrCApURLzwmwOIuAqsTGZ9fA6nkF3CWWXbrEBrFNTuLD nkdgMzkFPCQubNwDViMEVNP24AMrRK+AxLfJh1ggPpCV2HSAGeQeCYHrbBJzpt1nhJgjKXFw xQ2WCYzCCxgZVjGKphYkFxQnpeca6hUn5haX5qXrJefnbmIEBuHpf8+kdjCubLA4xCjAwajE w7vx+80AIdbEsuLK3EOMEhzMSiK8CqtuBQjxpiRWVqUW5ccXleakFh9i9AG6ZCKzlGhyPjBC 8kriDY1NzE2NTS2NjMxMTXEIK4nzNnukBAgJpCeWpGanphakFsGMY+LglGpg3J6p7xT5d8bM rSVar/N/hdv2X/zedt/DOl7riPXUnRbz7CK6ufIF78ZdZrFc/ldsT2F4nrcgj/uNV4cmlUil Ve9S+9j6JrY+5wqnTNe1N9Hf67LzRPRO1bHpTb2+iM9XLNZjgQmrdOsW52mZbRIMk5uNP72a O+PT7fnzv9eujny59s4JiYeTlViKMxINtZiLihMBTyqNRm8CAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphkeLIzCtJLcpLzFFi42I5/e+xgO7nm7cCDC51Clhc+fqezYHR4373 caYAxqgGRpuM1MSU1CKF1Lzk/JTMvHRbJe/geOd4UzMDQ11DSwtzJYW8xNxUWyUXnwBdt8wc oLFKCmWJOaVAoYDE4mIlfTtME0JD3HQtYBojdH1DguB6jAzQQMIaxowbzevYC6YoVEw7e4m5 gfGXVBcjJ4eEgInE5yUTmCBsMYkL99azdTFycQgJLGKUmLf4ByuEs5FJ4u3L6+wgVWwC2hK/ 5txlBbFFBJQl/k5cxQhiMwtISBxpP8sGYgsLWEq09JwAi7MIqEpsfHYNrJ5XwF1i2aVLbBDb 5CQ+7HkENpNTwEPiwsY9YDVCQDVtDz6wTmDkXcDIsIpRNLUguaA4KT3XUK84Mbe4NC9dLzk/ dxMjOMifSe1gXNlgcYhRgINRiYd34/ebAUKsiWXFlbmHGCU4mJVEeBVW3QoQ4k1JrKxKLcqP LyrNSS0+xOgDdNVEZinR5HxgBOaVxBsam5ibGptamliYmFniEFYS5232SAkQEkhPLEnNTk0t SC2CGcfEwSnVwJhg91a9WvqgV8EE5bYtxY43m6+8WM/j2fv35wnBJsMu92dcLptK7f9ev3pE 7VVYUEs62+ZDu3RYLqoyn03lfC0vasJu2Re1UehfSkH6dVX2wItfLjW/FedqiFL5fbHXJJ39 yN0z/7fKbDr2vJ39yd51kz5xu59sELi8YkHjJakFU/zzz+/Xe6jEUpyRaKjFXFScCABoZe7L nwIAAA== 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 Currently, an enabled flag for each mixer window is being set in both mixer and the common hdmi framework. This patch adds an apply function in mixer and moves the enabled flag inside the mixer. This is required to ensure the enabled flag is updated by the resume flag during dpms. Signed-off-by: Prathyush K --- drivers/gpu/drm/exynos/exynos_drm_hdmi.c | 15 ++------------- drivers/gpu/drm/exynos/exynos_drm_hdmi.h | 1 + drivers/gpu/drm/exynos/exynos_mixer.c | 18 +++++++++++++++++- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c index 55793c4..d8ae47e 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c @@ -45,8 +45,6 @@ struct drm_hdmi_context { struct exynos_drm_subdrv subdrv; struct exynos_drm_hdmi_context *hdmi_ctx; struct exynos_drm_hdmi_context *mixer_ctx; - - bool enabled[MIXER_WIN_NR]; }; int exynos_platform_device_hdmi_register(void) @@ -250,16 +248,11 @@ static void drm_hdmi_dpms(struct device *subdrv_dev, int mode) static void drm_hdmi_apply(struct device *subdrv_dev) { struct drm_hdmi_context *ctx = to_context(subdrv_dev); - int i; DRM_DEBUG_KMS("%s\n", __FILE__); - for (i = 0; i < MIXER_WIN_NR; i++) { - if (!ctx->enabled[i]) - continue; - if (mixer_ops && mixer_ops->win_commit) - mixer_ops->win_commit(ctx->mixer_ctx->ctx, i); - } + if (mixer_ops && mixer_ops->apply) + mixer_ops->apply(ctx->mixer_ctx->ctx); if (hdmi_ops && hdmi_ops->commit) hdmi_ops->commit(ctx->hdmi_ctx->ctx); @@ -302,8 +295,6 @@ static void drm_mixer_commit(struct device *subdrv_dev, int zpos) if (mixer_ops && mixer_ops->win_commit) mixer_ops->win_commit(ctx->mixer_ctx->ctx, win); - - ctx->enabled[win] = true; } static void drm_mixer_disable(struct device *subdrv_dev, int zpos) @@ -320,8 +311,6 @@ static void drm_mixer_disable(struct device *subdrv_dev, int zpos) if (mixer_ops && mixer_ops->win_disable) mixer_ops->win_disable(ctx->mixer_ctx->ctx, win); - - ctx->enabled[win] = false; } static struct exynos_drm_overlay_ops drm_hdmi_overlay_ops = { diff --git a/drivers/gpu/drm/exynos/exynos_drm_hdmi.h b/drivers/gpu/drm/exynos/exynos_drm_hdmi.h index 784a7e9..4fad00c 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_hdmi.h +++ b/drivers/gpu/drm/exynos/exynos_drm_hdmi.h @@ -58,6 +58,7 @@ struct exynos_mixer_ops { 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); + void (*apply)(void *ctx); }; void exynos_hdmi_drv_attach(struct exynos_drm_hdmi_context *ctx); diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c index 21db895..2506567 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c @@ -810,6 +810,20 @@ static void mixer_win_disable(void *ctx, int win) mixer_ctx->win_data[win].enabled = false; } +static void mixer_apply(void *ctx) +{ + struct mixer_context *mixer_ctx = ctx; + int i; + + DRM_DEBUG_KMS("%s\n", __FILE__); + + for (i = 0; i < MIXER_WIN_NR; i++) { + struct hdmi_win_data *win_data = &mixer_ctx->win_data[i]; + if (win_data->enabled) + mixer_win_commit(ctx, i); + } +} + static void mixer_wait_for_vblank(void *ctx) { struct mixer_context *mixer_ctx = ctx; @@ -841,7 +855,8 @@ static void mixer_window_suspend(struct mixer_context *ctx) for (i = 0; i < MIXER_WIN_NR; i++) { win_data = &ctx->win_data[i]; win_data->resume = win_data->enabled; - mixer_win_disable(ctx, i); + if (win_data->enabled) + mixer_win_disable(ctx, i); } mixer_wait_for_vblank(ctx); } @@ -947,6 +962,7 @@ static struct exynos_mixer_ops mixer_ops = { .win_mode_set = mixer_win_mode_set, .win_commit = mixer_win_commit, .win_disable = mixer_win_disable, + .apply = mixer_apply, }; /* for pageflip event */