From: Inki Dae <inki.dae@samsung.com>
To: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: iommu@lists.linux-foundation.org,
linux-samsung-soc@vger.kernel.org,
Joonyoung Shim <jy0922.shim@samsung.com>,
Seung-Woo Kim <sw0312.kim@samsung.com>,
Javier Martinez Canillas <javier@dowhile0.org>,
Krzysztof Kozlowski <k.kozlowski@samsung.com>
Subject: Re: [PATCH 1/3] drm/exynos: fimd: ensure proper hw state in fimd_clear_channel()
Date: Wed, 03 Jun 2015 11:18:56 +0900 [thread overview]
Message-ID: <556E6410.3040600@samsung.com> (raw)
In-Reply-To: <1433157316-6341-2-git-send-email-m.szyprowski@samsung.com>
Hi Marek,
I have merged atomic patch series. Can you re-base your patch series on
top of exynos-drm-next?
Thanks,
Inki Dae
On 2015년 06월 01일 20:15, Marek Szyprowski wrote:
> One should not do any assumptions on the stare of the fimd hardware
> during driver initialization, so to properly reset fimd before enabling
> IOMMU, one should ensure that all power domains and clocks are really
> enabled. This patch adds calls to power on/off in the
> fimd_clear_channel() function to ensure that any access to fimd
> registers will be performed with clocks and power domains enabled.
>
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Tested-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
> ---
> drivers/gpu/drm/exynos/exynos_drm_fimd.c | 26 +++++++++++++++++---------
> 1 file changed, 17 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> index a0edab833148..d10ad3920e78 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> @@ -242,12 +242,21 @@ static void fimd_enable_shadow_channel_path(struct fimd_context *ctx,
> writel(val, ctx->regs + SHADOWCON);
> }
>
> -static void fimd_clear_channel(struct fimd_context *ctx)
> +static int fimd_poweron(struct fimd_context *ctx);
> +static int fimd_poweroff(struct fimd_context *ctx);
> +
> +static int fimd_clear_channel(struct fimd_context *ctx)
> {
> unsigned int win, ch_enabled = 0;
> + int ret;
>
> DRM_DEBUG_KMS("%s\n", __FILE__);
>
> + /* Hardware is in unknown state, so ensure it get enabled properly */
> + ret = fimd_poweron(ctx);
> + if (ret)
> + return ret;
> +
> /* Check if any channel is enabled. */
> for (win = 0; win < WINDOWS_NR; win++) {
> u32 val = readl(ctx->regs + WINCON(win));
> @@ -258,19 +267,15 @@ static void fimd_clear_channel(struct fimd_context *ctx)
> if (ctx->driver_data->has_shadowcon)
> fimd_enable_shadow_channel_path(ctx, win,
> false);
> -
> ch_enabled = 1;
> }
> }
>
> /* Wait for vsync, as disable channel takes effect at next vsync */
> - if (ch_enabled) {
> - unsigned int state = ctx->suspended;
> -
> - ctx->suspended = 0;
> + if (ch_enabled)
> fimd_wait_for_vblank(ctx->crtc);
> - ctx->suspended = state;
> - }
> +
> + return fimd_poweroff(ctx);
> }
>
> static int fimd_iommu_attach_devices(struct fimd_context *ctx,
> @@ -285,7 +290,10 @@ static int fimd_iommu_attach_devices(struct fimd_context *ctx,
> * If any channel is already active, iommu will throw
> * a PAGE FAULT when enabled. So clear any channel if enabled.
> */
> - fimd_clear_channel(ctx);
> + ret = fimd_clear_channel(ctx);
> + if (ret)
> + return ret;
> +
> ret = drm_iommu_attach_device(ctx->drm_dev, ctx->dev);
> if (ret) {
> DRM_ERROR("drm_iommu_attach failed.\n");
>
next prev parent reply other threads:[~2015-06-03 2:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-01 11:15 [PATCH 0/3] Exynos SYSMMU (IOMMU) updates for Exynos DRM Marek Szyprowski
2015-06-01 11:15 ` [PATCH 1/3] drm/exynos: fimd: ensure proper hw state in fimd_clear_channel() Marek Szyprowski
2015-06-03 2:18 ` Inki Dae [this message]
[not found] ` <1433157316-6341-1-git-send-email-m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2015-06-01 11:15 ` [PATCH 2/3] drm/exynos: iommu: detach from default dma-mapping domain on init Marek Szyprowski
2015-06-01 11:15 ` [PATCH 3/3] drm/exynos: iommu: improve a check for non-iommu dma_ops Marek Szyprowski
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=556E6410.3040600@samsung.com \
--to=inki.dae@samsung.com \
--cc=iommu@lists.linux-foundation.org \
--cc=javier@dowhile0.org \
--cc=jy0922.shim@samsung.com \
--cc=k.kozlowski@samsung.com \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=sw0312.kim@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox