gallium/winsys/kms: Fix dumb buffer bpp
authorKevin Strasser <kevin.strasser@intel.com>
Thu, 30 May 2019 19:37:07 +0000 (12:37 -0700)
committerKevin Strasser <kevin.strasser@intel.com>
Wed, 12 Jun 2019 18:44:10 +0000 (11:44 -0700)
The bpp in the dumb buffer creation request is hardcoded to 32, which is an
incorrect assumption as the caller is free to pick any pipe format. Use the
bpp supplied to us through util_format_get_blocksizebits().

Fixes: 3b176c441b "gallium: Add a dumb drm/kms winsys backed swrast provider"
Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c

index 6401f55bbd3dff9539e84b62f159e19c2841c7dd..d9b417dc4dadd5f5ea8eaba7e63d0dcad7906dfa 100644 (file)
@@ -183,7 +183,7 @@ kms_sw_displaytarget_create(struct sw_winsys *ws,
    kms_sw_dt->format = format;
 
    memset(&create_req, 0, sizeof(create_req));
-   create_req.bpp = 32;
+   create_req.bpp = util_format_get_blocksizebits(format);
    create_req.width = width;
    create_req.height = height;
    ret = drmIoctl(kms_sw->fd, DRM_IOCTL_MODE_CREATE_DUMB, &create_req);