All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/1] drm/vkms: set plane modifiers
@ 2021-12-22  9:32 ` José Expósito
  0 siblings, 0 replies; 4+ messages in thread
From: José Expósito @ 2021-12-22  9:32 UTC (permalink / raw)
  To: contact
  Cc: rodrigosiqueiramelo, melissa.srw, hamohammed.sa, daniel, airlied,
	dri-devel, linux-kernel, cphealy, José Expósito

Hi,

Now that "drm_plane_funcs.format_mod_supported" has been made truly
optional [1], this third version of the patch is basically identical
to the first version as no format/modifier filtering is required.

José Expósito

[1] https://lore.kernel.org/dri-devel/20211222090552.25972-1-jose.exposito89@gmail.com/T/

José Expósito (1):
  drm/vkms: set plane modifiers

 drivers/gpu/drm/vkms/vkms_plane.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

-- 
2.25.1


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

* [PATCH v3 0/1] drm/vkms: set plane modifiers
@ 2021-12-22  9:32 ` José Expósito
  0 siblings, 0 replies; 4+ messages in thread
From: José Expósito @ 2021-12-22  9:32 UTC (permalink / raw)
  To: contact
  Cc: hamohammed.sa, rodrigosiqueiramelo, airlied, linux-kernel,
	dri-devel, melissa.srw, José Expósito, cphealy

Hi,

Now that "drm_plane_funcs.format_mod_supported" has been made truly
optional [1], this third version of the patch is basically identical
to the first version as no format/modifier filtering is required.

José Expósito

[1] https://lore.kernel.org/dri-devel/20211222090552.25972-1-jose.exposito89@gmail.com/T/

José Expósito (1):
  drm/vkms: set plane modifiers

 drivers/gpu/drm/vkms/vkms_plane.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

-- 
2.25.1


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

* [PATCH v3 1/1] drm/vkms: set plane modifiers
  2021-12-22  9:32 ` José Expósito
@ 2021-12-22  9:32   ` José Expósito
  -1 siblings, 0 replies; 4+ messages in thread
From: José Expósito @ 2021-12-22  9:32 UTC (permalink / raw)
  To: contact
  Cc: rodrigosiqueiramelo, melissa.srw, hamohammed.sa, daniel, airlied,
	dri-devel, linux-kernel, cphealy, José Expósito

Where no modifiers are exposed, usually linear modifier is assumed.
However, userspace code is starting to expect IN_FORMATS even when the
only supported modifiers are linear [1].

To avoid possible issues, explicitly set the DRM_FORMAT_MOD_LINEAR
modifier.

[1] https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/599/diffs?commit_id=5aea1bc522f0874e6cc07f5120fbcf1736706536

Suggested-by: Chris Healy <cphealy@gmail.com>
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
---
 drivers/gpu/drm/vkms/vkms_plane.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/vkms/vkms_plane.c b/drivers/gpu/drm/vkms/vkms_plane.c
index 32409e15244b..1666fa59189b 100644
--- a/drivers/gpu/drm/vkms/vkms_plane.c
+++ b/drivers/gpu/drm/vkms/vkms_plane.c
@@ -20,6 +20,11 @@ static const u32 vkms_plane_formats[] = {
 	DRM_FORMAT_XRGB8888
 };
 
+static const u64 vkms_plane_modifiers[] = {
+	DRM_FORMAT_MOD_LINEAR,
+	DRM_FORMAT_MOD_INVALID
+};
+
 static struct drm_plane_state *
 vkms_plane_duplicate_state(struct drm_plane *plane)
 {
@@ -189,7 +194,7 @@ struct vkms_plane *vkms_plane_init(struct vkms_device *vkmsdev,
 	plane = drmm_universal_plane_alloc(dev, struct vkms_plane, base, 1 << index,
 					   &vkms_plane_funcs,
 					   formats, nformats,
-					   NULL, type, NULL);
+					   vkms_plane_modifiers, type, NULL);
 	if (IS_ERR(plane))
 		return plane;
 
-- 
2.25.1


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

* [PATCH v3 1/1] drm/vkms: set plane modifiers
@ 2021-12-22  9:32   ` José Expósito
  0 siblings, 0 replies; 4+ messages in thread
From: José Expósito @ 2021-12-22  9:32 UTC (permalink / raw)
  To: contact
  Cc: hamohammed.sa, rodrigosiqueiramelo, airlied, linux-kernel,
	dri-devel, melissa.srw, José Expósito, cphealy

Where no modifiers are exposed, usually linear modifier is assumed.
However, userspace code is starting to expect IN_FORMATS even when the
only supported modifiers are linear [1].

To avoid possible issues, explicitly set the DRM_FORMAT_MOD_LINEAR
modifier.

[1] https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/599/diffs?commit_id=5aea1bc522f0874e6cc07f5120fbcf1736706536

Suggested-by: Chris Healy <cphealy@gmail.com>
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
---
 drivers/gpu/drm/vkms/vkms_plane.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/vkms/vkms_plane.c b/drivers/gpu/drm/vkms/vkms_plane.c
index 32409e15244b..1666fa59189b 100644
--- a/drivers/gpu/drm/vkms/vkms_plane.c
+++ b/drivers/gpu/drm/vkms/vkms_plane.c
@@ -20,6 +20,11 @@ static const u32 vkms_plane_formats[] = {
 	DRM_FORMAT_XRGB8888
 };
 
+static const u64 vkms_plane_modifiers[] = {
+	DRM_FORMAT_MOD_LINEAR,
+	DRM_FORMAT_MOD_INVALID
+};
+
 static struct drm_plane_state *
 vkms_plane_duplicate_state(struct drm_plane *plane)
 {
@@ -189,7 +194,7 @@ struct vkms_plane *vkms_plane_init(struct vkms_device *vkmsdev,
 	plane = drmm_universal_plane_alloc(dev, struct vkms_plane, base, 1 << index,
 					   &vkms_plane_funcs,
 					   formats, nformats,
-					   NULL, type, NULL);
+					   vkms_plane_modifiers, type, NULL);
 	if (IS_ERR(plane))
 		return plane;
 
-- 
2.25.1


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

end of thread, other threads:[~2021-12-22  9:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-22  9:32 [PATCH v3 0/1] drm/vkms: set plane modifiers José Expósito
2021-12-22  9:32 ` José Expósito
2021-12-22  9:32 ` [PATCH v3 1/1] " José Expósito
2021-12-22  9:32   ` José Expósito

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.