drm/vkms: Unset preferred_depth
PATCH 1/2 drm/vkms: Unset preferred_depth
There's a confusion between the preferred_depth uapi and the generic fbdev helpers. Former wants depth, latter wants bpp, and for XRGB8888 they don't match. Which hit me with vkms, which wants that.
All other drivers setting this and using the generic fbdev helpers use 16, where both numbers match, for RGB565.
Since fixing this is a bit involved (I think for atomic drivers we should just compute this all internally from the format list of the first primary plane) paper over the issue in vkms by using defaults everywhere. Then userspace will pick XRGB8888, and fbdev helpers will do the same, and we have what we want.
--- drivers/gpu/drm/vkms/vkms_drv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/vkms/vkms_drv.c +4 -1
@@ -113,7 +113,10 @@ static int vkms_modeset_init(struct vkms_device *vkmsdev) dev->mode_config.max_height =YRES_MAX ; dev->mode_config.cursor_width =512 ; dev->mode_config.cursor_height =512 ; - dev->mode_config.preferred_depth =32 ; +/* FIXME: There's a confusion between bpp and depth between this and +* fbdev helpers. We have to go with 0, meaning "pick the default", +* which ix XRGB8888 in all cases. */ + dev->mode_config.preferred_depth =0 ; dev->mode_config.helper_private = &vkms_mode_config_helpers;return vkms_output_init (vkmsdev,0 );
Signature · 6 lines
2.29.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/2 drm/fb-helper: Add a FIXME that generic_setup is very confusing
I tried to fix this for real, but it's very sprawling and lots of drivers get this mildly wrong one way or the other.
--- drivers/gpu/drm/drm_fb_helper.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/drm_fb_helper.c +5 -0
@@ -2494,6 +2494,11 @@ void drm_fbdev_generic_setup(struct drm_device *dev,return ; } +/* +* FIXME: This mixes up depth with bpp, which results in a glorious +* mess, resulting in some drivers picking wrong fbdev defaults and +* others wrong preferred_depth defaults. +*/ if (!preferred_bpp) preferred_bpp = dev->mode_config.preferred_depth;if (!preferred_bpp)
Signature · 6 lines
2.29.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 2/2] drm/fb-helper: Add a FIXME that generic_setup is very confusing
Quoted 9 lines · Daniel Vetter
I tried to fix this for real, but it's very sprawling and lots of drivers get this mildly wrong one way or the other.
Signed-off-by Daniel Vetter <[email protected]>Cc Maarten Lankhorst <[email protected]>Cc Maxime Ripard <[email protected]>Cc Thomas Zimmermann <[email protected]>Cc David Airlie <[email protected]>Cc Daniel Vetter <[email protected]>
Anyone feeling like an ack on this one?
-Daniel
Quoted 23 lines
--- drivers/gpu/drm/drm_fb_helper.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/gpu/drm/drm_fb_helper.c +5
-0@@ -2494,6 +2494,11 @@ void drm_fbdev_generic_setup(struct drm_device *dev,return ; } +/* +* FIXME: This mixes up depth with bpp, which results in a glorious +* mess, resulting in some drivers picking wrong fbdev defaults and +* others wrong preferred_depth defaults. +*/ if (!preferred_bpp) preferred_bpp = dev->mode_config.preferred_depth;if (!preferred_bpp)Signature · 1 line
2.29.2
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
Simon Ser
Acked-byRe: [PATCH 2/2] drm/fb-helper: Add a FIXME that generic_setup is very confusing
Quoted 4 lines · Daniel Vetter
Quoted 3 lines · Daniel Vetter
I tried to fix this for real, but it's very sprawling and lots of drivers get this mildly wrong one way or the other.
Quoted 8 lines
Quoted 6 lines
Signed-off-by Daniel Vetter <[email protected]>Cc Maarten Lankhorst <[email protected]>Cc Maxime Ripard <[email protected]>Cc Thomas Zimmermann <[email protected]>Cc David Airlie <[email protected]>Cc Daniel Vetter <[email protected]>Anyone feeling like an ack on this one?
From my limited understanding of fbdev, this FIXME sounds correct to me.
Quoted 12 lines
Quoted 12 lines
--- drivers/gpu/drm/drm_fb_helper.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/gpu/drm/drm_fb_helper.c +0
-0@@ -2494,6 +2494,11 @@ void drm_fbdev_generic_setup(struct drm_device *dev,return ; }
Quoted 10 lines
Quoted 10 lines
drivers/gpu/drm/drm_fb_helper.c +5
-1+/* +* FIXME: This mixes up depth with bpp, which results in a glorious +* mess, resulting in some drivers picking wrong fbdev defaults and +* others wrong preferred_depth defaults. +*/ if (!preferred_bpp) preferred_bpp = dev->mode_config.preferred_depth;if (!preferred_bpp) --2.29.2
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 2/2] drm/fb-helper: Add a FIXME that generic_setup is very confusing
Quoted 13 lines · Simon Ser
Quoted 11 lines · Daniel Vetter
Quoted 9 lines · Daniel Vetter
I tried to fix this for real, but it's very sprawling and lots of drivers get this mildly wrong one way or the other.
Signed-off-by Daniel Vetter <[email protected]>Cc Maarten Lankhorst <[email protected]>Cc Maxime Ripard <[email protected]>Cc Thomas Zimmermann <[email protected]>Cc David Airlie <[email protected]>Cc Daniel Vetter <[email protected]>
Quoted 5 lines
Quoted 1 line
Anyone feeling like an ack on this one?
From my limited understanding of fbdev, this FIXME sounds correct to me.
Acked-by Simon Ser <[email protected]>
Thanks for taking a look, patch pushed to drm-misc-next. -Daniel
Quoted 23 lines
Quoted 23 lines
Quoted 23 lines
--- drivers/gpu/drm/drm_fb_helper.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/gpu/drm/drm_fb_helper.c +5
-1@@ -2494,6 +2494,11 @@ void drm_fbdev_generic_setup(struct drm_device *dev,return ; } +/* +* FIXME: This mixes up depth with bpp, which results in a glorious +* mess, resulting in some drivers picking wrong fbdev defaults and +* others wrong preferred_depth defaults. +*/ if (!preferred_bpp) preferred_bpp = dev->mode_config.preferred_depth;if (!preferred_bpp) --2.29.2
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
Re: [PATCH 2/2] drm/fb-helper: Add a FIXME that generic_setup is very confusing
In reply to Daniel VetterQuoted 4 lines · Daniel Vetter
Quoted 3 lines · Daniel Vetter
I tried to fix this for real, but it's very sprawling and lots of drivers get this mildly wrong one way or the other.
Quoted 8 lines
Quoted 6 lines
Signed-off-by Daniel Vetter <[email protected]>Cc Maarten Lankhorst <[email protected]>Cc Maxime Ripard <[email protected]>Cc Thomas Zimmermann <[email protected]>Cc David Airlie <[email protected]>Cc Daniel Vetter <[email protected]>Anyone feeling like an ack on this one?
Maxime
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 4 lines · Daniel Vetter
There's a confusion between the
preferred_depthuapi and the generic fbdev helpers. Former wants depth, latter wants bpp, and for XRGB8888 they don't match. Which hit me with vkms, which wants that.
Quoted 8 lines
All other drivers setting this and using the generic fbdev helpers use 16, where both numbers match, for RGB565.
Since fixing this is a bit involved (I think for atomic drivers we should just compute this all internally from the format list of the first primary plane) paper over the issue in vkms by using defaults everywhere. Then userspace will pick XRGB8888, and fbdev helpers will do the same, and we have what we want.
I think I had a patch ages ago that tried to improve the fb_helper pixel format stuff a bit. This one I think:
https://patchwork.freedesktop.org/patch/203189/
Haven't checked how much of that would still be relevant though.
Quoted 36 lines
Reported-by Simon Ser <[email protected]>Reviewed-by Simon Ser <[email protected]>Cc Simon Ser <[email protected]>Signed-off-by Daniel Vetter <[email protected]>Cc Rodrigo Siqueira <[email protected]>Cc Melissa Wen <[email protected]>Cc Haneen Mohammed <[email protected]>Cc Daniel Vetter <[email protected]>--- drivers/gpu/drm/vkms/vkms_drv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)drivers/gpu/drm/vkms/vkms_drv.c +4
-1@@ -113,7 +113,10 @@ static int vkms_modeset_init(struct vkms_device *vkmsdev) dev->mode_config.max_height =YRES_MAX ; dev->mode_config.cursor_width =512 ; dev->mode_config.cursor_height =512 ; - dev->mode_config.preferred_depth =32 ; +/* FIXME: There's a confusion between bpp and depth between this and +* fbdev helpers. We have to go with 0, meaning "pick the default", +* which ix XRGB8888 in all cases. */ + dev->mode_config.preferred_depth =0 ; dev->mode_config.helper_private = &vkms_mode_config_helpers;return vkms_output_init (vkmsdev,0 );Signature · 6 lines
2.29.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 14 lines · Ville Syrjälä
Quoted 4 lines · Daniel Vetter
There's a confusion between the
preferred_depthuapi and the generic fbdev helpers. Former wants depth, latter wants bpp, and for XRGB8888 they don't match. Which hit me with vkms, which wants that.Quoted 8 lines
All other drivers setting this and using the generic fbdev helpers use 16, where both numbers match, for RGB565.
Since fixing this is a bit involved (I think for atomic drivers we should just compute this all internally from the format list of the first primary plane) paper over the issue in vkms by using defaults everywhere. Then userspace will pick XRGB8888, and fbdev helpers will do the same, and we have what we want.
Quoted 5 lines
I think I had a patch ages ago that tried to improve the
fb_helperpixel format stuff a bit. This one I think:
https://patchwork.freedesktop.org/patch/203189/Haven't checked how much of that would still be relevant though.
Uh this looks useful, my attempts have only tried to clean up the driver side in what they're setting for preferred_depth and how they set up the fbdev emulation. I haven't looked at the fbdev code itself, and especially your mapping table should be useful.
Care to resubmit that one again?
-Daniel
Quoted 41 lines
Quoted 37 lines
Reported-by Simon Ser <[email protected]>Reviewed-by Simon Ser <[email protected]>Cc Simon Ser <[email protected]>Signed-off-by Daniel Vetter <[email protected]>Cc Rodrigo Siqueira <[email protected]>Cc Melissa Wen <[email protected]>Cc Haneen Mohammed <[email protected]>Cc Daniel Vetter <[email protected]>--- drivers/gpu/drm/vkms/vkms_drv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)drivers/gpu/drm/vkms/vkms_drv.c +4
-1@@ -113,7 +113,10 @@ static int vkms_modeset_init(struct vkms_device *vkmsdev) dev->mode_config.max_height =YRES_MAX ; dev->mode_config.cursor_width =512 ; dev->mode_config.cursor_height =512 ; - dev->mode_config.preferred_depth =32 ; +/* FIXME: There's a confusion between bpp and depth between this and +* fbdev helpers. We have to go with 0, meaning "pick the default", +* which ix XRGB8888 in all cases. */ + dev->mode_config.preferred_depth =0 ; dev->mode_config.helper_private = &vkms_mode_config_helpers;return vkms_output_init (vkmsdev,0 );Signature · 6 lines
2.29.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-develSignature · 2 lines
Ville Syrjälä Intel
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