dri_interface,egl,gallium: only expose RGBA visuals on Android

X/GLX can't handle them. This removes almost 500 GLX visuals that were
incorrectly exposed.

Add an optional getCapability callback for querying what the loader can do.

I'm not splitting this patch, because it's already too small.

v2: also add the callback to __DRIimageLoaderExtension

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Cc: 17.2 <mesa-stable@lists.freedesktop.org>
This commit is contained in:
Marek Olšák
2017-07-28 17:30:34 +02:00
parent 5d8359ff4d
commit 1bf703e4ea
3 changed files with 65 additions and 5 deletions
+26 -2
View File
@@ -967,7 +967,15 @@ struct __DRIbufferRec {
};
#define __DRI_DRI2_LOADER "DRI_DRI2Loader"
#define __DRI_DRI2_LOADER_VERSION 3
#define __DRI_DRI2_LOADER_VERSION 4
enum dri_loader_cap {
/* Whether the loader handles RGBA channel ordering correctly. If not,
* only BGRA ordering can be exposed.
*/
DRI_LOADER_CAP_RGBA_ORDERING,
};
struct __DRIdri2LoaderExtensionRec {
__DRIextension base;
@@ -1017,6 +1025,14 @@ struct __DRIdri2LoaderExtensionRec {
int *width, int *height,
unsigned int *attachments, int count,
int *out_count, void *loaderPrivate);
/**
* Return a loader capability value. If the loader doesn't know the enum,
* it will return 0.
*
* \since 4
*/
unsigned (*getCapability)(void *loaderPrivate, enum dri_loader_cap cap);
};
/**
@@ -1711,7 +1727,7 @@ struct __DRIimageList {
};
#define __DRI_IMAGE_LOADER "DRI_IMAGE_LOADER"
#define __DRI_IMAGE_LOADER_VERSION 1
#define __DRI_IMAGE_LOADER_VERSION 2
struct __DRIimageLoaderExtensionRec {
__DRIextension base;
@@ -1747,6 +1763,14 @@ struct __DRIimageLoaderExtensionRec {
* into __DRIdri2ExtensionRec::createNewDrawable
*/
void (*flushFrontBuffer)(__DRIdrawable *driDrawable, void *loaderPrivate);
/**
* Return a loader capability value. If the loader doesn't know the enum,
* it will return 0.
*
* \since 2
*/
unsigned (*getCapability)(void *loaderPrivate, enum dri_loader_cap cap);
};
/**