summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2020-04-15 17:15:41 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2020-04-15 17:25:40 +0100
commitf2a54e256dd7539633c476a379db2b1e60eec811 (patch)
treecc6b2eeb6563cd95d9ceb6adeb9c399914df3a09 /src
parent652d93cbbdc159c0883f1b626ea48e28bac63ae3 (diff)
sna/dri2: Interpret DRI2ATTACH_FORMAT as depth not bpp
In mesa i915/i965 pass the bpp to use when creating the surface, but the gallium state tracker passed the depth. As it happens that BitsPerPixel(format) will do the right thing for both, use that. | DRI2ATTACH_FORMAT { attachment: CARD32 | format: CARD32 } | | The DRI2ATTACH_FORMAT describes an attachment and the associated | format. 'attachment' describes the attachment point for the buffer, | 'format' describes an opaque, device-dependent format for the buffer. Should we need to use an explicit format (heavens forbid as nobody likes DRI2) then that will have to start in the range above 256 (or higher). For now the convention is defined by the mixture of i965/iris, and that is to assume it is essentially a depth. Reported-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> References: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4569 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/sna_dri2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c
index 5fd4d54b..f2f2c1d3 100644
--- a/src/sna/sna_dri2.c
+++ b/src/sna/sna_dri2.c
@@ -605,7 +605,7 @@ sna_dri2_create_buffer(DrawablePtr draw,
struct sna_dri2_private *private;
PixmapPtr pixmap;
struct kgem_bo *bo;
- unsigned bpp = format ?: draw->bitsPerPixel;
+ unsigned bpp = format ? BitsPerPixel(format) : draw->bitsPerPixel;
unsigned flags = CREATE_EXACT;
uint32_t size;