From ec0a68e50dd3ebfbeee77670d7d09184d0907ead Mon Sep 17 00:00:00 2001 From: Kevin Strasser Date: Thu, 30 May 2019 12:37:07 -0700 Subject: [PATCH] gallium/winsys/kms: Fix dumb buffer bpp MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 6401f55bbd3..d9b417dc4da 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); -- 2.30.2