mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
drm/sun4i: ui_layer: Change index meaning
In the pursuit of making UI/VI layer code independent of DE version, change meaning of UI index to index of the plane within mixer. DE33 can split amount of VI and UI planes between multiple mixer in whatever way it deems acceptable, so simple calculation VI num + UI index won't be meaningful anymore. Reviewed-by: Chen-Yu Tsai <wens@kernel.org> Tested-by: Ryan Walklin <ryan@testtoast.com> Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com> Link: https://patch.msgid.link/20251104180942.61538-15-jernej.skrabec@gmail.com Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
This commit is contained in:
committed by
Chen-Yu Tsai
parent
feea4205ef
commit
32ca21b97f
@@ -344,6 +344,7 @@ static struct drm_plane **sun8i_layers_init(struct drm_device *drm,
|
||||
}
|
||||
|
||||
for (i = 0; i < mixer->cfg->ui_num; i++) {
|
||||
unsigned int index = mixer->cfg->vi_num + i;
|
||||
struct sun8i_layer *layer;
|
||||
|
||||
if (i == 0)
|
||||
@@ -351,14 +352,14 @@ static struct drm_plane **sun8i_layers_init(struct drm_device *drm,
|
||||
else
|
||||
type = DRM_PLANE_TYPE_OVERLAY;
|
||||
|
||||
layer = sun8i_ui_layer_init_one(drm, mixer, type, i);
|
||||
layer = sun8i_ui_layer_init_one(drm, mixer, type, index);
|
||||
if (IS_ERR(layer)) {
|
||||
dev_err(drm->dev, "Couldn't initialize %s plane\n",
|
||||
i ? "overlay" : "primary");
|
||||
return ERR_CAST(layer);
|
||||
}
|
||||
|
||||
planes[mixer->cfg->vi_num + i] = &layer->plane;
|
||||
planes[index] = &layer->plane;
|
||||
}
|
||||
|
||||
return planes;
|
||||
|
||||
@@ -270,7 +270,6 @@ struct sun8i_layer *sun8i_ui_layer_init_one(struct drm_device *drm,
|
||||
enum drm_plane_type type,
|
||||
int index)
|
||||
{
|
||||
int channel = mixer->cfg->vi_num + index;
|
||||
struct sun8i_layer *layer;
|
||||
unsigned int plane_cnt;
|
||||
int ret;
|
||||
@@ -281,7 +280,7 @@ struct sun8i_layer *sun8i_ui_layer_init_one(struct drm_device *drm,
|
||||
|
||||
layer->mixer = mixer;
|
||||
layer->type = SUN8I_LAYER_TYPE_UI;
|
||||
layer->channel = channel;
|
||||
layer->channel = index;
|
||||
layer->overlay = 0;
|
||||
|
||||
/* possible crtcs are set later */
|
||||
@@ -303,7 +302,7 @@ struct sun8i_layer *sun8i_ui_layer_init_one(struct drm_device *drm,
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
|
||||
ret = drm_plane_create_zpos_property(&layer->plane, channel,
|
||||
ret = drm_plane_create_zpos_property(&layer->plane, index,
|
||||
0, plane_cnt - 1);
|
||||
if (ret) {
|
||||
dev_err(drm->dev, "Couldn't add zpos property\n");
|
||||
|
||||
Reference in New Issue
Block a user