diff options
author | Eric Anholt <eric@anholt.net> | 2018-09-04 20:52:57 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2018-09-07 15:49:37 -0700 |
commit | b3f64786a3fd428f7fdccd8c884478fd62b70c16 (patch) | |
tree | 7dc4141e275beb4f927ac9ff156be27a28c2c8d5 /glamor | |
parent | b84e7f1c2293f22bd9fcd92a6a82601f94a060a5 (diff) |
glamor: Add support for exporting depth 16 pixmaps.
With a patch to mesa to expose rgb565 pbuffers even on a server with
only depth 24 and 32 visuals, fixes
dEQP-EGL.functional.render.single_context.gles2.rgb565_pbuffer. Those
pbuffers (or at least something renderable with 565) are required by
the current CTS for GLES3, and having the server support DRI3 on those
pixmaps means that we can avoid having a different path for EGL
pbuffers compared to pixmaps.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Diffstat (limited to 'glamor')
-rw-r--r-- | glamor/glamor_egl.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c index b33d8ef15..df278b1a1 100644 --- a/glamor/glamor_egl.c +++ b/glamor/glamor_egl.c @@ -280,18 +280,24 @@ glamor_make_pixmap_exportable(PixmapPtr pixmap, Bool modifiers_ok) (modifiers_ok || !pixmap_priv->used_modifiers)) return TRUE; - if (pixmap->drawable.bitsPerPixel != 32) { + switch (pixmap->drawable.depth) { + case 30: + format = GBM_FORMAT_ARGB2101010; + break; + case 32: + case 24: + format = GBM_FORMAT_ARGB8888; + break; + case 16: + format = GBM_FORMAT_RGB565; + break; + default: xf86DrvMsg(scrn->scrnIndex, X_ERROR, - "Failed to make %dbpp pixmap exportable\n", - pixmap->drawable.bitsPerPixel); + "Failed to make %d depth, %dbpp pixmap exportable\n", + pixmap->drawable.depth, pixmap->drawable.bitsPerPixel); return FALSE; } - if (pixmap->drawable.depth == 30) - format = GBM_FORMAT_ARGB2101010; - else - format = GBM_FORMAT_ARGB8888; - #ifdef GBM_BO_WITH_MODIFIERS if (modifiers_ok && glamor_egl->dmabuf_capable) { uint32_t num_modifiers; |