summaryrefslogtreecommitdiffstats
path: root/src/loader/loader_dri3_helper.c
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2019-01-22 14:08:41 -0500
committerRob Clark <[email protected]>2019-01-22 16:33:27 -0500
commitc56fe4118a2dd991ff1b2a532c0f234eddd435e9 (patch)
tree0f888e55611b9794cbbb6eee03c2ed0aa7f01cc8 /src/loader/loader_dri3_helper.c
parent7c4b9510d1dac14336f208118559a377b9acc464 (diff)
loader: fix the no-modifiers case
Normally modifiers take precendence over use flags, as they are more explicit. But if the driver supports modifiers, but the xserver does not, then we should fallback to the old mechanism of allocating a buffer using 'use' flags. Fixes: 069fdd5f9facbd72fb6a289696c7b74e3237e70f Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]>
Diffstat (limited to 'src/loader/loader_dri3_helper.c')
-rw-r--r--src/loader/loader_dri3_helper.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/loader/loader_dri3_helper.c b/src/loader/loader_dri3_helper.c
index 20fe4cbdabc..ad9b9d87b05 100644
--- a/src/loader/loader_dri3_helper.c
+++ b/src/loader/loader_dri3_helper.c
@@ -1319,12 +1319,20 @@ dri3_alloc_render_buffer(struct loader_dri3_drawable *draw, unsigned int format,
free(mod_reply);
- buffer->image = draw->ext->image->createImageWithModifiers(draw->dri_screen,
- width, height,
- format,
- modifiers,
- count,
- buffer);
+ /* don't use createImageWithModifiers() if we have no
+ * modifiers, other things depend on the use flags when
+ * there are no modifiers to know that a buffer can be
+ * shared.
+ */
+ if (modifiers) {
+ buffer->image = draw->ext->image->createImageWithModifiers(draw->dri_screen,
+ width, height,
+ format,
+ modifiers,
+ count,
+ buffer);
+ }
+
free(modifiers);
}
#endif