Skip to contentSkip to conversation

drm: mxsfb: Implement .format_mod_supported

PATCH RESEND Applied Daniel Abrecht 3 participants 3 messages Nov 8, 2020 – Nov 26, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND v2 1/1 drm: mxsfb: Implement .format_mod_supported

This will make sure applications which use the IN_FORMATS blob to figure out which modifiers they can use will pick up the linear modifier which is needed by mxsfb. Such applications will not work otherwise if an incompatible implicit modifier ends up being selected.

Before commit ae1ed0093281 ("drm: mxsfb: Stop using DRM simple display pipeline helper"), the DRM simple display pipeline helper took care of this.

Fixes ae1ed0093281 ("drm: mxsfb: Stop using DRM simple display pipeline helper")
---
 drivers/gpu/drm/mxsfb/mxsfb_kms.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/mxsfb/mxsfb_kms.c +7 -0
index 956f631997f2..fc4b1626261b 100644
@@ -484,6 +484,13 @@ static void mxsfb_plane_overlay_atomic_update(struct drm_plane *plane,
 	writel(ctrl, mxsfb->base + LCDC_AS_CTRL);
 }
 
+static bool mxsfb_format_mod_supported(struct drm_plane *plane,
+				       uint32_t format,
+				       uint64_t modifier)
+{
+	return modifier == DRM_FORMAT_MOD_LINEAR;
+}
+
 static const struct drm_plane_helper_funcs 

mxsfb_plane_primary_helper_funcs = {
.atomic_check = mxsfb_plane_atomic_check,
.atomic_update = mxsfb_plane_primary_atomic_update,
@@ -495,6 +502,7 @@ static const struct drm_plane_helper_funcs mxsfb_plane_overlay_helper_funcs = {
};

static const struct drm_plane_funcs mxsfb_plane_funcs = {
+ .format_mod_supported = mxsfb_format_mod_supported,
.update_plane = drm_atomic_helper_update_plane,
.disable_plane = drm_atomic_helper_disable_plane,
.destroy = drm_plane_cleanup,

Signature · 5 lines
2.20.1
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw
Quoted 6 lines · Daniel Abrecht

This will make sure applications which use the IN_FORMATS blob to figure out which modifiers they can use will pick up the linear modifier which is needed by mxsfb. Such applications will not work otherwise if an incompatible implicit modifier ends up being selected.

Quoted 7 lines

Before commit ae1ed0093281 ("drm: mxsfb: Stop using DRM simple display pipeline helper"), the DRM simple display pipeline helper took care of this.

Fixes ae1ed0093281 ("drm: mxsfb: Stop using DRM simple display pipeline

helper")

Makes sense and I picked it up since it seems to be a bit lost. Applied tod drm-misc-next, thanks for your patch.
-Daniel

Quoted 40 lines
---
 drivers/gpu/drm/mxsfb/mxsfb_kms.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/mxsfb/mxsfb_kms.c +7 -0
index 956f631997f2..fc4b1626261b 100644
@@ -484,6 +484,13 @@ static void mxsfb_plane_overlay_atomic_update(struct
 drm_plane *plane,
 	writel(ctrl, mxsfb->base + LCDC_AS_CTRL);
 }
 
+static bool mxsfb_format_mod_supported(struct drm_plane *plane,
+				       uint32_t format,
+				       uint64_t modifier)
+{
+	return modifier == DRM_FORMAT_MOD_LINEAR;
+}
+
 static const struct drm_plane_helper_funcs mxsfb_plane_primary_helper_funcs
 = {
drivers/gpu/drm/mxsfb/mxsfb_kms.c +1 -0
 	.atomic_check = mxsfb_plane_atomic_check,
 	.atomic_update = mxsfb_plane_primary_atomic_update,
@@ -495,6 +502,7 @@ static const struct drm_plane_helper_funcs
 mxsfb_plane_overlay_helper_funcs = {
 };
 
 static const struct drm_plane_funcs mxsfb_plane_funcs = {
+	.format_mod_supported	= mxsfb_format_mod_supported,
 	.update_plane		= drm_atomic_helper_update_plane,
 	.disable_plane		= drm_atomic_helper_disable_plane,

.destroy = drm_plane_cleanup,

Signature · 5 lines
2.20.1
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Reviewed-by on v2 1/1 Applied
#2 lore raw
In reply to Daniel Abrecht
Quoted 6 lines · Daniel Abrecht

This will make sure applications which use the IN_FORMATS blob to figure out which modifiers they can use will pick up the linear modifier which is needed by mxsfb. Such applications will not work otherwise if an incompatible implicit modifier ends up being selected.

Quoted 7 lines

Before commit ae1ed0093281 ("drm: mxsfb: Stop using DRM simple display pipeline helper"), the DRM simple display pipeline helper took care of this.

Fixes ae1ed0093281 ("drm: mxsfb: Stop using DRM simple display

pipeline helper")

I allowed myself to update the author email to the one used in the Signed-off-by line as checkpatch.pl printed a warning.

Applied to drm-misc-fixes. Thanks!

--
Stefan

Quoted 32 lines
---
 drivers/gpu/drm/mxsfb/mxsfb_kms.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/mxsfb/mxsfb_kms.c +7 -0
index 956f631997f2..fc4b1626261b 100644
@@ -484,6 +484,13 @@ static void
 mxsfb_plane_overlay_atomic_update(struct drm_plane *plane,
 	writel(ctrl, mxsfb->base + LCDC_AS_CTRL);
 }
 
+static bool mxsfb_format_mod_supported(struct drm_plane *plane,
+				       uint32_t format,
+				       uint64_t modifier)
+{
+	return modifier == DRM_FORMAT_MOD_LINEAR;
+}
+
 static const struct drm_plane_helper_funcs mxsfb_plane_primary_helper_funcs = {
 	.atomic_check = mxsfb_plane_atomic_check,
drivers/gpu/drm/mxsfb/mxsfb_kms.c +1 -0
 	.atomic_update = mxsfb_plane_primary_atomic_update,
@@ -495,6 +502,7 @@ static const struct drm_plane_helper_funcs
 mxsfb_plane_overlay_helper_funcs = {
 };
 
 static const struct drm_plane_funcs mxsfb_plane_funcs = {
+	.format_mod_supported	= mxsfb_format_mod_supported,
 	.update_plane		= drm_atomic_helper_update_plane,
 	.disable_plane		= drm_atomic_helper_disable_plane,
Quoted 1 line

.destroy = drm_plane_cleanup,

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel