glx: Store the value of renderType while creating context
authorTomasz Lis <tomasz.lis@intel.com>
Wed, 17 Jul 2013 11:49:14 +0000 (13:49 +0200)
committerIan Romanick <ian.d.romanick@intel.com>
Thu, 18 Jul 2013 23:03:42 +0000 (16:03 -0700)
Make sure that renderType property value is stored in GLX context while
it's being created.  Further patches will be provided to make the value
correspond to fbconfig's renderType.

v2 (idr): Move a hunk from the next patch to this patch to prevent a
build break.

Signed-off-by: Tomasz Lis <tomasz.lis@intel.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/glx/dri2_glx.c
src/glx/dri_glx.c
src/glx/drisw_glx.c
src/glx/glxcmds.c

index 7ce57751f248638e818e82f314307bf1e9faf58c..cc75b91d12ac909ea3f1be7ed319e1cb5804442a 100644 (file)
@@ -226,6 +226,8 @@ dri2_create_context(struct glx_screen *base,
       return NULL;
    }
 
+   pcp->base.renderType = renderType;
+
    pcp->driContext =
       (*psc->dri2->createNewContext) (psc->driScreen,
                                       config->driConfig, shared, pcp);
@@ -256,6 +258,7 @@ dri2_create_context_attribs(struct glx_screen *base,
 
    uint32_t minor_ver = 1;
    uint32_t major_ver = 2;
+   uint32_t renderType = GLX_RGBA_TYPE;
    uint32_t flags = 0;
    unsigned api;
    int reset = __DRI_CTX_RESET_NO_NOTIFICATION;
@@ -311,6 +314,11 @@ dri2_create_context_attribs(struct glx_screen *base,
       ctx_attribs[num_ctx_attribs++] = flags;
    }
 
+   /* The renderType is retrieved from attribs, or set to default
+    *  of GLX_RGBA_TYPE.
+    */
+   pcp->base.renderType = renderType;
+
    pcp->driContext =
       (*psc->dri2->createContextAttribs) (psc->driScreen,
                                          api,
index ba8fda20ad2be8812bbf1688b175527fa5705ad5..cc45734b66c1763557fdc9055fd731f329c760e5 100644 (file)
@@ -602,6 +602,8 @@ dri_create_context(struct glx_screen *base,
       return NULL;
    }
 
+   pcp->base.renderType = renderType;
+
    if (!XF86DRICreateContextWithConfig(psc->base.dpy, psc->base.scr,
                                        config->base.visualID,
                                        &pcp->hwContextID, &hwContext)) {
index 832e9642ea9c3d3fa234fba2b3b3c2a9b4668028..80ddf9cf753c6ae57ae051fab4fc268a7eb88e06 100644 (file)
@@ -401,6 +401,8 @@ drisw_create_context(struct glx_screen *base,
       return NULL;
    }
 
+   pcp->base.renderType = renderType;
+
    pcp->driContext =
       (*psc->core->createNewContext) (psc->driScreen,
                                      config->driConfig, shared, pcp);
@@ -429,6 +431,7 @@ drisw_create_context_attribs(struct glx_screen *base,
 
    uint32_t minor_ver = 1;
    uint32_t major_ver = 0;
+   uint32_t renderType = GLX_RGBA_TYPE;
    uint32_t flags = 0;
    unsigned api;
    int reset = __DRI_CTX_RESET_NO_NOTIFICATION;
@@ -479,6 +482,8 @@ drisw_create_context_attribs(struct glx_screen *base,
       ctx_attribs[num_ctx_attribs++] = flags;
    }
 
+   pcp->base.renderType = renderType;
+
    pcp->driContext =
       (*psc->swrast->createContextAttribs) (psc->driScreen,
                                            api,
index 019165aefca90d6e640aa6161606c07155f015af..51b2237b6989039fbf6b1fe950285e03d492925f 100644 (file)
@@ -354,7 +354,7 @@ glXCreateContext(Display * dpy, XVisualInfo * vis,
                  GLXContext shareList, Bool allowDirect)
 {
    struct glx_config *config = NULL;
-   int renderType = 0;
+   int renderType = GLX_RGBA_TYPE;
 
 #if defined(GLX_DIRECT_RENDERING) || defined(GLX_USE_APPLEGL)
    struct glx_screen *const psc = GetGLXScreenConfigs(dpy, vis->screen);
@@ -1441,7 +1441,7 @@ glXImportContextEXT(Display *dpy, GLXContextID contextID)
    numProps = nPropListBytes / (2 * sizeof(propList[0]));
    share = None;
    mode = NULL;
-   renderType = 0;
+   renderType = GLX_RGBA_TYPE; /* By default, assume RGBA context */
    pProp = propList;
 
    for (i = 0, pProp = propList; i < numProps; i++, pProp += 2)