From: Inki Dae <inki.dae@samsung.com>
To: YoungJun Cho <yj44.cho@samsung.com>
Cc: sw0312.kim@samsung.com, dri-devel@lists.freedesktop.org,
a.hajda@samsung.com, kyungmin.park@samsung.com
Subject: Re: [PATCH 2/7] drm/exynos: fimd: add fimd_channel_win() to clean up code
Date: Thu, 13 Nov 2014 18:05:53 +0900 [thread overview]
Message-ID: <54647471.6030502@samsung.com> (raw)
In-Reply-To: <1412144353-13114-3-git-send-email-yj44.cho@samsung.com>
On 2014년 10월 01일 15:19, YoungJun Cho wrote:
> The ENWIN_F in WINCON# register and C#_EN_Fs in SHADOWCON register
> should be always matched together, so adds fimd_channel_win()
> to clean up code.
> And this fimd_channel_win() should be called before unprotecting
> window in fimd_win_commit().
Sorry for late. below is my comment.
>
> Signed-off-by: YoungJun Cho <yj44.cho@samsung.com>
> Acked-by: Inki Dae <inki.dae@samsung.com>
> Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
> drivers/gpu/drm/exynos/exynos_drm_fimd.c | 62 ++++++++++++++++----------------
> 1 file changed, 30 insertions(+), 32 deletions(-)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> index 8b31b7e..b2f6007 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> @@ -214,6 +214,33 @@ static void fimd_wait_for_vblank(struct exynos_drm_manager *mgr)
> DRM_DEBUG_KMS("vblank wait timed out.\n");
> }
>
> +static void fimd_channel_win(struct fimd_context *ctx, int win, bool enable)
> +{
> + u32 val;
> +
> + /* for DMA output */
> + val = readl(ctx->regs + WINCON(win));
> +
> + if (enable)
> + val |= WINCONx_ENWIN;
> + else
> + val &= ~WINCONx_ENWIN;
> +
> + writel(val, ctx->regs + WINCON(win));
> +
> + /* for shadow channel */
> + if (ctx->driver_data->has_shadowcon) {
> + val = readl(ctx->regs + SHADOWCON);
> +
> + if (enable)
> + val |= SHADOWCON_CHx_ENABLE(win);
> + else
> + val &= ~SHADOWCON_CHx_ENABLE(win);
> +
> + writel(val, ctx->regs + SHADOWCON);
> + }
> +}
This function includes two functionalities. One is controlling DMA
output. Other is controlling shadow channel. How about using separated
two functions instead? And let's call shadowcon control function only if
has_shadowcon is 1.
Thanks,
Inki Dae
> +
> static void fimd_clear_channel(struct exynos_drm_manager *mgr)
> {
> struct fimd_context *ctx = mgr->ctx;
> @@ -226,16 +253,7 @@ static void fimd_clear_channel(struct exynos_drm_manager *mgr)
> u32 val = readl(ctx->regs + WINCON(win));
>
> if (val & WINCONx_ENWIN) {
> - /* wincon */
> - val &= ~WINCONx_ENWIN;
> - writel(val, ctx->regs + WINCON(win));
> -
> - /* unprotect windows */
> - if (ctx->driver_data->has_shadowcon) {
> - val = readl(ctx->regs + SHADOWCON);
> - val &= ~SHADOWCON_CHx_ENABLE(win);
> - writel(val, ctx->regs + SHADOWCON);
> - }
> + fimd_channel_win(ctx, win, false);
> ch_enabled = 1;
> }
> }
> @@ -730,20 +748,11 @@ static void fimd_win_commit(struct exynos_drm_manager *mgr, int zpos)
> if (win != 0)
> fimd_win_set_colkey(ctx, win);
>
> - /* wincon */
> - val = readl(ctx->regs + WINCON(win));
> - val |= WINCONx_ENWIN;
> - writel(val, ctx->regs + WINCON(win));
> + fimd_channel_win(ctx, win, true);
>
> /* Enable DMA channel and unprotect windows */
> fimd_shadow_protect_win(ctx, win, false);
>
> - if (ctx->driver_data->has_shadowcon) {
> - val = readl(ctx->regs + SHADOWCON);
> - val |= SHADOWCON_CHx_ENABLE(win);
> - writel(val, ctx->regs + SHADOWCON);
> - }
> -
> win_data->enabled = true;
>
> if (ctx->i80_if)
> @@ -755,7 +764,6 @@ static void fimd_win_disable(struct exynos_drm_manager *mgr, int zpos)
> struct fimd_context *ctx = mgr->ctx;
> struct fimd_win_data *win_data;
> int win = zpos;
> - u32 val;
>
> if (win == DEFAULT_ZPOS)
> win = ctx->default_win;
> @@ -774,17 +782,7 @@ static void fimd_win_disable(struct exynos_drm_manager *mgr, int zpos)
> /* protect windows */
> fimd_shadow_protect_win(ctx, win, true);
>
> - /* wincon */
> - val = readl(ctx->regs + WINCON(win));
> - val &= ~WINCONx_ENWIN;
> - writel(val, ctx->regs + WINCON(win));
> -
> - /* unprotect windows */
> - if (ctx->driver_data->has_shadowcon) {
> - val = readl(ctx->regs + SHADOWCON);
> - val &= ~SHADOWCON_CHx_ENABLE(win);
> - writel(val, ctx->regs + SHADOWCON);
> - }
> + fimd_channel_win(ctx, win, false);
>
> fimd_shadow_protect_win(ctx, win, false);
>
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2014-11-13 9:05 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-01 6:19 [PATCH 0/7] drm/exynos: modify LCD I80 interface display YoungJun Cho
2014-10-01 6:19 ` [PATCH 1/7] drm/exynos: fimd: remove unnecessary waiting vblank routine YoungJun Cho
2014-11-13 9:00 ` Inki Dae
2014-10-01 6:19 ` [PATCH 2/7] drm/exynos: fimd: add fimd_channel_win() to clean up code YoungJun Cho
2014-11-13 9:05 ` Inki Dae [this message]
2014-10-01 6:19 ` [PATCH 3/7] drm/exynos: fimd: modify vclk calculation for I80 i/f YoungJun Cho
2014-11-13 9:12 ` Inki Dae
2014-11-13 9:54 ` YoungJun Cho
2014-11-14 1:25 ` Inki Dae
2014-10-01 6:19 ` [PATCH 4/7] drm/exynos: fimd: move handle vblank position in TE handler YoungJun Cho
2014-11-14 1:20 ` Inki Dae
2014-10-01 6:19 ` [PATCH 5/7] drm/exynos: fimd: modify I80 i/f interrupt relevant routine YoungJun Cho
2014-11-14 1:36 ` Inki Dae
2014-11-16 0:53 ` YoungJun Cho
2014-10-01 6:19 ` [PATCH 6/7] drm/exynos: dsi: move TE irq handler registration position YoungJun Cho
2014-11-14 1:49 ` Inki Dae
2014-11-14 2:08 ` YoungJun Cho
2014-10-01 6:19 ` [PATCH 7/7] drm/exynos: dsi: move DSIM_STATE_ENABLED set position YoungJun Cho
2014-11-14 1:53 ` Inki Dae
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54647471.6030502@samsung.com \
--to=inki.dae@samsung.com \
--cc=a.hajda@samsung.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=kyungmin.park@samsung.com \
--cc=sw0312.kim@samsung.com \
--cc=yj44.cho@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.