[PATCH 3/8] glamor: Put in a pluggable context switcher for GLX versus EGL.
Eric Anholt
eric at anholt.net
Thu Feb 6 17:08:17 PST 2014
Keith Packard <keithp at keithp.com> writes:
> 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>
Yeah, these seem like sensible changes, but I think I'll save them for
later. I don't think it would help with the glamor_egl private, because
the problem there is that you're doing initialization work and storing
stuff before there's a screen to attach the private to.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20140206/4c7631c9/attachment.pgp>
More information about the xorg-devel
mailing list