summaryrefslogtreecommitdiff
path: root/glx
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2014-07-24 12:29:41 +0100
committerJon Turney <jon.turney@dronecode.org.uk>2016-09-15 20:10:29 +0100
commitf5f4d32ac7c250cfbfb94883ce7d7e46151e89f0 (patch)
tree77243281387f60da6743694bb7153e1508910046 /glx
parent52d6a1e832a5e62289dd4f32824ae16a78dfd7e8 (diff)
Add Windows-DRI extension
If windowsdriproto headers are available, build a Windows-DRI extension, which supports requests to enable local clients to directly render GL to a Windows drawable: - a query to check if WGL is being used on a screen - a query to map a fbconfigID to a native pixelformatindex - a query to map a drawable to a native handle Windows-DRI can only be useful if we are using WGL, so make an note if WGL is active on a screen. Make validGlxDrawable() public Adjust glxWinSetPixelFormat() so it doesn't require a context, just a screen and config. That enables factoring out the deferred drawable creation code as glxWinDeferredCreateDrawable() Enhance glxWinDeferredCreateDrawable(), so that pixmaps are placed into a file mapping, so they exist in memory which can be shared with the direct rendering process. Currently, this file mapping is accessed by a name generated from the XID. This will not be unique across multiple server instances. It would perhaps be better, although more complicated, to use an anonymous file mapping, and then duplicate the handle for the direct rendering process. Use glxWinDeferredCreateDrawable() to ensure the native handle exists for the Windows-DRI query to map a drawable to native handle. v2: Various printf format warning fixes v3: Fix format warnings on x86 Move some uninteresting windows-dri output to debug log level v4: check for windowsdriproto when --enable-windowsdri use windowsdriproto_CFLAGS Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Diffstat (limited to 'glx')
-rw-r--r--glx/glxcmds.c2
-rw-r--r--glx/glxdrawable.h3
2 files changed, 4 insertions, 1 deletions
diff --git a/glx/glxcmds.c b/glx/glxcmds.c
index 481dfb9e3..5873cb49c 100644
--- a/glx/glxcmds.c
+++ b/glx/glxcmds.c
@@ -146,7 +146,7 @@ validGlxContext(ClientPtr client, XID id, int access_mode,
return TRUE;
}
-static int
+int
validGlxDrawable(ClientPtr client, XID id, int type, int access_mode,
__GLXdrawable ** drawable, int *err)
{
diff --git a/glx/glxdrawable.h b/glx/glxdrawable.h
index 007658961..441d72dd7 100644
--- a/glx/glxdrawable.h
+++ b/glx/glxdrawable.h
@@ -74,4 +74,7 @@ struct __GLXdrawable {
unsigned long eventMask;
};
+extern int validGlxDrawable(ClientPtr client, XID id, int type, int access_mode,
+ __GLXdrawable **drawable, int *err);
+
#endif /* !__GLX_drawable_h__ */