From: Kevin Strasser Date: Thu, 30 May 2019 19:37:07 +0000 (-0700) Subject: gallium/winsys/kms: Fix dumb buffer bpp X-Git-Tag: upstream/19.3.0~5575 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ec0a68e50dd3ebfbeee77670d7d09184d0907ead;p=platform%2Fupstream%2Fmesa.git gallium/winsys/kms: Fix dumb buffer bpp 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 Reviewed-by: Adam Jackson Reviewed-by: Marek Olšák Reviewed-by: Emil Velikov Reviewed-by: Eric Engestrom --- diff --git a/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c b/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c index 6401f55..d9b417d 100644 --- a/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c +++ b/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c @@ -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);