All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrzej Hajda <a.hajda@samsung.com>
To: Inki Dae <inki.dae@samsung.com>
Cc: linux-samsung-soc@vger.kernel.org,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	dri-devel@lists.freedesktop.org,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Subject: [PATCH 3/3] drm/exynos/fimd: add dynamic zpos support
Date: Thu, 06 Dec 2018 10:38:57 +0100	[thread overview]
Message-ID: <20181206093857.22324-4-a.hajda@samsung.com> (raw)
In-Reply-To: <20181206093857.22324-1-a.hajda@samsung.com>

FIMD has fixed hardware window order. To implement dynamic zpos
normalized_zpos of active plane has to be connected to window number, and
remaining windows have to be disabled.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c | 21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 226127f35052..c4e2129e0e3f 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -706,6 +706,12 @@ static void fimd_atomic_flush(struct exynos_drm_crtc *crtc)
 	if (ctx->suspended)
 		return;
 
+	for (i = hweight32(crtc->base.state->plane_mask); i < WINDOWS_NR; i++) {
+		if (!(readl(ctx->regs + WINCON(i)) & WINCONx_ENWIN))
+			break;
+		fimd_disable_win(ctx, i);
+	}
+
 	for (i = 0; i < WINDOWS_NR; i++)
 		fimd_shadow_protect_win(ctx, i, false);
 
@@ -722,7 +728,7 @@ static void fimd_update_plane(struct exynos_drm_crtc *crtc,
 	dma_addr_t dma_addr;
 	unsigned long val, size, offset;
 	unsigned int last_x, last_y, buf_offsize, line_size;
-	unsigned int win = plane->index;
+	unsigned int win = state->base.normalized_zpos;
 	unsigned int cpp = fb->format->cpp[0];
 	unsigned int pitch = fb->pitches[0];
 
@@ -804,17 +810,6 @@ static void fimd_update_plane(struct exynos_drm_crtc *crtc,
 		atomic_set(&ctx->win_updated, 1);
 }
 
-static void fimd_disable_plane(struct exynos_drm_crtc *crtc,
-			       struct exynos_drm_plane *plane)
-{
-	struct fimd_context *ctx = crtc->ctx;
-
-	if (ctx->suspended)
-		return;
-
-	fimd_disable_win(ctx, plane->index);
-}
-
 static void fimd_enable(struct exynos_drm_crtc *crtc)
 {
 	struct fimd_context *ctx = crtc->ctx;
@@ -933,7 +928,6 @@ static const struct exynos_drm_crtc_ops fimd_crtc_ops = {
 	.disable_vblank = fimd_disable_vblank,
 	.atomic_begin = fimd_atomic_begin,
 	.update_plane = fimd_update_plane,
-	.disable_plane = fimd_disable_plane,
 	.atomic_flush = fimd_atomic_flush,
 	.atomic_check = fimd_atomic_check,
 	.te_handler = fimd_te_handler,
@@ -987,6 +981,7 @@ static int fimd_bind(struct device *dev, struct device *master, void *data)
 		ctx->configs[i].num_pixel_formats = ARRAY_SIZE(fimd_formats);
 		ctx->configs[i].zpos = i;
 		ctx->configs[i].type = fimd_win_types[i];
+		ctx->configs[i].capabilities = EXYNOS_DRM_PLANE_CAP_ZPOS;
 		ret = exynos_plane_init(drm_dev, &ctx->planes[i], i,
 					&ctx->configs[i]);
 		if (ret)
-- 
2.17.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2018-12-06  9:38 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20181206093905eucas1p133ead84adfb9dd7a9756ce91b6b35895@eucas1p1.samsung.com>
2018-12-06  9:38 ` [PATCH 0/3] drm/exynos: add support for dynamic zpos in DECON and FIMD Andrzej Hajda
     [not found]   ` <CGME20181206093906eucas1p212ab2e090927466e001dcec001a441c5@eucas1p2.samsung.com>
2018-12-06  9:38     ` [PATCH 1/3] drm/exynos/decon5433: add dynamic zpos support Andrzej Hajda
     [not found]   ` <CGME20181206093906eucas1p201bdbdc03cabc2a3f60ea04b794ffd04@eucas1p2.samsung.com>
2018-12-06  9:38     ` [PATCH 2/3] drm/exynos/fimd: create local helper for disabling hardware window Andrzej Hajda
     [not found]   ` <CGME20181206093906eucas1p1ab20b4dabdb0a5e32c1e639cf38b0357@eucas1p1.samsung.com>
2018-12-06  9:38     ` Andrzej Hajda [this message]
2018-12-06 11:06   ` [PATCH 0/3] drm/exynos: add support for dynamic zpos in DECON and FIMD Andrzej Hajda
2018-12-07  1:18     ` Inki Dae
2018-12-10  2:25   ` Inki Dae
2018-12-10  7:35     ` Andrzej Hajda
2018-12-10 23:45       ` Inki Dae
2018-12-11  7:49         ` Andrzej Hajda
2018-12-11  8:01           ` Inki Dae
2018-12-11  8:36             ` Andrzej Hajda
2018-12-11 13:20               ` Andrzej Hajda
2018-12-11 23:48                 ` Inki Dae
2018-12-12  8:30                   ` Andrzej Hajda
2018-12-13  0:04                     ` Inki Dae
2018-12-11 23:26               ` Inki Dae
2018-12-12  8:43                 ` Andrzej Hajda
2018-12-13  0:50                   ` 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=20181206093857.22324-4-a.hajda@samsung.com \
    --to=a.hajda@samsung.com \
    --cc=b.zolnierkie@samsung.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=inki.dae@samsung.com \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=m.szyprowski@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.