drm: Auto-set allow_fb_modifiers when given modifiers at plane init
Subsystems (2)
PATCH 1/1 drm: Auto-set allow_fb_modifiers when given modifiers at plane init
When drivers pass non-empty lists of modifiers for initializing their planes, we can infer that they allow framebuffer modifiers and set the driver's allow_fb_modifiers mode config element.
In case the allow_fb_modifiers element was not set (some drivers tend to set them after registering planes), the modifiers will still be registered but won't be available to userspace unless the flag is set later. However in that case, the IN_FORMATS blob won't be created.
In order to avoid this case and generally reduce the trouble associated with the flag, always set allow_fb_modifiers when a non-empty list of format modifiers is passed at plane init.
--- drivers/gpu/drm/drm_plane.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/drm_plane.c +3 -0
@@ -220,6 +220,9 @@ int drm_universal_plane_init(struct drm_device *dev, struct drm_plane *plane, format_modifier_count++; } +if (format_modifier_count) + config->allow_fb_modifiers = true; + plane->modifier_count = format_modifier_count; plane->modifiers = kmalloc_array(format_modifier_count, sizeof(format_modifiers[0]),
Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 9 lines · Paul Kocialkowski
When drivers pass non-empty lists of modifiers for initializing their planes, we can infer that they allow framebuffer modifiers and set the driver's
allow_fb_modifiersmode config element.In case the
allow_fb_modifierselement was not set (some drivers tend to set them after registering planes), the modifiers will still be registered but won't be available to userspace unless the flag is set later. However in that case, theIN_FORMATSblob won't be created.
Quoted 5 lines
In order to avoid this case and generally reduce the trouble associated with the flag, always set
allow_fb_modifierswhen a non-empty list of format modifiers is passed at plane init.Signed-off-by Paul Kocialkowski <[email protected]>
The automatic primary plane drm_crtc_init() creates doesn't set this, so looks correct in all cases.
(boolin.com has a bunch of drm-misc committers, so I'll leave pushing to them).
-Daniel
Quoted 21 lines
--- drivers/gpu/drm/drm_plane.c | 3 +++ 1 file changed, 3 insertions(+)drivers/gpu/drm/drm_plane.c +3
-0@@ -220,6 +220,9 @@ int drm_universal_plane_init(struct drm_device *dev, struct drm_plane *plane, format_modifier_count++; } +if (format_modifier_count) + config->allow_fb_modifiers = true; + plane->modifier_count = format_modifier_count; plane->modifiers = kmalloc_array(format_modifier_count, sizeof(format_modifiers[0]),Signature · 1 line
2.20.1
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
Maxime Ripard
AppliedQuoted 16 lines · Daniel Vetter
Quoted 9 lines · Paul Kocialkowski
When drivers pass non-empty lists of modifiers for initializing their planes, we can infer that they allow framebuffer modifiers and set the driver's
allow_fb_modifiersmode config element.In case the
allow_fb_modifierselement was not set (some drivers tend to set them after registering planes), the modifiers will still be registered but won't be available to userspace unless the flag is set later. However in that case, theIN_FORMATSblob won't be created.Quoted 5 lines
In order to avoid this case and generally reduce the trouble associated with the flag, always set
allow_fb_modifierswhen a non-empty list of format modifiers is passed at plane init.Signed-off-by Paul Kocialkowski <[email protected]>
Quoted 7 lines
The automatic primary plane
drm_crtc_init()creates doesn't set this, so looks correct in all cases.Reviewed-by Daniel Vetter <[email protected]>(boolin.com has a bunch of drm-misc committers, so I'll leave pushing to them).
Applied,
Maxime
Signature · 3 lines
Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel