build/patch/kernel/archive/sunxi-6.2/patches.megous/drm-sun4i-Mark-one-of-the-UI-planes-as-a-cursor-one.patch

74 lines
2.6 KiB
Diff

From 455babaccc24245ff5fbf45f7f758ebf7ef068b4 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Mon, 31 Oct 2022 03:23:11 +0100
Subject: [PATCH 194/391] drm/sun4i: Mark one of the UI planes as a cursor one
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
drivers/gpu/drm/sun4i/sun8i_mixer.c | 7 ++++++-
drivers/gpu/drm/sun4i/sun8i_ui_layer.c | 7 ++-----
drivers/gpu/drm/sun4i/sun8i_ui_layer.h | 4 +++-
3 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c b/drivers/gpu/drm/sun4i/sun8i_mixer.c
index c404d0a5f..e5d9a023d 100644
--- a/drivers/gpu/drm/sun4i/sun8i_mixer.c
+++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c
@@ -357,8 +357,13 @@ static struct drm_plane **sun8i_layers_init(struct drm_device *drm,
for (i = 0; i < mixer->cfg->ui_num; i++) {
struct sun8i_layer *layer;
+ enum drm_plane_type type = DRM_PLANE_TYPE_OVERLAY;
+ if (i == 0)
+ type = DRM_PLANE_TYPE_PRIMARY;
+ else if (i == (mixer->cfg->ui_num - 1))
+ type = DRM_PLANE_TYPE_CURSOR;
- layer = sun8i_ui_layer_init_one(drm, mixer, i);
+ layer = sun8i_ui_layer_init_one(drm, mixer, i, type);
if (IS_ERR(layer)) {
dev_err(drm->dev, "Couldn't initialize %s plane\n",
i ? "overlay" : "primary");
diff --git a/drivers/gpu/drm/sun4i/sun8i_ui_layer.c b/drivers/gpu/drm/sun4i/sun8i_ui_layer.c
index b90e5edef..0349e8bdf 100644
--- a/drivers/gpu/drm/sun4i/sun8i_ui_layer.c
+++ b/drivers/gpu/drm/sun4i/sun8i_ui_layer.c
@@ -277,9 +277,9 @@ static const uint64_t sun8i_layer_modifiers[] = {
struct sun8i_layer *sun8i_ui_layer_init_one(struct drm_device *drm,
struct sun8i_mixer *mixer,
- int index)
+ int index,
+ enum drm_plane_type type)
{
- enum drm_plane_type type = DRM_PLANE_TYPE_OVERLAY;
int channel = mixer->cfg->vi_num + index;
struct sun8i_layer *layer;
unsigned int plane_cnt;
@@ -289,9 +289,6 @@ struct sun8i_layer *sun8i_ui_layer_init_one(struct drm_device *drm,
if (!layer)
return ERR_PTR(-ENOMEM);
- if (index == 0)
- type = DRM_PLANE_TYPE_PRIMARY;
-
/* possible crtcs are set later */
ret = drm_universal_plane_init(drm, &layer->plane, 0,
&sun8i_ui_layer_funcs,
diff --git a/drivers/gpu/drm/sun4i/sun8i_ui_layer.h b/drivers/gpu/drm/sun4i/sun8i_ui_layer.h
index 83892f6ff..d4530e9f6 100644
--- a/drivers/gpu/drm/sun4i/sun8i_ui_layer.h
+++ b/drivers/gpu/drm/sun4i/sun8i_ui_layer.h
@@ -51,5 +51,7 @@ struct sun8i_layer;
struct sun8i_layer *sun8i_ui_layer_init_one(struct drm_device *drm,
struct sun8i_mixer *mixer,
- int index);
+ int index,
+ enum drm_plane_type type);
+
#endif /* _SUN8I_UI_LAYER_H_ */
--
2.35.3