Keith Packard <kei...@keithp.com> writes:

> Eric Anholt <e...@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 <kei...@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.

Attachment: pgpe1DiPeQK0y.pgp
Description: PGP signature

_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to