[Mesa-dev] [PATCH 11/26] mesa: Add infrastructure for a worker thread to process GL commands.

Emil Velikov emil.l.velikov at gmail.com
Fri Feb 10 17:08:52 UTC 2017


On 8 February 2017 at 18:03, Marek Olšák <maraeo at gmail.com> wrote:
> From: Eric Anholt <eric at anholt.net>
>
> v2: Keep an allocated buffer around instead of checking for one at the
>     start of every GL command.  Inline the now-small space allocation
>     function.
> v3: Remove duplicate !glthread->shutdown check, process remaining work
>     before shutdown.
> v4: Fix leaks on destroy.
> ---
>  src/mesa/Makefile.sources |   1 +
>  src/mesa/main/context.c   |   3 +
>  src/mesa/main/glthread.c  | 228 ++++++++++++++++++++++++++++++++++++++++++++++
>  src/mesa/main/glthread.h  | 130 ++++++++++++++++++++++++++
>  src/mesa/main/marshal.h   | 112 +++++++++++++++++++++++
>  src/mesa/main/mtypes.h    |   2 +
>  6 files changed, 476 insertions(+)
>  create mode 100644 src/mesa/main/glthread.c
>  create mode 100644 src/mesa/main/glthread.h
>  create mode 100644 src/mesa/main/marshal.h
>
> diff --git a/src/mesa/Makefile.sources b/src/mesa/Makefile.sources
> index ee737b0..87d675d 100644
> --- a/src/mesa/Makefile.sources
> +++ b/src/mesa/Makefile.sources
> @@ -109,20 +109,21 @@ MAIN_FILES = \
>         main/framebuffer.h \
>         main/get.c \
>         main/get.h \
>         main/get_hash.h \
>         main/genmipmap.c \
>         main/genmipmap.h \
>         main/getstring.c \
>         main/glformats.c \
>         main/glformats.h \
>         main/glheader.h \
> +       main/glthread.c \
Please add the two headers, alphabetically.
The code uses pthreads directly and very nicely stubs when they're missing.

Mildly related:
One of these days I'll need to finalise the pthread{,-stubs} topic and
update Mesa to consistently use the c11 wrappers.

-Emil


More information about the mesa-dev mailing list