The sun4i KMS driver will call drm_plane_create_zpos_property() with an
init value depending on the plane type.
Since the initial value wasn't carried over in the state, the driver had
to set it again in sun4i_backend_layer_reset().
However, the helpers have been adjusted to set it properly at reset, so
this is not needed anymore.
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-sunxi@lists.linux.dev
Cc: Chen-Yu Tsai <wens@csie.org>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20220221095918.18763-18-maxime@cerno.tech
static void sun4i_backend_layer_reset(struct drm_plane *plane)
{
static void sun4i_backend_layer_reset(struct drm_plane *plane)
{
- struct sun4i_layer *layer = plane_to_sun4i_layer(plane);
struct sun4i_layer_state *state;
if (plane->state) {
struct sun4i_layer_state *state;
if (plane->state) {
}
state = kzalloc(sizeof(*state), GFP_KERNEL);
}
state = kzalloc(sizeof(*state), GFP_KERNEL);
__drm_atomic_helper_plane_reset(plane, &state->state);
__drm_atomic_helper_plane_reset(plane, &state->state);
- plane->state->zpos = layer->id;
- }
}
static struct drm_plane_state *
}
static struct drm_plane_state *
static struct sun4i_layer *sun4i_layer_init_one(struct drm_device *drm,
struct sun4i_backend *backend,
static struct sun4i_layer *sun4i_layer_init_one(struct drm_device *drm,
struct sun4i_backend *backend,
- enum drm_plane_type type)
+ enum drm_plane_type type,
+ unsigned int id)
{
const uint64_t *modifiers = sun4i_layer_modifiers;
const uint32_t *formats = sun4i_layer_formats;
{
const uint64_t *modifiers = sun4i_layer_modifiers;
const uint32_t *formats = sun4i_layer_formats;
if (!layer)
return ERR_PTR(-ENOMEM);
if (!layer)
return ERR_PTR(-ENOMEM);
layer->backend = backend;
if (IS_ERR_OR_NULL(backend->frontend)) {
layer->backend = backend;
if (IS_ERR_OR_NULL(backend->frontend)) {
&sun4i_backend_layer_helper_funcs);
drm_plane_create_alpha_property(&layer->plane);
&sun4i_backend_layer_helper_funcs);
drm_plane_create_alpha_property(&layer->plane);
- drm_plane_create_zpos_property(&layer->plane, 0, 0,
- SUN4I_BACKEND_NUM_LAYERS - 1);
+ drm_plane_create_zpos_property(&layer->plane, layer->id,
+ 0, SUN4I_BACKEND_NUM_LAYERS - 1);
enum drm_plane_type type = i ? DRM_PLANE_TYPE_OVERLAY : DRM_PLANE_TYPE_PRIMARY;
struct sun4i_layer *layer;
enum drm_plane_type type = i ? DRM_PLANE_TYPE_OVERLAY : DRM_PLANE_TYPE_PRIMARY;
struct sun4i_layer *layer;
- layer = sun4i_layer_init_one(drm, backend, type);
+ layer = sun4i_layer_init_one(drm, backend, type, i);
if (IS_ERR(layer)) {
dev_err(drm->dev, "Couldn't initialize %s plane\n",
i ? "overlay" : "primary");
return ERR_CAST(layer);
}
if (IS_ERR(layer)) {
dev_err(drm->dev, "Couldn't initialize %s plane\n",
i ? "overlay" : "primary");
return ERR_CAST(layer);
}
planes[i] = &layer->plane;
}
planes[i] = &layer->plane;
}