[Mesa-dev] [PATCH 0/2] Make a llvmpipe context basically thread safe.

Jose Fonseca jfonseca at vmware.com
Thu Jul 17 08:01:50 PDT 2014

Hi Mathias,

Thanks for doing this.

Patch 2 looks great.

For patch 1 I'd prefer that instead of keeping a global list of 
contexts, these are passed by the caller as argument to gallivm_create() 
.  It will be a more invasive change, but it will be cleaner.  And in 
particular it will garantee that when llvmpipe contexts are destroyed 
there will be no lingering llvm contexts neither.


On 13/07/14 17:13, Mathias Fröhlich wrote:
> Hi Jose,
> This makes llvmpipe thread safe as mandated by the OpenGL standard.
> The changes replace the use of two global data structures with
> non global ones.
> The changes pass piglit as of today without regressions.
> The patchset deviates form your last suggestion. But lacking sufficient time
> I just went ahead and implemented something that fixes this problem
> preserving hopefully enough of the memory savings the shared
> ShaderMemoryManager initially provided. The more extended solution
> with a single jit memory manager per GL context could be implemented
> on top of this change.
> Please review!
> Mathias
> Mathias Fröhlich (2):
>    llvmpipe: Pool the LLVMContexts in use.
>    llvmpipe: Make a llvmpipe OpenGL context thread safe.
>   src/gallium/auxiliary/gallivm/lp_bld_init.c   | 87 ++++++++++++++++++++++++---
>   src/gallium/auxiliary/gallivm/lp_bld_init.h   |  1 +
>   src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 38 ++++++------
>   src/gallium/auxiliary/gallivm/lp_bld_misc.h   |  3 +
>   4 files changed, 100 insertions(+), 29 deletions(-)

More information about the mesa-dev mailing list