[Mesa-dev] [PATCH 1/8] Support of RENDER_TYPE property [1/6] Correct handling of RENDER_TYPE property.

Tomasz Lis listom at gmail.com
Mon Jul 15 07:28:32 PDT 2013


The change is to correctly handle the value of renderType in both
fbconfig and context. Uses of renderType are commented, where needed,
to avoid confusion between the two types. The fact that float configs
can be only used for pbuffers is correctly addressed.
---
 src/glx/dri2_glx.c  |    7 +++++++
 src/glx/dri_glx.c   |    2 ++
 src/glx/drisw_glx.c |    5 +++++
 src/glx/glxcmds.c   |    4 ++--
 4 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
index 7ce5775..630dbd9 100644
--- a/src/glx/dri2_glx.c
+++ b/src/glx/dri2_glx.c
@@ -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);
@@ -311,6 +313,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,
diff --git a/src/glx/dri_glx.c b/src/glx/dri_glx.c
index ba8fda2..cc45734 100644
--- a/src/glx/dri_glx.c
+++ b/src/glx/dri_glx.c
@@ -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)) {
diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c
index 832e964..80ddf9c 100644
--- a/src/glx/drisw_glx.c
+++ b/src/glx/drisw_glx.c
@@ -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,
diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c
index 019165a..51b2237 100644
--- a/src/glx/glxcmds.c
+++ b/src/glx/glxcmds.c
@@ -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)
-- 
1.7.9.5



More information about the mesa-dev mailing list