drm/sun4i: de3: Be explicit about supported modifiers
Subsystems (5)
Jernej Skrabec
maintainerPATCH 1/1 drm/sun4i: de3: Be explicit about supported modifiers
From: Piotr Oniszczuk <[email protected]>
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).
--- drivers/gpu/drm/sun4i/sun8i_ui_layer.c | 7 ++++++- drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 8 +++++++- 2 files changed, 13 insertions(+), 2 deletions(-)
drivers/gpu/drm/sun4i/sun8i_ui_layer.c +6 -1
@@ -370,6 +370,11 @@ static const u32 sun8i_ui_layer_formats[] = { DRM_FORMAT_XRGB8888, }; +static const uint64_t sun8i_layer_modifiers[] = { +DRM_FORMAT_MOD_LINEAR , +DRM_FORMAT_MOD_INVALID +}; +struct sun8i_ui_layer *sun8i_ui_layer_init_one (struct drm_device *drm,struct sun8i_mixer *mixer,int index)
@@ -392,7 +397,7 @@ struct sun8i_ui_layer *sun8i_ui_layer_init_one(struct drm_device *drm, &sun8i_ui_layer_funcs, sun8i_ui_layer_formats,ARRAY_SIZE (sun8i_ui_layer_formats), - NULL, type, NULL); + sun8i_layer_modifiers, type, NULL);if (ret) {dev_err (drm->dev,"Couldn't initialize layer\n" );return ERR_PTR (ret);
drivers/gpu/drm/sun4i/sun8i_vi_layer.c +7 -1
@@ -534,6 +534,11 @@ static const u32 sun8i_vi_layer_de3_formats[] = { DRM_FORMAT_YVU422, }; +static const uint64_t sun8i_layer_modifiers[] = { +DRM_FORMAT_MOD_LINEAR , +DRM_FORMAT_MOD_INVALID +}; +struct sun8i_vi_layer *sun8i_vi_layer_init_one (struct drm_device *drm,struct sun8i_mixer *mixer,int index)
@@ -560,7 +565,8 @@ struct sun8i_vi_layer *sun8i_vi_layer_init_one(struct drm_device *drm, ret =drm_universal_plane_init (drm, &layer->plane,0 , &sun8i_vi_layer_funcs, formats, format_count, -NULL ,DRM_PLANE_TYPE_OVERLAY ,NULL ); + sun8i_layer_modifiers, +DRM_PLANE_TYPE_OVERLAY ,NULL );if (ret) {dev_err (drm->dev,"Couldn't initialize layer\n" );return ERR_PTR (ret);
Signature · 1 line
2.31.1
Quoted 11 lines · Jernej Skrabec
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).
Thanks Piotr & Jernej!
Cheers,
Daniel
Maxime Ripard
AppliedQuoted 9 lines · Jernej Skrabec
From: Piotr Oniszczuk <[email protected]>
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).
Quoted 7 lines
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]>
Applied, thanks
Maxime