Skip to contentSkip to conversation

Implement .format_mod_supported in mxsfb

PATCH Superseded Daniel Abrecht 4 participants 6 messages Oct 24, 2020 – Oct 26, 2020

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Implement .format_mod_supported in mxsfb

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.

---
 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

Hi Daniel,

Quoted 5 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.

Since this got broken by the switch away for the simple display pipeline helper (ae1ed0093281939b80664a687689f12436c0e874) could you add a fixes tag?
Cheers,
-- Guido

Quoted 35 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,
Quoted 7 lines

.destroy = drm_plane_cleanup,

Signature · 5 lines
2.20.1
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

#2 lore raw

Hi Guido

Am 2020-10-25 15:52, schrieb Guido Günther:

Quoted 5 lines

Since this got broken by the switch away for the simple display pipeline helper (ae1ed0093281939b80664a687689f12436c0e874) could you add a fixes tag?
Cheers,
-- Guido

Thanks, I've sent a v2 with the fixes tag added.

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

#3 lore raw
In reply to Guido Günther
Quoted 9 lines · Guido Günther

Hi Daniel,

Quoted 5 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 3 lines

Since this got broken by the switch away for the simple display pipeline helper (ae1ed0093281939b80664a687689f12436c0e874) could you add a fixes tag?

mxsfb is also missing setting the allow_fb_modifiers flag, without which all this modifier stuff won't work great. Please add that too. I guess some igt testing for this might be useful too, but not sure we can do that with sufficient generality. It should fall over though since if you try to create an fb with modifiers you'll fail, so no idea what userspace you have here.
-Daniel

Quoted 49 lines

Cheers,
-- Guido

Quoted 35 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, .atomic_update = mxsfb_plane_primary_atomic_update,

drivers/gpu/drm/mxsfb/mxsfb_kms.c +1 -0
@@ -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 7 lines

.destroy = drm_plane_cleanup,
--
2.20.1
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
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
#4 lore raw
Quoted 10 lines · Daniel Vetter
Quoted 9 lines · Guido Günther

Hi Daniel,

Quoted 5 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 6 lines
Quoted 3 lines

Since this got broken by the switch away for the simple display pipeline helper (ae1ed0093281939b80664a687689f12436c0e874) could you add a fixes tag?

mxsfb is also missing setting the allow_fb_modifiers flag, without which all this modifier stuff won't work great.

drm_universal_plane_init() automagically adds it if a modifier list is passed in.

Signature · 6 lines
Ville Syrjälä
Intel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#5 lore raw
Quoted 15 lines · Ville Syrjälä
Quoted 14 lines · Daniel Vetter
Quoted 12 lines · Guido Günther

Hi Daniel,

Quoted 5 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.

Since this got broken by the switch away for the simple display pipeline helper (ae1ed0093281939b80664a687689f12436c0e874) could you add a fixes tag?

Quoted 5 lines
Quoted 2 lines

mxsfb is also missing setting the allow_fb_modifiers flag, without which all this modifier stuff won't work great.

drm_universal_plane_init() automagically adds it if a modifier list is passed in.

Oh right I missed that :-/ I guess then removing the explicit setting from drivers would be good, and maybe adding a comment to the kerneldoc about that.

And more of a mess indeed ...
-Daniel

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