summaryrefslogtreecommitdiffstats
path: root/include/GL/internal
diff options
context:
space:
mode:
authorChris Wilson <[email protected]>2016-10-27 19:34:46 +0100
committerChris Wilson <[email protected]>2017-10-20 11:28:17 +0100
commit95ecf3df62372b5ba50d4b967994fff9464298ef (patch)
tree037dad8e0033cdc58af98c1e257aaca9cacb068f /include/GL/internal
parente2053b8e3d45af48f35973ddb55993353b597753 (diff)
egl: Support IMG_context_priority
IMG_context_priority https://www.khronos.org/registry/egl/extensions/IMG/EGL_IMG_context_priority.txt "This extension allows an EGLContext to be created with a priority hint. It is possible that an implementation will not honour the hint, especially if there are constraints on the number of high priority contexts available in the system, or system policy limits access to high priority contexts to appropriate system privilege level. A query is provided to find the real priority level assigned to the context after creation." The extension adds a new eglCreateContext attribute for choosing a priority hint. This stub parses the attribute and copies into the base struct _egl_context, and hooks up the query similarly. Since the attribute is purely a hint, I have no qualms about the lack of implementation before reporting back the value the user gave! v2: Remember to set the default ContextPriority value to medium. v3: Use the driRendererQuery interface to probe the backend for supported priority values and use those to mask the EGL interface. v4: Treat the priority attrib as a hint and gracefully mask any requests not supported by the driver, the EGLContext will remain at medium priority. Signed-off-by: Chris Wilson <[email protected]> Cc: Rob Clark <[email protected]> Reviewed-by: Ben Widawsky <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'include/GL/internal')
-rw-r--r--include/GL/internal/dri_interface.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h
index aefba92c024..7ed0169a984 100644
--- a/include/GL/internal/dri_interface.h
+++ b/include/GL/internal/dri_interface.h
@@ -1782,6 +1782,14 @@ typedef struct __DRIDriverVtableExtensionRec {
*/
#define __DRI2_RENDERER_HAS_FRAMEBUFFER_SRGB 0x000c
+/* Bitmaks of supported/available context priorities - must match
+ * __EGL_CONTEXT_PRIORITY_LOW_BIT et al
+ */
+#define __DRI2_RENDERER_HAS_CONTEXT_PRIORITY 0x000d
+#define __DRI2_RENDERER_HAS_CONTEXT_PRIORITY_LOW (1 << 0)
+#define __DRI2_RENDERER_HAS_CONTEXT_PRIORITY_MEDIUM (1 << 1)
+#define __DRI2_RENDERER_HAS_CONTEXT_PRIORITY_HIGH (1 << 2)
+
typedef struct __DRI2rendererQueryExtensionRec __DRI2rendererQueryExtension;
struct __DRI2rendererQueryExtensionRec {
__DRIextension base;