linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 4.19 01/20] drm/mediatek: Find the cursor plane instead of hard coding it
@ 2020-03-16  2:34 Sasha Levin
  2020-03-16  2:34 ` [PATCH AUTOSEL 4.19 02/20] ARM: dts: imx6dl-colibri-eval-v3: fix sram compatible properties Sasha Levin
                   ` (18 more replies)
  0 siblings, 19 replies; 20+ messages in thread
From: Sasha Levin @ 2020-03-16  2:34 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Evan Benn, Sean Paul, CK Hu, Sasha Levin, dri-devel,
	linux-arm-kernel, linux-mediatek

From: Evan Benn <evanbenn@chromium.org>

[ Upstream commit 318caac7c81cdf5806df30c3d72385659a5f0f53 ]

The cursor and primary planes were hard coded.
Now search for them for passing to drm_crtc_init_with_planes

Signed-off-by: Evan Benn <evanbenn@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: CK Hu <ck.hu@mediatek.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
index b86ee7d25af36..eac9caf322f90 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
@@ -506,10 +506,18 @@ static const struct drm_crtc_helper_funcs mtk_crtc_helper_funcs = {
 
 static int mtk_drm_crtc_init(struct drm_device *drm,
 			     struct mtk_drm_crtc *mtk_crtc,
-			     struct drm_plane *primary,
-			     struct drm_plane *cursor, unsigned int pipe)
+			     unsigned int pipe)
 {
-	int ret;
+	struct drm_plane *primary = NULL;
+	struct drm_plane *cursor = NULL;
+	int i, ret;
+
+	for (i = 0; i < mtk_crtc->layer_nr; i++) {
+		if (mtk_crtc->planes[i].type == DRM_PLANE_TYPE_PRIMARY)
+			primary = &mtk_crtc->planes[i];
+		else if (mtk_crtc->planes[i].type == DRM_PLANE_TYPE_CURSOR)
+			cursor = &mtk_crtc->planes[i];
+	}
 
 	ret = drm_crtc_init_with_planes(drm, &mtk_crtc->base, primary, cursor,
 					&mtk_crtc_funcs, NULL);
@@ -622,9 +630,7 @@ int mtk_drm_crtc_create(struct drm_device *drm_dev,
 			goto unprepare;
 	}
 
-	ret = mtk_drm_crtc_init(drm_dev, mtk_crtc, &mtk_crtc->planes[0],
-				mtk_crtc->layer_nr > 1 ? &mtk_crtc->planes[1] :
-				NULL, pipe);
+	ret = mtk_drm_crtc_init(drm_dev, mtk_crtc, pipe);
 	if (ret < 0)
 		goto unprepare;
 	drm_mode_crtc_set_gamma_size(&mtk_crtc->base, MTK_LUT_SIZE);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2020-03-16  2:38 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-16  2:34 [PATCH AUTOSEL 4.19 01/20] drm/mediatek: Find the cursor plane instead of hard coding it Sasha Levin
2020-03-16  2:34 ` [PATCH AUTOSEL 4.19 02/20] ARM: dts: imx6dl-colibri-eval-v3: fix sram compatible properties Sasha Levin
2020-03-16  2:34 ` [PATCH AUTOSEL 4.19 03/20] spi: qup: call spi_qup_pm_resume_runtime before suspending Sasha Levin
2020-03-16  2:34 ` [PATCH AUTOSEL 4.19 04/20] powerpc: Include .BTF section Sasha Levin
2020-03-16  2:34 ` [PATCH AUTOSEL 4.19 05/20] ARM: dts: dra7: Add "dma-ranges" property to PCIe RC DT nodes Sasha Levin
2020-03-16  2:34 ` [PATCH AUTOSEL 4.19 06/20] spi: pxa2xx: Add CS control clock quirk Sasha Levin
2020-03-16  2:34 ` [PATCH AUTOSEL 4.19 07/20] spi/zynqmp: remove entry that causes a cs glitch Sasha Levin
2020-03-16  2:34 ` [PATCH AUTOSEL 4.19 08/20] drm/exynos: dsi: propagate error value and silence meaningless warning Sasha Levin
2020-03-16  2:34 ` [PATCH AUTOSEL 4.19 09/20] drm/exynos: dsi: fix workaround for the legacy clock name Sasha Levin
2020-03-16  2:34 ` [PATCH AUTOSEL 4.19 10/20] drivers/perf: arm_pmu_acpi: Fix incorrect checking of gicc pointer Sasha Levin
2020-03-16  2:34 ` [PATCH AUTOSEL 4.19 11/20] altera-stapl: altera_get_note: prevent write beyond end of 'key' Sasha Levin
2020-03-16  2:34 ` [PATCH AUTOSEL 4.19 12/20] dm bio record: save/restore bi_end_io and bi_integrity Sasha Levin
2020-03-16  2:34 ` [PATCH AUTOSEL 4.19 13/20] dm integrity: use dm_bio_record and dm_bio_restore Sasha Levin
2020-03-16  2:34 ` [PATCH AUTOSEL 4.19 14/20] riscv: avoid the PIC offset of static percpu data in module beyond 2G limits Sasha Levin
2020-03-16  2:34 ` [PATCH AUTOSEL 4.19 15/20] drm/amd/display: Clear link settings on MST disable connector Sasha Levin
2020-03-16  2:34 ` [PATCH AUTOSEL 4.19 16/20] drm/amd/display: fix dcc swath size calculations on dcn1 Sasha Levin
2020-03-16  2:34 ` [PATCH AUTOSEL 4.19 17/20] xenbus: req->body should be updated before req->state Sasha Levin
2020-03-16  2:34 ` [PATCH AUTOSEL 4.19 18/20] xenbus: req->err " Sasha Levin
2020-03-16  2:34 ` [PATCH AUTOSEL 4.19 19/20] block, bfq: fix overwrite of bfq_group pointer in bfq_find_set_group() Sasha Levin
2020-03-16  2:34 ` [PATCH AUTOSEL 4.19 20/20] parse-maintainers: Mark as executable Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).