Hi On 20.10.20 10:35, Daniel Vetter wrote: > 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. > > Reported-by: Simon Ser <contact@xxxxxxxxxxx> > Cc: Simon Ser <contact@xxxxxxxxxxx> > Signed-off-by: Daniel Vetter <daniel.vetter@xxxxxxxxx> > Cc: Rodrigo Siqueira <rodrigosiqueiramelo@xxxxxxxxx> > Cc: Melissa Wen <melissa.srw@xxxxxxxxx> > Cc: Haneen Mohammed <hamohammed.sa@xxxxxxxxx> > Cc: Daniel Vetter <daniel@xxxxxxxx> > --- > drivers/gpu/drm/vkms/vkms_drv.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/vkms/vkms_drv.c b/drivers/gpu/drm/vkms/vkms_drv.c > index 25faba5aac08..98ba844ae77d 100644 > --- a/drivers/gpu/drm/vkms/vkms_drv.c > +++ b/drivers/gpu/drm/vkms/vkms_drv.c > @@ -114,7 +114,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; It's already 0 at this point. I suggest to rather document this FIXME as part of the documentation of drm_fbdev_generic_setup() and preferred_depth. Other drivers are also affected. Best regards Thomas > dev->mode_config.helper_private = &vkms_mode_config_helpers; > > return vkms_output_init(vkmsdev, 0); > -- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 Nürnberg, Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Felix Imendörffer _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel