[PATCH 08/11] glx: Initialize remaining context fields

Jesse Barnes jbarnes at virtuousgeek.org
Tue Jan 3 16:26:38 PST 2012


On Fri, 23 Dec 2011 15:18:26 -0800
"Ian Romanick" <idr at freedesktop.org> wrote:

> From: Ian Romanick <ian.d.romanick at intel.com>
> 
> There is no reason to assume the screen's context allocated
> initialized these fields, so don't.
> 
> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
> ---
>  glx/glxcmds.c |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/glx/glxcmds.c b/glx/glxcmds.c
> index 8a32a22..983f21a 100644
> --- a/glx/glxcmds.c
> +++ b/glx/glxcmds.c
> @@ -296,7 +296,14 @@ DoCreateContext(__GLXclientState *cl, GLXContextID gcId,
>      glxc->idExists = GL_TRUE;
>      glxc->isCurrent = GL_FALSE;
>      glxc->isDirect = isDirect;
> +    glxc->hasUnflushedCommands = GL_FALSE;
>      glxc->renderMode = GL_RENDER;
> +    glxc->feedbackBuf = NULL;
> +    glxc->feedbackBufSize = 0;
> +    glxc->selectBuf = NULL;
> +    glxc->selectBufSize = 0;
> +    glxc->drawPriv = NULL;
> +    glxc->readPriv = NULL;
>  
>      /*
>      ** Register this context as a resource.

I guess we were assuming the screen callback did this by zeroing out
the new allocation?  At any rate, making things explicit is ok.  You
might add a comment describing the expectations though.  Other than
that:

Reviewed-by: Jesse Barnes <jbarnes at virtuousgeek.org>

-- 
Jesse Barnes, Intel Open Source Technology Center


More information about the xorg-devel mailing list