1
0
Fork 0

drm: sun4i: Mark one of the UI planes as a cursor one

Signed-off-by: Ondrej Jirman <megous@megous.com>
alistair/sunxi64-5.5-dsi
Ondrej Jirman 2019-09-03 12:26:59 +02:00 committed by Alistair Francis
parent 9eef35ced9
commit bbb4fe4340
3 changed files with 10 additions and 7 deletions

View File

@ -293,8 +293,13 @@ static struct drm_plane **sun8i_layers_init(struct drm_device *drm,
for (i = 0; i < mixer->cfg->ui_num; i++) {
struct sun8i_ui_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");

View File

@ -367,9 +367,9 @@ static const u32 sun8i_ui_layer_formats[] = {
struct sun8i_ui_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_ui_layer *layer;
unsigned int plane_cnt;
@ -379,9 +379,6 @@ struct sun8i_ui_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,

View File

@ -58,5 +58,6 @@ plane_to_sun8i_ui_layer(struct drm_plane *plane)
struct sun8i_ui_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_ */