Skip to content

Commit b36a6bb

Browse files
warpmemripard
authored andcommitted
drm/sun4i: de3: Be explicit about supported modifiers
Currently only linear formats are supported in sun4i-drm driver, but SoCs like H6 supports AFBC variant of some of them in multiple cores (GPU, VPU, DE3). Panfrost already implements AFBC compression and is sometimes confused what should be default choice (linear, AFBC) if DRM driver is not explicit about modifier support (MiniMyth2 distro with MythTV app). After some discussion with Daniel Stone on #panfrost IRC, it was decided to make modifiers in sun4i-drm explicit, to avoid any kind of guessing, not just in panfrost, but everywhere. In fact, long term idea is to make modifier parameter in drm_universal_plane_init() mandatory (non NULL). Signed-off-by: Piotr Oniszczuk <[email protected]> Signed-off-by: Jernej Skrabec <[email protected]> Acked-by: Daniel Stone <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 6800234 commit b36a6bb

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

drivers/gpu/drm/sun4i/sun8i_ui_layer.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,11 @@ static const u32 sun8i_ui_layer_formats[] = {
370370
DRM_FORMAT_XRGB8888,
371371
};
372372

373+
static const uint64_t sun8i_layer_modifiers[] = {
374+
DRM_FORMAT_MOD_LINEAR,
375+
DRM_FORMAT_MOD_INVALID
376+
};
377+
373378
struct sun8i_ui_layer *sun8i_ui_layer_init_one(struct drm_device *drm,
374379
struct sun8i_mixer *mixer,
375380
int index)
@@ -392,7 +397,7 @@ struct sun8i_ui_layer *sun8i_ui_layer_init_one(struct drm_device *drm,
392397
&sun8i_ui_layer_funcs,
393398
sun8i_ui_layer_formats,
394399
ARRAY_SIZE(sun8i_ui_layer_formats),
395-
NULL, type, NULL);
400+
sun8i_layer_modifiers, type, NULL);
396401
if (ret) {
397402
dev_err(drm->dev, "Couldn't initialize layer\n");
398403
return ERR_PTR(ret);

drivers/gpu/drm/sun4i/sun8i_vi_layer.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,11 @@ static const u32 sun8i_vi_layer_de3_formats[] = {
534534
DRM_FORMAT_YVU422,
535535
};
536536

537+
static const uint64_t sun8i_layer_modifiers[] = {
538+
DRM_FORMAT_MOD_LINEAR,
539+
DRM_FORMAT_MOD_INVALID
540+
};
541+
537542
struct sun8i_vi_layer *sun8i_vi_layer_init_one(struct drm_device *drm,
538543
struct sun8i_mixer *mixer,
539544
int index)
@@ -560,7 +565,8 @@ struct sun8i_vi_layer *sun8i_vi_layer_init_one(struct drm_device *drm,
560565
ret = drm_universal_plane_init(drm, &layer->plane, 0,
561566
&sun8i_vi_layer_funcs,
562567
formats, format_count,
563-
NULL, DRM_PLANE_TYPE_OVERLAY, NULL);
568+
sun8i_layer_modifiers,
569+
DRM_PLANE_TYPE_OVERLAY, NULL);
564570
if (ret) {
565571
dev_err(drm->dev, "Couldn't initialize layer\n");
566572
return ERR_PTR(ret);

0 commit comments

Comments
 (0)