summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Strasser <[email protected]>2019-05-30 12:37:07 -0700
committerJuan A. Suarez Romero <[email protected]>2019-06-14 09:02:14 +0000
commitbe69033241874593d583ca1ed1eb06d1a2dc47d4 (patch)
treed5acef5569f23741c10fbb7a52688c583a1dd58f
parent582b691062367618e73c0bab03ecf7c03e81fb19 (diff)
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 <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> (cherry picked from commit ec0a68e50dd3ebfbeee77670d7d09184d0907ead)
-rw-r--r--src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c2
1 files changed, 1 insertions, 1 deletions
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);