[PATCH 3/8] glamor: Put in a pluggable context switcher for GLX versus EGL.
Keith Packard
keithp at keithp.com
Wed Feb 5 16:06:11 PST 2014
Eric Anholt <eric at anholt.net> writes:
> +struct glamor_context {
> + /** Either an EGLDisplay or an Xlib Display */
> + void *display;
> +
> + /** Either a GLXContext or an EGLContext. */
> + void *ctx;
> +
> + /** The EGLSurface we should MakeCurrent to */
> + void *drawable;
> +
> + /** The GLXDrawable we should MakeCurrent to */
> + uint32_t drawable_xid;
Hrm. I don't see any code outside of the egl/glx bits which use display,
drawable or drawable_xid. I think you could use per-backend structures
that embed the glamor_context within them like this:
struct glamor_context {
void *ctx
void (*get_context)(struct glamor_context *glamor_ctx);
void (*put_context)(struct glamor_context *glamor_ctx);
};
struct glamor_context_egl {
struct glamor_context base;
EGLDisplay display;
};
struct glamor_context_glx {
struct glamor_context base;
Display *display;
GLXDrawable drawable_xid;
};
It would mean that the backend would be allocating this, but that would
also give it a spot for it's own screen private data; right now, you've
got two screen privates, one for glamor and one for glamor_egl.
Just suggestions, the code looks fine as it is.
Reviewed-by: Keith Packard <keithp at keithp.com>
--
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 810 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20140205/3cf25946/attachment.pgp>
More information about the xorg-devel
mailing list