drm/vkms: Set preferred_depth to 24 for XRGB8888 default
PATCH v2 1/1 drm/vkms: Set preferred_depth to 24 for XRGB8888 default
VKMS defaults to XRGB8888, which has a color depth of 24 bits stored in a 32 bpp container. Setting preferred_depth to 24 reports the actual depth to userspace (such as Xorg) via DRM_CAP_DUMB_PREFERRED_DEPTH rather than returning 0, while keeping the fbdev default intact.
---
v2:
- Add commit description (Thomas Zimmermann).
- Collect Reviewed-by from Oarora Etimis.
- Resend as standalone thread per reviewer request.
drivers/gpu/drm/vkms/vkms_drv.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/gpu/drm/vkms/vkms_drv.c +2 -6
@@ -146,12 +146,8 @@ 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 ; -/* -* 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 is XRGB8888 in all cases. -*/ - dev->mode_config.preferred_depth =0 ; +/* XRGB8888 has 24 bits of color data stored in 32 bits per pixel. */ + dev->mode_config.preferred_depth =24 ; dev->mode_config.helper_private = &vkms_mode_config_helpers;return vkms_output_init (vkmsdev);
Signature · 1 line
2.56.0
Am 07.11.26 um 10:02 schrieb Karthik Sarvan:
Quoted 7 lines
VKMS defaults to XRGB8888, which has a color depth of 24 bits stored in a 32 bpp container. Setting
preferred_depthto 24 reports the actual depth to userspace (such as Xorg) viaDRM_CAP_DUMB_PREFERRED_DEPTHrather than returning 0, while keeping the fbdev default intact.Signed-off-by Karthik Sarvan <[email protected]>Reviewed-by Oarora Etimis <[email protected]>
Quoted 28 lines
---
v2:
- Add commit description (Thomas Zimmermann).
- Collect Reviewed-by from Oarora Etimis.
- Resend as standalone thread per reviewer request.drivers/gpu/drm/vkms/vkms_drv.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)drivers/gpu/drm/vkms/vkms_drv.c +2
-6@@ -146,12 +146,8 @@ 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 ; -/* -* 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 is XRGB8888 in all cases. -*/ - dev->mode_config.preferred_depth =0 ; +/* XRGB8888 has 24 bits of color data stored in 32 bits per pixel. */ + dev->mode_config.preferred_depth =24 ; dev->mode_config.helper_private = &vkms_mode_config_helpers;return vkms_output_init (vkmsdev);
Signature · 6 lines
-- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com GF: Stefan Gaiser, Jochen Jaser, Abhinav Puri, (HRB 36809, AG Nürnberg)