mirror of
https://github.com/torvalds/linux.git
synced 2026-05-26 16:12:59 +02:00
drm/sun4i: de2: Initialize layer fields earlier
drm_universal_plane_init() can already call some callbacks, like format_mod_supported, during initialization. Because of that, fields should be initialized beforehand. Reviewed-by: Chen-Yu Tsai <wens@csie.org> Tested-by: Ryan Walklin <ryan@testtoast.com> Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com> Link: https://patch.msgid.link/20251104180942.61538-4-jernej.skrabec@gmail.com Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
This commit is contained in:
parent
f863fff123
commit
558716d558
|
|
@ -304,6 +304,11 @@ struct sun8i_layer *sun8i_ui_layer_init_one(struct drm_device *drm,
|
|||
if (!layer)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
layer->mixer = mixer;
|
||||
layer->type = SUN8I_LAYER_TYPE_UI;
|
||||
layer->channel = channel;
|
||||
layer->overlay = 0;
|
||||
|
||||
if (index == 0)
|
||||
type = DRM_PLANE_TYPE_PRIMARY;
|
||||
|
||||
|
|
@ -334,10 +339,6 @@ struct sun8i_layer *sun8i_ui_layer_init_one(struct drm_device *drm,
|
|||
}
|
||||
|
||||
drm_plane_helper_add(&layer->plane, &sun8i_ui_layer_helper_funcs);
|
||||
layer->mixer = mixer;
|
||||
layer->type = SUN8I_LAYER_TYPE_UI;
|
||||
layer->channel = channel;
|
||||
layer->overlay = 0;
|
||||
|
||||
return layer;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -485,6 +485,11 @@ struct sun8i_layer *sun8i_vi_layer_init_one(struct drm_device *drm,
|
|||
if (!layer)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
layer->mixer = mixer;
|
||||
layer->type = SUN8I_LAYER_TYPE_VI;
|
||||
layer->channel = index;
|
||||
layer->overlay = 0;
|
||||
|
||||
if (mixer->cfg->de_type >= SUN8I_MIXER_DE3) {
|
||||
formats = sun8i_vi_layer_de3_formats;
|
||||
format_count = ARRAY_SIZE(sun8i_vi_layer_de3_formats);
|
||||
|
|
@ -543,10 +548,6 @@ struct sun8i_layer *sun8i_vi_layer_init_one(struct drm_device *drm,
|
|||
}
|
||||
|
||||
drm_plane_helper_add(&layer->plane, &sun8i_vi_layer_helper_funcs);
|
||||
layer->mixer = mixer;
|
||||
layer->type = SUN8I_LAYER_TYPE_VI;
|
||||
layer->channel = index;
|
||||
layer->overlay = 0;
|
||||
|
||||
return layer;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user