[Mesa-dev] [PATCH] glx/dri: Initialize reset to __DRI_CTX_RESET_NO_NOTIFICATION.

Jordan Justen jljusten at gmail.com
Mon Aug 6 18:08:26 PDT 2012


On Mon, Aug 6, 2012 at 4:49 PM, Kenneth Graunke <kenneth at whitecape.org> wrote:
> I noticed that we have a bit of inconsistency in how we handle context
> defaults.  In some cases, we initialize variables with default values in
> dri{2,sw}_create_context_attribs.  In other cases, we rely on
> dri2_convert_glx_attribs to do that for us.
>
> For example, in dri2_convert_glx_attribs:
>
>     uint32_t minor_ver = 1;
>     uint32_t major_ver = 2;
>     uint32_t flags = 0;
>     unsigned api;
>     int reset;
>
> we default the version to 2.1.  Whereas in dri_convert_glx_attribs we have:
>
>    if (num_attribs == 0) {
>       *api = __DRI_API_OPENGL;
>       return true;
>    }
>    ...
>    *major_ver = 1;
>    *minor_ver = 0;
>    *reset = __DRI_CTX_RESET_NO_NOTIFICATION;
>
> So if they try to create a context with _no_ attributes, we pick 2.1.
> If they specify _some_ attributes, but not version attributes, we hit
> this code and pick 1.0.  drisw_create_context_attribs also defaults to 1.0.
>
> My feeling is that we should either make dri2_convert_glx_attribs not
> short-circuit on num_attribs == 0, so it fully initializes all the
> defaults, or we should make both the callers fully specify defaults and
> remove the block that makes it set them.  Either would work, but it'd be
> nice to pick one.
>
> Preferences?

I would vote to move the initialization fully to dri2_convert_glx_attribs.

-Jordan


More information about the mesa-dev mailing list