linux-sunxi.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/sun4i: de3: Be explicit about supported modifiers
@ 2021-06-05  7:35 Jernej Skrabec
  2021-06-07  8:36 ` Daniel Stone
  2021-06-07  8:43 ` Maxime Ripard
  0 siblings, 2 replies; 3+ messages in thread
From: Jernej Skrabec @ 2021-06-05  7:35 UTC (permalink / raw)
  To: mripard, wens
  Cc: airlied, daniel, daniel.stone, dri-devel, linux-arm-kernel,
	linux-sunxi, linux-kernel, Piotr Oniszczuk, Jernej Skrabec

From: Piotr Oniszczuk <piotr.oniszczuk@gmail.com>

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 <piotr.oniszczuk@gmail.com>
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
---
 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(-)

diff --git a/drivers/gpu/drm/sun4i/sun8i_ui_layer.c b/drivers/gpu/drm/sun4i/sun8i_ui_layer.c
index 0db164a774a1..e779855bcd6e 100644
--- a/drivers/gpu/drm/sun4i/sun8i_ui_layer.c
+++ b/drivers/gpu/drm/sun4i/sun8i_ui_layer.c
@@ -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);
diff --git a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c
index 46420780db59..1c86c2dd0bbf 100644
--- a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c
+++ b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c
@@ -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);
-- 
2.31.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/sun4i: de3: Be explicit about supported modifiers
  2021-06-05  7:35 [PATCH] drm/sun4i: de3: Be explicit about supported modifiers Jernej Skrabec
@ 2021-06-07  8:36 ` Daniel Stone
  2021-06-07  8:43 ` Maxime Ripard
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Stone @ 2021-06-07  8:36 UTC (permalink / raw)
  To: Jernej Skrabec
  Cc: Maxime Ripard, Chen-Yu Tsai, Piotr Oniszczuk, Daniel Stone,
	David Airlie, Linux Kernel Mailing List, dri-devel, linux-sunxi,
	linux-arm-kernel

On Sat, 5 Jun 2021 at 08:36, Jernej Skrabec <jernej.skrabec@gmail.com> wrote:
> 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!

Acked-by: Daniel Stone <daniels@collabora.com>

Cheers,
Daniel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/sun4i: de3: Be explicit about supported modifiers
  2021-06-05  7:35 [PATCH] drm/sun4i: de3: Be explicit about supported modifiers Jernej Skrabec
  2021-06-07  8:36 ` Daniel Stone
@ 2021-06-07  8:43 ` Maxime Ripard
  1 sibling, 0 replies; 3+ messages in thread
From: Maxime Ripard @ 2021-06-07  8:43 UTC (permalink / raw)
  To: Jernej Skrabec
  Cc: wens, airlied, daniel, daniel.stone, dri-devel, linux-arm-kernel,
	linux-sunxi, linux-kernel, Piotr Oniszczuk

[-- Attachment #1: Type: text/plain, Size: 958 bytes --]

On Sat, Jun 05, 2021 at 09:35:34AM +0200, Jernej Skrabec wrote:
> From: Piotr Oniszczuk <piotr.oniszczuk@gmail.com>
> 
> 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 <piotr.oniszczuk@gmail.com>
> Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>

Applied, thanks
Maxime

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-07  8:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-05  7:35 [PATCH] drm/sun4i: de3: Be explicit about supported modifiers Jernej Skrabec
2021-06-07  8:36 ` Daniel Stone
2021-06-07  8:43 ` Maxime Ripard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).