Thanks for your patch. I don't think it should be merged as it is.
1. The patch changes almost nothing
vkms takes the path where no explicit format is passed, so the
framebuffer is XRGB8888 before and after the patch. This is the
function that decides it
(drivers/gpu/drm/clients/drm_fbdev_client.c:drm_fbdev_client_setup()):
int drm_fbdev_client_setup(struct drm_device *dev, const struct drm_format_info
*format)
{
struct drm_fb_helper *fb_helper;
unsigned int color_mode;
int ret;
/* TODO: Use format info throughout DRM */
if (format) {
...
} else {
switch (dev->mode_config.preferred_depth) {
case 0:
case 24:
color_mode = 32;
break;
default:
color_mode = dev->mode_config.preferred_depth;
}
}
...
}
0 and 24 are two labels on the same branch, so the patch neither adds a
user of that branch nor removes one; it only changes which label vkms
takes. The only visible difference is that DRM_IOCTL_GET_CAP with
DRM_CAP_DUMB_PREFERRED_DEPTH returns 24 instead of 0.
2. This field conflates depth and bpp; no value can fix that.
XRGB8888 is 24 bits of colour in 32 bits per pixel. This field holds the
first number, the fbdev helpers want the second, and the switch above is
what patches over the difference - without it, 24 would select RGB888.
And the newer formats have no depth to give. XRGB16161616 and its three
siblings are .depth = 0 in struct drm_format_info, and vkms advertises
all four on its primary plane. Move the default to one of them and
there is no number to write.
So 0 is not a placeholder waiting to be filled in; it is the only value
that does not claim to name a format.
3. Deleting the comment loses the only explanation of 0
Nothing else in the tree says what 0 means here. The kerneldoc for
preferred_depth is a single line, "preferred RBG pixel depth, used by fb
helpers", and does not mention 0 at all. If that FIXME goes, the next
person who wonders why vkms writes 0 has nowhere to look. If it has to
go because the helper no longer substitutes depth for bpp, then replace
it with something that still explains the 0.
Thanks,
Oarora Etimis