summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/glthread.c
Commit message (Collapse)AuthorAgeFilesLines
* mesa/glthread: Avoid unnecessary batch reallocationBartosz Tomczyk2017-04-041-6/+9
| | | | Reviewed-by: Timothy Arceri <[email protected]>
* mesa/glthread: Call unmarshal_batch directly in glthread_finishBartosz Tomczyk2017-04-031-12/+32
| | | | | | | | Call it directly when batch queue is empty. This avoids costly thread synchronisation. This commit improves performance of games that have previously regressed with mesa_glthread=true. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: set thread name for glthreadMiklós Máté2017-03-241-0/+3
| | | | | Signed-off-by: Miklós Máté <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa/glthread: restore the dispatch table when incompatible gl calls are ↵Gregory Hainaut2017-03-161-0/+6
| | | | | | | | | | | | | | | | | | | detected While a context only has a single glthread, the context itself can be attached to several threads. Therefore the dispatch table must be updated in all threads before the destruction of glthread. In others words, glthread can only be destroyed safely when the context is deleted. Fixes remaining crashes in the glx-multithread-makecurrent* tests. V2: (Timothy Arceri) updated gl_API.dtd marshal_fail description. Signed-off-by: Gregory Hainaut <[email protected]> Acked-by: Timothy Arceri <[email protected]> Acked-by: Marek Olšák <[email protected]> Tested-by: Dieter Nützel <[email protected]> Tested-by: Mike Lothian <[email protected]>
* mesa/glthread: don't set a dispatch table if we aren't the ownerGregory Hainaut2017-03-161-3/+10
| | | | | | | | | | Fix crashes when glxMakeCurrent is called. Signed-off-by: Gregory Hainaut <[email protected]> Signed-off-by: Marek Olšák <[email protected]> Acked-by: Timothy Arceri <[email protected]> Tested-by: Dieter Nützel <[email protected]> Tested-by: Mike Lothian <[email protected]>
* mesa: Statically allocate glthread command buffer in the batch struct.Eric Anholt2017-03-161-3/+2
| | | | | | | | | | | This avoids an extra pointer dereference in the marshalling functions, which, with the instruction count doing in the low 30s, could actually matter for main-thread performance. Acked-by: Timothy Arceri <[email protected]> Acked-by: Marek Olšák <[email protected]> Tested-by: Dieter Nützel <[email protected]> Tested-by: Mike Lothian <[email protected]>
* mesa: Connect the generated GL command marshalling code to the build.Eric Anholt2017-03-161-0/+15
| | | | | | | | | | | | v2: Rebase on the Begin/End changes, and just disable this feature on non-GL-core. v3: (Timothy Arceri) enable for non-GL-core contexts. Remove unrelated safe_mul() hunk. while loop style fix. Acked-by: Timothy Arceri <[email protected]> Acked-by: Marek Olšák <[email protected]> Tested-by: Dieter Nützel <[email protected]> Tested-by: Mike Lothian <[email protected]>
* mesa: Create pointers for multithread marshalling dispatch table.Paul Berry2017-03-161-0/+7
| | | | | | | | | | | | | | This patch splits the context's CurrentDispatch pointer into two pointers, CurrentClientDispatch, and CurrentServerDispatch, so that when doing multithread marshalling, we can distinguish between the dispatch table that's being used by the client (to serialize GL calls into the marshal buffer) and the dispatch table that's being used by the server (to execute the GL calls). Acked-by: Timothy Arceri <[email protected]> Acked-by: Marek Olšák <[email protected]> Tested-by: Dieter Nützel <[email protected]> Tested-by: Mike Lothian <[email protected]>
* mesa: Add infrastructure for a worker thread to process GL commands.Eric Anholt2017-03-161-0/+228
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. V5: (Timothy Arceri) fix order of source files in makefile Acked-by: Timothy Arceri <[email protected]> Acked-by: Marek Olšák <[email protected]> Tested-by: Dieter Nützel <[email protected]> Tested-by: Mike Lothian <[email protected]>