summaryrefslogtreecommitdiffstats
path: root/src/gbm
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2016-08-16 12:56:45 -0400
committerRob Clark <robdclark@gmail.com>2016-09-07 11:54:00 -0400
commit74b1969d717f2428f0b9dcaaea611e95736120a5 (patch)
treeb5815ff5afd5e93fce473dc5835706ce6634e6ed /src/gbm
parent32c061b110f6c4b6d6c7b1278d4e308e296c3a2a (diff)
downloadexternal_mesa3d-74b1969d717f2428f0b9dcaaea611e95736120a5.zip
external_mesa3d-74b1969d717f2428f0b9dcaaea611e95736120a5.tar.gz
external_mesa3d-74b1969d717f2428f0b9dcaaea611e95736120a5.tar.bz2
gbm: wire up fence extension
v2: make fence extension optional to not break non-i965 classic drivers, and move __DRI2_FENCE into core extensions, based on comments from Emil Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'src/gbm')
-rw-r--r--src/gbm/backends/dri/gbm_dri.c4
-rw-r--r--src/gbm/backends/dri/gbm_driint.h1
2 files changed, 4 insertions, 1 deletions
diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c
index 9c3a51b..c1f9d62 100644
--- a/src/gbm/backends/dri/gbm_dri.c
+++ b/src/gbm/backends/dri/gbm_dri.c
@@ -239,11 +239,13 @@ struct dri_extension_match {
const char *name;
int version;
int offset;
+ int optional;
};
static struct dri_extension_match dri_core_extensions[] = {
{ __DRI2_FLUSH, 1, offsetof(struct gbm_dri_device, flush) },
{ __DRI_IMAGE, 1, offsetof(struct gbm_dri_device, image) },
+ { __DRI2_FENCE, 2, offsetof(struct gbm_dri_device, fence), 1 },
{ NULL, 0, 0 }
};
@@ -279,7 +281,7 @@ dri_bind_extensions(struct gbm_dri_device *dri,
for (j = 0; matches[j].name; j++) {
field = ((char *) dri + matches[j].offset);
- if (*(const __DRIextension **) field == NULL) {
+ if ((*(const __DRIextension **) field == NULL) && !matches[j].optional) {
ret = -1;
}
}
diff --git a/src/gbm/backends/dri/gbm_driint.h b/src/gbm/backends/dri/gbm_driint.h
index 46bb5c1..9c55007 100644
--- a/src/gbm/backends/dri/gbm_driint.h
+++ b/src/gbm/backends/dri/gbm_driint.h
@@ -51,6 +51,7 @@ struct gbm_dri_device {
const __DRIcoreExtension *core;
const __DRIdri2Extension *dri2;
+ const __DRI2fenceExtension *fence;
const __DRIimageExtension *image;
const __DRIswrastExtension *swrast;
const __DRI2flushExtension *flush;