Re: [Mesa-dev] [PATCH 0/7] dma-buf: Add an API for exporting sync files (v11)

2021-06-10 Thread Chia-I Wu
On Tue, May 25, 2021 at 2:18 PM Jason Ekstrand wrote: > Modern userspace APIs like Vulkan are built on an explicit > synchronization model. This doesn't always play nicely with the > implicit synchronization used in the kernel and assumed by X11 and > Wayland. The client -> compositor half of th

Re: [Mesa-dev] Merging virtio-gpu vulkan driver

2021-04-05 Thread Chia-I Wu
On Mon, Apr 5, 2021 at 11:12 AM Dave Airlie wrote: > > On Tue, 6 Apr 2021 at 03:22, Chia-I Wu wrote: > > > > Hi list, > > > > We are looking to merge virtio-gpu vulkan driver > > > > https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/58

[Mesa-dev] Merging virtio-gpu vulkan driver

2021-04-05 Thread Chia-I Wu
Hi list, We are looking to merge virtio-gpu vulkan driver https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5800 On the good side, the driver is conformant with Vulkan 1.2 (vtest) and Vulkan 1.1 (virtio-gpu). I only tried it on a handful of games (e.g., Dota 2, Hades on Proton with D3

Re: [Mesa-dev] Perfetto CPU/GPU tracing

2021-02-12 Thread Chia-I Wu
For virgl, where the biggest perf gaps often come from unnecessary CPU waits or high latencies of fence signaling, being able to insert userspace driver trace events and combine them with kernel ftrace events are a big plus. Admittedly, there is no HW counters and my needs are simpler (inserting f

Re: [Mesa-dev] Static thread safety checking with clang

2020-11-10 Thread Chia-I Wu
On Tue, Nov 10, 2020 at 8:09 AM Kristian Høgsberg wrote: > > Hi, > > I wanted to call attention to > > https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7529 > > which shows how we can use a new clang __attribute__ to statically > check locking invariants. It's probably not perfect, but

Re: [Mesa-dev] [PATCH v3] egl/android: Update color_buffers querying for buffer age

2019-07-19 Thread Chia-I Wu
rtial_update. > > v2: update comment instead of removing (Eric Engestrom) > v3: change static array to dynamic allocated color_buffers > querying MIN_UNDEQUEUED_BUFFERS (Chia-I Wu o...@chromium.org) > > Fixes: 2acc69da8ce "EGL/Android: Add EGL_EXT_buffer_age extension"

Re: [Mesa-dev] [PATCH] virgl: Set meta data for textures from handle.

2019-07-17 Thread Chia-I Wu
On Wed, Jul 17, 2019 at 3:59 PM Lepton Wu wrote: > > OK, actually struct winsys_handle is an obscure structure for virgl > driver so we can't access whandle->stride here... > So maybe just leave this CL as it is? That is fair. R-b'ed and pushed. > > On Wed, Ju

Re: [Mesa-dev] [PATCH] virgl: Set meta data for textures from handle.

2019-07-17 Thread Chia-I Wu
t to handle the unexpected stride. Not that I believe that is going to happen, but still... > > On Wed, Jul 17, 2019 at 12:25 PM Chia-I Wu wrote: > > > > On Wed, Jul 17, 2019 at 11:44 AM Lepton Wu wrote: > > > > > > On Wed, Jul 17, 2019 at 11:26 AM Chia-I Wu w

Re: [Mesa-dev] [PATCH] virgl: Set meta data for textures from handle.

2019-07-17 Thread Chia-I Wu
On Wed, Jul 17, 2019 at 11:44 AM Lepton Wu wrote: > > On Wed, Jul 17, 2019 at 11:26 AM Chia-I Wu wrote: > > > > On Wed, Jul 17, 2019 at 10:14 AM Erik Faye-Lund > > wrote: > > > > > > On Wed, 2019-07-17 at 10:02 -0700, Lepton Wu wrote: > > > &

Re: [Mesa-dev] [PATCH] virgl: Set meta data for textures from handle.

2019-07-17 Thread Chia-I Wu
On Wed, Jul 17, 2019 at 10:14 AM Erik Faye-Lund wrote: > > On Wed, 2019-07-17 at 10:02 -0700, Lepton Wu wrote: > > The set of meta data was removed by commit 8083464. It broke lots of > > dEQP tests when running with pbuffer surface type. > > > > Fixes: 80834640137 ("virgl: remove dead code") > >

Re: [Mesa-dev] [PATCH] turnip: drop dead close(master_fd)

2019-04-19 Thread Chia-I Wu
On Fri, Apr 19, 2019 at 8:01 AM Emil Velikov wrote: > > From: Emil Velikov > > The fd is -1, thus the block of if (fd != -1) close(fd) is dead code. > > Cc: Chad Versace > Cc: Chia-I Wu > Signed-off-by: Emil Velikov Reviewed-by: Chia-I Wu > --- > src/freedreno/

Re: [Mesa-dev] [PATCH v2] virgl: Use right key to insert resource to hash.

2019-04-08 Thread Chia-I Wu
On Mon, Apr 8, 2019 at 11:24 AM Lepton Wu wrote: > On Mon, Apr 8, 2019 at 11:10 AM Chia-I Wu wrote: > > > > > > > > On Mon, Apr 8, 2019 at 9:34 AM Lepton Wu wrote: > >> > >> The old code could use gem name as key when inserting it to bo_handles &

Re: [Mesa-dev] [PATCH] virgl: Use right key to insert resource to hash.

2019-04-08 Thread Chia-I Wu
On Wed, Apr 3, 2019 at 8:17 PM Dave Airlie wrote: > On Thu, 4 Apr 2019 at 06:54, Chia-I Wu wrote: > > > > You could end up having two virgl_hw_res with two different GEM handles > pointing to the same kernel GEM object. That might break some assumptions > about dependency

Re: [Mesa-dev] [PATCH v2] virgl: Use right key to insert resource to hash.

2019-04-08 Thread Chia-I Wu
On Mon, Apr 8, 2019 at 9:34 AM Lepton Wu wrote: > The old code could use gem name as key when inserting it to bo_handles > hash table while trying to remove it from hash table with bo_handle as > key in virgl_hw_res_destroy and then it fail to remove it from bo_handles > hash table. This triggers

Re: [Mesa-dev] [PATCH] virgl: Use right key to insert resource to hash.

2019-04-03 Thread Chia-I Wu
normally need to submit the cmdbuf first before starting the transfer. The current code detects that with virgl_drm_res_is_ref, which assumes each kernel GEM object has a unique virgl_hw_res. On Mon, Apr 1, 2019 at 12:37 PM Lepton Wu wrote: > > > > On Wed, Mar 20, 2019 at 3:03 PM Chia

Re: [Mesa-dev] [PATCH] virgl: Use right key to insert resource to hash.

2019-03-20 Thread Chia-I Wu
On Mon, Mar 18, 2019 at 2:22 PM Lepton Wu wrote: > The old code could use gem name as key when inserting it to bo_handles > hash table while trying to remove it from hash table with bo_handle as > key in virgl_hw_res_destroy. This triggers use after free. Also, we > should only reuse resource fro

Re: [Mesa-dev] [PATCH] virgl: close drm fd when destroying virgl screen.

2019-03-20 Thread Chia-I Wu
Reviewed-by: Chia-I Wu On Mon, Mar 18, 2019 at 4:40 PM Lepton Wu wrote: > This fd was create in virgl_drm_screen_create and should be closed > in virgl_drm_screen_destroy. > > Signed-off-by: Lepton Wu > --- > src/gallium/winsys/virgl/drm/virgl_drm_winsys.c | 1 + &g

[Mesa-dev] [PATCH] freedreno/drm: sync uapi again

2019-01-07 Thread Chia-I Wu
"pad" was missing in Mesa's msm_drm.h. sizeof(drm_msm_gem_info) remains the same, but now the compiler initializes the field to zero. Buffer allocation results in EINVAL without this for me. Cc: Rob Clark Cc: Kristian Høgsberg Signed-off-by: Chia-I Wu --- src/freedreno/dr

[Mesa-dev] [PATCH] meson: fix EGL/X11 build without GLX

2019-01-07 Thread Chia-I Wu
dep_xcb and others were not set under this configuration. Signed-off-by: Chia-I Wu --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 709f77a9c7..601085e055 100644 --- a/meson.build +++ b/meson.build @@ -1361,7 +1361,7 @@ if

Re: [Mesa-dev] [PATCH 1/3] ilo: EOL unplumb unmaintained gallium drv from winsys

2017-02-02 Thread Chia-I Wu
All three are Acked-by:Chia-I Wu On Thu, Feb 2, 2017 at 12:15 AM, Edward O'Callaghan wrote: > This is no longer actively maintained and is just > accumulating bitrot. > > Signed-off-by: Edward O'Callaghan > --- > .../auxiliary/pipe-loader/pipe_loader_drm.c| 5 --- > src/gallium/auxil

Re: [Mesa-dev] Potentially EOL ilo gallium driver

2016-12-07 Thread Chia-I Wu
; This patch is to potentially remove ourself from the maintaince >>>>>>>>> burden of the ilo driver that appears to now be essentially >>>>>>>>> unmaintained? >>>>>>>>> >>>>>>>>> I am not sure of our policy

Re: [Mesa-dev] [PATCH 1/3] ilo: add PIPE_QUERY_OCCLUSION_PREDICATE support

2016-02-04 Thread Chia-I Wu
On Fri, Feb 5, 2016 at 2:36 AM, Ilia Mirkin wrote: > [+Chia-I Wu] > > I'd appreciate it if you could have a look and see if this looks > reasonable. Not sure if you're still maintaining the driver or not. > The story is that I want to use this query type for GL_ANY_SAMPL

Re: [Mesa-dev] [PATCH 3/4] ilo: unref old fence

2015-07-09 Thread Chia-I Wu
On Thu, Jul 9, 2015 at 8:46 AM, Rob Clark wrote: > From: Rob Clark > > Some, but not all, state trackers will explicitly unref (and set to > NULL) the previous *fence before calling pipe->flush(). So driver > should use fence_ref() which will unref the old fence if not NULL. Looks good. Thanks.

Re: [Mesa-dev] [PATCH 01/18] winsys/radeon: move radeon_winsys.h up one directory

2015-04-27 Thread Chia-I Wu
On Tue, Apr 28, 2015 at 2:19 PM, Emil Velikov wrote: > On 28 April 2015 at 03:30, Michel Dänzer wrote: >> On 28.04.2015 03:57, Marek Olšák wrote: >>> Can you elaborate on what amdgpu/sw would be good for? Frankly I don't >>> see a point, therefore we don't need the "drm" subdirectory. >> >> I thi

Re: [Mesa-dev] [PATCH 0/2] Disable the EGL state tracker for Linux/DRI builds

2014-11-05 Thread Chia-I Wu
On Wed, Nov 5, 2014 at 6:42 AM, Marek Olšák wrote: > Hi everybody, > > I'm about to address this long-standing issue: The EGL state tracker is > redundant. It duplicates what st/dri does and it also duplicates what > the common loader egl_dri2 does, which is used by all classic drivers > and even

Re: [Mesa-dev] [PATCH 0/2] Disable the EGL state tracker for Linux/DRI builds

2014-11-05 Thread Chia-I Wu
On Thu, Nov 6, 2014 at 5:11 AM, Jose Fonseca wrote: >> How many people/companies use EGL for Windows/fbdev, how about OpenVG on > any platform ? > > I already said this privately to Marek when he was RFC'ing on this change: > I'm fine if Linux-specific drivers abandon st/egl to focus solely on st

Re: [Mesa-dev] [PATCH 01/27] winsys/intel: drop intel_winsys.h from makefile.sources

2014-08-29 Thread Chia-I Wu
. Thanks. > > Cc: Chia-I Wu > Signed-off-by: Emil Velikov > --- > src/gallium/winsys/intel/drm/Makefile.sources | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/src/gallium/winsys/intel/drm/Makefile.sources > b/src/gallium/winsys/intel/drm/Makef

Re: [Mesa-dev] [PATCHv3 05/16] util: add a generic thread pool data structure

2014-08-20 Thread Chia-I Wu
On Thu, Aug 21, 2014 at 9:31 AM, Matt Turner wrote: > On Tue, Aug 19, 2014 at 11:40 PM, Chia-I Wu wrote: >> It can be used to implement, for example, threaded glCompileShader and >> glLinkProgram. Two basic tests are included to verify the basic functions, >> and to gi

Re: [Mesa-dev] [PATCHv3 11/16] mesa: add infrastructure for threaded shader compilation

2014-08-20 Thread Chia-I Wu
On Thu, Aug 21, 2014 at 12:40 AM, Fredrik Höglund wrote: > On Wednesday 20 August 2014, Chia-I Wu wrote: >> Add _mesa_enable_glsl_threadpool to enable the thread pool for a context, and >> add ctx->Const.DeferCompileShader and ctx->Const.DeferLinkProgram to >> fine

[Mesa-dev] [PATCHv3 00/16] multithread shader compiler

2014-08-19 Thread Chia-I Wu
Hi, This is v3 of the series. It should have all the changes I promised to fix. There are some new or splitted patches because _mesa_strtof, simple_list, and thread pool are now moved to src/util/. To summarize, Patch 1-3 merge mesa and glsl strtof wrappers and moves them to src/util/. They go

[Mesa-dev] [PATCHv3 06/16] util: allow the thread pool to be used as a singleton

2014-08-19 Thread Chia-I Wu
To have a real control over the number of driver threads, we almost never want more than a single thread pool. Signed-off-by: Chia-I Wu Reviewed-by: Brian Paul Reviewed-by: Ian Romanick v2: split glsl changes to another commit --- src/util/threadpool.c | 72

[Mesa-dev] [PATCHv3 13/16] i965: refactor do_vs_prog

2014-08-19 Thread Chia-I Wu
Split do_vs_prog into brw_vs_init_compile brw_vs_do_compile brw_vs_upload_compile brw_vs_clear_complile Signed-off-by: Chia-I Wu Acked-by: Ian Romanick --- src/mesa/drivers/dri/i965/brw_vec4.h | 6 ++ src/mesa/drivers/dri/i965/brw_vs.c | 121

[Mesa-dev] [PATCHv3 04/16] util: move simple_list.h from core to util

2014-08-19 Thread Chia-I Wu
It belongs to util, and we will need it from within util. Signed-off-by: Chia-I Wu --- src/mesa/drivers/dri/i915/i830_texblend.c | 2 +- src/mesa/drivers/dri/i915/intel_syncobj.c | 2 +- src/mesa/drivers/dri/r200/r200_cmdbuf.c| 2 +- src/mesa/drivers/dri/r200

[Mesa-dev] [PATCHv3 12/16] i965: add drirc option multithread_glsl_compiler

2014-08-19 Thread Chia-I Wu
Setting it to a non-zero value N will cause shader compilation to be deferred to a thread pool. When N is greater than 1, it indicates the maximum number of threads in the pool. When N is 1, the number of threads is up to the driver (two for i965). Signed-off-by: Chia-I Wu Reviewed-by: Ian

[Mesa-dev] [PATCHv3 14/16] i965: refactor do_gs_prog

2014-08-19 Thread Chia-I Wu
Split do_gs_prog into brw_gs_init_compile brw_gs_do_compile brw_gs_upload_compile brw_gs_clear_complile Signed-off-by: Chia-I Wu Acked-by: Ian Romanick --- src/mesa/drivers/dri/i965/brw_vec4_gs.c | 161 1 file changed, 102 insertions(+), 59 deletions

[Mesa-dev] [PATCHv3 15/16] i965: refactor do_wm_prog

2014-08-19 Thread Chia-I Wu
Split do_wm_prog into brw_wm_init_compile brw_wm_do_compile brw_wm_upload_compile brw_wm_clear_complile Add struct brw_wm_compile to be passed around them. Signed-off-by: Chia-I Wu Acked-by: Ian Romanick --- src/mesa/drivers/dri/i965/brw_wm.c | 116

[Mesa-dev] [PATCHv3 09/16] glsl: integrate with the singleton thread pool

2014-08-19 Thread Chia-I Wu
The singleton thread pool will be used by contexts to queue compilation tasks. We need to control its lieftime from the compiler. Signed-off-by: Chia-I Wu --- src/glsl/glsl_parser_extras.cpp | 4 1 file changed, 4 insertions(+) diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl

[Mesa-dev] [PATCHv3 01/16] util: add _mesa_strtod and _mesa_strtof

2014-08-19 Thread Chia-I Wu
Both core mesa and glsl have their own wrappers for strtof_l. Merge and move them to util/. They are compiled with a C++ compiler so that we can make them thread-safe in a following commit. Signed-off-by: Chia-I Wu --- src/glsl/Makefile.sources| 3 +- src/glsl/glsl_lexer.ll

[Mesa-dev] [PATCHv3 16/16] i965: enable threaded precompile

2014-08-19 Thread Chia-I Wu
. brw_shader_program_precompile_key is introduced and initialized in NofityLinkShader for we cannot inspect the context during precompiling. Signed-off-by: Chia-I Wu Acked-by: Ian Romanick --- src/mesa/drivers/dri/i965/brw_context.c | 4 +- src/mesa/drivers/dri/i965/brw_fs.cpp | 33

[Mesa-dev] [PATCHv3 08/16] glsl: protect glsl_type with a mutex

2014-08-19 Thread Chia-I Wu
glsl_type has several static hash tables and a static ralloc context. They need to be protected by a mutex as they are not thread-safe. Signed-off-by: Chia-I Wu Reviewed-by: Brian Paul Reviewed-by: Ian Romanick --- src/glsl/glsl_types.cpp | 57

[Mesa-dev] [PATCHv3 11/16] mesa: add infrastructure for threaded shader compilation

2014-08-19 Thread Chia-I Wu
er into two parts: the first part links and error checks while the second part optimizes and generates the machine code. With the split, we can always defer the second part to the thread pool. Signed-off-by: Chia-I Wu Reviewed-by: Brian Paul Reviewed-by: Ian Romanick v2: - replace "vo

[Mesa-dev] [PATCHv3 05/16] util: add a generic thread pool data structure

2014-08-19 Thread Chia-I Wu
It can be used to implement, for example, threaded glCompileShader and glLinkProgram. Two basic tests are included to verify the basic functions, and to give us some confidence about its thread-safety. v2: allow tasks to "complete" other tasks Signed-off-by: Chia-I Wu Reviewed-by:

[Mesa-dev] [PATCHv3 02/16] configure: check for xlocale.h and strtof

2014-08-19 Thread Chia-I Wu
With the assumptions that xlocale.h implies newlocale and strtof_l. SCons is updated to define HAVE_XLOCALE_H on linux and darwin. Signed-off-by: Chia-I Wu --- configure.ac| 3 +++ scons/gallium.py| 4 src/util/strtod.cpp | 12 3 files changed, 11 insertions

[Mesa-dev] [PATCHv3 10/16] mesa: protect the debug state with a mutex

2014-08-19 Thread Chia-I Wu
We are about to change mesa to spawn threads for deferred glCompileShader and glLinkProgram, and we need to make sure those threads can send compiler warnings/errors to the debug output safely. Signed-off-by: Chia-I Wu Reviewed-by: Brian Paul Reviewed-by: Ian Romanick --- src/mesa/main

[Mesa-dev] [PATCHv3 03/16] util: initialize locale_t with a static object

2014-08-19 Thread Chia-I Wu
_mesa_strtod and _mesa_strtof may be called from multiple threads. They need to be thread-safe. Signed-off-by: Chia-I Wu Reviewed-by: Brian Paul Reviewed-by: Ian Romanick v2: platform checks are now done in configure.ac --- src/util/strtod.cpp | 18 -- 1 file changed, 8

[Mesa-dev] [PATCHv3 07/16] glsl: protect anonymous struct id with a mutex

2014-08-19 Thread Chia-I Wu
There may be two contexts compiling shaders at the same time, and we want the anonymous struct id to be globally unique. Signed-off-by: Chia-I Wu Reviewed-by: Brian Paul Reviewed-by: Ian Romanick --- src/glsl/glsl_parser_extras.cpp | 10 -- 1 file changed, 8 insertions(+), 2 deletions

Re: [Mesa-dev] [PATCHv2 01/22] gallium/ilo: cleanup intel_winsys.h

2014-08-19 Thread Chia-I Wu
header. > - Cleanup the compiler includes. > > v2: Move the header to drivers/ilo. Suggested by Chia-I. > > Cc: Chia-I Wu > Signed-off-by: Emil Velikov > --- > > The patch is generated with -M, and likely won't apply as is. > It makes it alot easier to read t

Re: [Mesa-dev] [PATCH] ilo: fold drm_intel_get_aperture_sizes() within probe_winsys()

2014-08-19 Thread Chia-I Wu
; Suggested-by: Chia-I Wu > Signed-off-by: Emil Velikov > --- > > Hello Chia-I > > Hope I've understood you correctly this time :) > -Emil > > src/gallium/drivers/ilo/ilo_common.h| 1 + > src/gallium/drivers/ilo/ilo_screen.c| 4 ++-- &

Re: [Mesa-dev] [PATCH 01/22] gallium/ilo: cleanup intel_winsys.h

2014-08-19 Thread Chia-I Wu
On Tue, Aug 19, 2014 at 4:26 PM, Emil Velikov wrote: > On 19/08/14 09:07, Chia-I Wu wrote: >> On Tue, Aug 19, 2014 at 7:20 AM, Emil Velikov >> wrote: >>> Make the header location, inclusion and contents more common with >>> its i915,r* and nouveau counterparts:

Re: [Mesa-dev] [PATCH 13/19] gallium/ilo: handle query_renderer caps

2014-08-19 Thread Chia-I Wu
e to the winsys. Please call drm_intel_get_aperture_sizes() in probe_winsys() and report the values in bytes in struct intel_winsys_info. There is no need to export the function. > > Cc: Chia-I Wu > Signed-off-by: Emil Velikov > --- > src/gallium/drivers/i915/i915_screen.c

Re: [Mesa-dev] [PATCH 01/22] gallium/ilo: cleanup intel_winsys.h

2014-08-19 Thread Chia-I Wu
header. > - Cleanup the compiler includes. The latter two sound fine to me, but do you have a real need to move intel_winsys.h into drm/? It is supposed to be OS-neutral so that the pipe driver stays OS-neutral, not being tied to DRM. > > Cc: Chia-I Wu > Signed-off-by: Emil Velikov

Re: [Mesa-dev] [PATCHv2 01/13] mesa: protect the debug state with a mutex

2014-08-19 Thread Chia-I Wu
When do you plan to branch off 10.3? I should be able to send out v3 late evening Tuesday, and be responsive. > > On 07/09/2014 12:47 AM, Chia-I Wu wrote: >> We are about to change mesa to spawn threads for deferred glCompileShader and >> glLinkProgram, and we need to make sure t

Re: [Mesa-dev] [PATCHv2 06/13] glsl: add a generic thread pool data structure

2014-08-19 Thread Chia-I Wu
On Thu, Aug 14, 2014 at 8:38 AM, Ian Romanick wrote: > On 07/09/2014 12:47 AM, Chia-I Wu wrote: >> It can be used to implement, for example, threaded glCompileShader and >> glLinkProgram. >> >> v2: allow tasks to "complete" other tasks >> >&

Re: [Mesa-dev] [PATCHv2 13/13] i965: enable threaded precompile

2014-08-19 Thread Chia-I Wu
On Thu, Aug 14, 2014 at 4:44 AM, Ian Romanick wrote: > On 07/09/2014 12:47 AM, Chia-I Wu wrote: >> Inherit gl_shader_program and add save/restore functions to save precompile >> results in the shader programs. When DeferLinkProgram is set, we will save >> the precompi

Re: [Mesa-dev] [PATCHv2 08/13] mesa: add infrastructure for threaded shader compilation

2014-08-19 Thread Chia-I Wu
On Thu, Aug 14, 2014 at 4:41 AM, Ian Romanick wrote: > On 07/09/2014 12:47 AM, Chia-I Wu wrote: >> @@ -3489,6 +3508,18 @@ struct gl_constants >> GLfloat MaxFragmentInterpolationOffset; >> >> GLboolean FakeSWMSAA; >> + >> + /* >> +

Re: [Mesa-dev] [PATCHv2 08/13] mesa: add infrastructure for threaded shader compilation

2014-08-19 Thread Chia-I Wu
On Thu, Aug 14, 2014 at 4:35 AM, Ian Romanick wrote: > On 07/09/2014 12:47 AM, Chia-I Wu wrote: >> Add _mesa_enable_glsl_threadpool to enable the thread pool for a context, and >> add ctx->Const.DeferCompileShader and ctx->Const.DeferLinkProgram to >> fine

Re: [Mesa-dev] [PATCHv2 04/13] glsl: protect anonymous struct id with a mutex

2014-08-19 Thread Chia-I Wu
On Thu, Aug 14, 2014 at 3:03 AM, Ian Romanick wrote: > On 07/09/2014 12:47 AM, Chia-I Wu wrote: >> There may be two contexts compiling shaders at the same time, and we want the >> anonymous struct id to be globally unique. >> >> Signed-off-by: Chia-I Wu >> --- &g

Re: [Mesa-dev] [PATCHv2 03/13] glsl: initialize locale_t with a static object

2014-08-19 Thread Chia-I Wu
On Thu, Aug 14, 2014 at 3:00 AM, Ian Romanick wrote: > On 07/09/2014 12:47 AM, Chia-I Wu wrote: >> The compiler may be used by multiple contexts simultaneously and needs to be >> thread-safe. >> >> Signed-off-by: Chia-I Wu >> --- >> src/glsl/strtod.cpp |

Re: [Mesa-dev] [PATCHv2 08/13] mesa: add infrastructure for threaded shader compilation

2014-07-09 Thread Chia-I Wu
On Wed, Jul 9, 2014 at 10:42 PM, Brian Paul wrote: > On 07/09/2014 01:47 AM, Chia-I Wu wrote: >> >> Add _mesa_enable_glsl_threadpool to enable the thread pool for a context, >> and >> add ctx->Const.DeferCompileShader and ctx->Const.DeferLinkProgram to &

Re: [Mesa-dev] [PATCHv2 06/13] glsl: add a generic thread pool data structure

2014-07-09 Thread Chia-I Wu
On Wed, Jul 9, 2014 at 10:42 PM, Brian Paul wrote: > On 07/09/2014 01:47 AM, Chia-I Wu wrote: >> >> It can be used to implement, for example, threaded glCompileShader and >> glLinkProgram. >> >> v2: allow tasks to "complete" other tasks >>

[Mesa-dev] [PATCHv2 05/13] glsl: protect glsl_type with a mutex

2014-07-09 Thread Chia-I Wu
glsl_type has several static hash tables and a static ralloc context. They need to be protected by a mutex as they are not thread-safe. Signed-off-by: Chia-I Wu --- src/glsl/glsl_types.cpp | 57 +++-- src/glsl/glsl_types.h | 15 + 2

[Mesa-dev] [PATCHv2 09/13] i965: add drirc option multithread_glsl_compiler

2014-07-09 Thread Chia-I Wu
Setting it to a non-zero value N will cause shader compilation to be deferred to a thread pool. When N is greater than 1, it indicates the maximum number of threads in the pool. When N is 1, the number of threads is up to the driver (two for i965). Signed-off-by: Chia-I Wu --- src/mesa

[Mesa-dev] [PATCHv2 12/13] i965: refactor do_wm_prog

2014-07-09 Thread Chia-I Wu
Split do_wm_prog into brw_wm_init_compile brw_wm_do_compile brw_wm_upload_compile brw_wm_clear_complile Add struct brw_wm_compile to be passed around them. Signed-off-by: Chia-I Wu --- src/mesa/drivers/dri/i965/brw_wm.c | 119 - src/mesa/drivers/dri

[Mesa-dev] [PATCHv2 04/13] glsl: protect anonymous struct id with a mutex

2014-07-09 Thread Chia-I Wu
There may be two contexts compiling shaders at the same time, and we want the anonymous struct id to be globally unique. Signed-off-by: Chia-I Wu --- src/glsl/glsl_parser_extras.cpp | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/glsl/glsl_parser_extras.cpp b

[Mesa-dev] [PATCHv2 13/13] i965: enable threaded precompile

2014-07-09 Thread Chia-I Wu
. brw_shader_program_precompile_key is introduced and initialized in NofityLinkShader for we cannot inspect the context during precompiling. Signed-off-by: Chia-I Wu --- src/mesa/drivers/dri/i965/brw_context.c | 4 +- src/mesa/drivers/dri/i965/brw_fs.cpp | 33 -- src/mesa/drivers/dri

[Mesa-dev] [PATCHv2 03/13] glsl: initialize locale_t with a static object

2014-07-09 Thread Chia-I Wu
The compiler may be used by multiple contexts simultaneously and needs to be thread-safe. Signed-off-by: Chia-I Wu --- src/glsl/strtod.cpp | 29 +++-- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/glsl/strtod.cpp b/src/glsl/strtod.cpp index 5d4346b

[Mesa-dev] [PATCHv2 01/13] mesa: protect the debug state with a mutex

2014-07-09 Thread Chia-I Wu
We are about to change mesa to spawn threads for deferred glCompileShader and glLinkProgram, and we need to make sure those threads can send compiler warnings/errors to the debug output safely. Signed-off-by: Chia-I Wu --- src/mesa/main/errors.c | 172

[Mesa-dev] [PATCHv2 02/13] glsl: rename strtod.c to strtod.cpp

2014-07-09 Thread Chia-I Wu
We want to add a static object to initialize locale_t in the following commit. Signed-off-by: Chia-I Wu --- src/glsl/Makefile.sources | 2 +- src/glsl/strtod.c | 79 --- src/glsl/strtod.cpp | 79

[Mesa-dev] [PATCHv2 11/13] i965: refactor do_gs_prog

2014-07-09 Thread Chia-I Wu
Split do_gs_prog into brw_gs_init_compile brw_gs_do_compile brw_gs_upload_compile brw_gs_clear_complile Signed-off-by: Chia-I Wu --- src/mesa/drivers/dri/i965/brw_vec4_gs.c | 153 1 file changed, 96 insertions(+), 57 deletions(-) diff --git a/src/mesa

[Mesa-dev] [PATCHv2 08/13] mesa: add infrastructure for threaded shader compilation

2014-07-09 Thread Chia-I Wu
er into two parts: the first part links and error checks while the second part optimizes and generates the machine code. With the split, we can always defer the second part to the thread pool. Signed-off-by: Chia-I Wu --- src/mesa/main/context.c | 29 +++ src/mesa/main/context.

[Mesa-dev] [PATCHv2 07/13] glsl: add a singleton GLSL thread pool

2014-07-09 Thread Chia-I Wu
This thread pool will be used by contexts to queue compilation tasks. Signed-off-by: Chia-I Wu --- src/glsl/glsl_parser_extras.cpp | 4 +++ src/glsl/threadpool.c | 72 + src/glsl/threadpool.h | 9 ++ 3 files changed, 85

[Mesa-dev] [PATCHv2 10/13] i965: refactor do_vs_prog

2014-07-09 Thread Chia-I Wu
Split do_vs_prog into brw_vs_init_compile brw_vs_do_compile brw_vs_upload_compile brw_vs_clear_complile Signed-off-by: Chia-I Wu --- src/mesa/drivers/dri/i965/brw_vec4.h | 6 ++ src/mesa/drivers/dri/i965/brw_vs.c | 117 ++- src/mesa/drivers/dri/i965

[Mesa-dev] [PATCHv2 06/13] glsl: add a generic thread pool data structure

2014-07-09 Thread Chia-I Wu
It can be used to implement, for example, threaded glCompileShader and glLinkProgram. v2: allow tasks to "complete" other tasks Signed-off-by: Chia-I Wu --- src/glsl/Makefile.am | 12 +- src/glsl/Makefile.sources | 3 +- src/glsl/tests/threadpool_test

[Mesa-dev] [PATCHv2 00/13] multithread GLSL compiler

2014-07-09 Thread Chia-I Wu
Hi list, This is my second try to add multithread support for the GLSL compiler. Changes since v1 are - glLinkProgram can now be threaded - added ctx->Const.DeferCompileShader and ctx->Const.DeferLinkProgram to allow drivers to control what get threaded - minimal changes to i965 to enable D

Re: [Mesa-dev] Static/shared pipe-drivers (was megadriver/pipe-loader-to-all)

2014-06-18 Thread Chia-I Wu
On Wed, Jun 18, 2014 at 8:14 PM, Emil Velikov wrote: > On 18 June 2014 08:21, Chia-I Wu wrote: >> Hi Emil, >> >> On Fri, Jun 13, 2014 at 3:56 AM, Emil Velikov >> wrote: >>> Hi all, >>> >>> These patches add support for building (grouping)

Re: [Mesa-dev] Static/shared pipe-drivers (was megadriver/pipe-loader-to-all)

2014-06-18 Thread Chia-I Wu
Hi Emil, On Fri, Jun 13, 2014 at 3:56 AM, Emil Velikov wrote: > Hi all, > > These patches add support for building (grouping) the various targets per > API, meaning that only one library will be created for e.g. vdpau > (libvdpau_gallium) with individual ones (libvdpau_r600) being a hardlink > t

Re: [Mesa-dev] [PATCH] egl/dri2: do not leak dri2_dpy->driver_name

2014-06-01 Thread Chia-I Wu
ring at dri2_terminate(). Sounds fine to me. But from a quick look, platform_drm gets the driver name from gbm, without strdup() on it. Does that need a similar treatment too? Maybe every platform should switch to use libloader at some point. > > v2: Use strdup over strndup. Suggested by Il

Re: [Mesa-dev] [PATCH] st/egl: do not link against libloader

2014-05-28 Thread Chia-I Wu
_for_fd' Thanks for working on this. This patch is Reviewed-by: Chia-I Wu > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79263 > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79382 > Cc: Chia-I Wu > Signed-off-by: Emil Velikov > --- > > Strange... I

Re: [Mesa-dev] [PATCH 2/2] egl-static: resolve library linking

2014-05-28 Thread Chia-I Wu
and added to egl_gallium_la_LIBADD here when HAVE_EGL_PLATFORM_DRM. The idea is that we don't usually do LIBADD for state trackers, but rely on targets to do the right thing. > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79263 > Cc: José Fonseca > Cc: Chia-I Wu > S

Re: [Mesa-dev] [PATCH 2/3] gallium/egl: st_profiles are build time decision, treat them as such

2014-05-18 Thread Chia-I Wu
On Tue, May 13, 2014 at 10:35 AM, Emil Velikov wrote: > On 13/05/14 02:57, Chia-I Wu wrote: >> On Sat, May 10, 2014 at 10:41 AM, Emil Velikov >> wrote: >>> The profiles are present depending on the defines at build time. >>> Drop the extra functions and f

Re: [Mesa-dev] [Mesa-stable] A candidate branch for the next stable release

2014-05-12 Thread Chia-I Wu
Hi Carl, On Fri, May 2, 2014 at 1:44 AM, Carl Worth wrote: > I've recently pushed an update to the 10.1 branch. I anticipate making a > release from this branch tomorrow. The state of this branch is > summarized here: > > > http://cworth.org/~cworth/mesa-stable-queue/ > > As always, pleas

Re: [Mesa-dev] [PATCH 3/3] egl-static: include libradeonwinsys.la only once

2014-05-12 Thread Chia-I Wu
On Tue, May 13, 2014 at 7:15 AM, Emil Velikov wrote: > With this and the previous patch, we no longer have multiple > definitions in the final egl_gallium.so. Looks good to me. > > Cc: Chia-I Wu > Signed-off-by: Emil Velikov > --- > src/gallium/targets/egl-st

Re: [Mesa-dev] [PATCH 2/3] gallium/egl: st_profiles are build time decision, treat them as such

2014-05-12 Thread Chia-I Wu
rent code deals with st/vega and st/mesa entirely in targets/egl-static, which is good separation IMHO, but can also be viewed as unnecessary as this patch demonstrates. > Cc: Chia-I Wu > Signed-off-by: Emil Velikov > --- > src/gallium/state_trackers/egl/Android.mk |

Re: [Mesa-dev] [PATCH] ilo: destroy the mutex, if winsys creation fails

2014-05-08 Thread Chia-I Wu
On Fri, May 9, 2014 at 2:09 AM, Emil Velikov wrote: > Cc: Chia-I Wu > Signed-off-by: Emil Velikov Reviewed-by: Chia-I Wu > --- > src/gallium/winsys/intel/drm/intel_drm_winsys.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/src/gallium/winsys/intel/drm/intel_

Re: [Mesa-dev] [PATCH 20/21] mesa: add support for threaded glCompileShader

2014-05-06 Thread Chia-I Wu
On Mon, May 5, 2014 at 5:37 AM, Chia-I Wu wrote: > On Sat, May 3, 2014 at 1:59 AM, Ian Romanick wrote: >> On 04/22/2014 01:58 AM, Chia-I Wu wrote: >>> From: Chia-I Wu >>> >>> Threaded glCompileShader can be enabled for a context by calling >>> _mes

Re: [Mesa-dev] [PATCH 7/8] i965/vs: Enable SPF when the shader contains no control flow.

2014-05-06 Thread Chia-I Wu
On Wed, May 7, 2014 at 9:38 AM, Matt Turner wrote: > --- > src/mesa/drivers/dri/i965/gen6_vs_state.c | 3 ++- > src/mesa/drivers/dri/i965/gen7_vs_state.c | 3 ++- > src/mesa/drivers/dri/i965/gen8_vs_state.c | 3 ++- > 3 files changed, 6 insertions(+), 3 deletions(-) > > diff --git a/src/mesa/driv

Re: [Mesa-dev] [PATCH 02/21] glsl: protect locale_t with a mutex

2014-05-06 Thread Chia-I Wu
On Tue, May 6, 2014 at 6:04 AM, Kenneth Graunke wrote: > On 05/05/2014 10:01 AM, Ian Romanick wrote: >> On 05/04/2014 02:14 PM, Chia-I Wu wrote: >>> On Sat, May 3, 2014 at 1:52 AM, Ian Romanick wrote: >>>> On 04/22/2014 01:58 AM, Chia-I Wu wrote: >>>>>

Re: [Mesa-dev] [PATCH 00/21] deferred and threaded glCompileShader

2014-05-06 Thread Chia-I Wu
On Tue, May 6, 2014 at 5:27 AM, Fredrik Höglund wrote: > On Tuesday 22 April 2014, Chia-I Wu wrote: >> Hi list, >> >> This series adds a thread pool to the GLSL compiler, and a drirc option to >> defer glCompileShader calls to the pool. The goal is to reduce the start

Re: [Mesa-dev] [PATCH] st/egl: Flush resources before presentation (android - bug 77966)

2014-05-04 Thread Chia-I Wu
On Mon, May 5, 2014 at 6:12 AM, Paulo Sergio wrote: > Ok. Name is Paulo Sergio Travaglia. Shall I resend the patch? I've committed it. Thanks. > Thanks > > Em 04/05/2014 18:40, "Chia-I Wu" escreveu: > >> On Sun, May 4, 2014 at 7:02 PM, Marek Olšák wrote: >

Re: [Mesa-dev] [PATCH] st/egl: Flush resources before presentation (android - bug 77966)

2014-05-04 Thread Chia-I Wu
On Sun, May 4, 2014 at 7:02 PM, Marek Olšák wrote: > Reviewed-by: Marek Olšák Looks good to me too, except please use your real name. > Marek > > On Fri, May 2, 2014 at 5:00 PM, pstglia wrote: >> --- >> src/gallium/state_trackers/egl/android/native_android.cpp | 7 +++ >> 1 file changed, 7

Re: [Mesa-dev] [PATCH 20/21] mesa: add support for threaded glCompileShader

2014-05-04 Thread Chia-I Wu
On Sat, May 3, 2014 at 1:59 AM, Ian Romanick wrote: > On 04/22/2014 01:58 AM, Chia-I Wu wrote: >> From: Chia-I Wu >> >> Threaded glCompileShader can be enabled for a context by calling >> _mesa_enable_glsl_threadpool. It will initialize the singleton GL

Re: [Mesa-dev] [PATCH 03/21] glsl: protect anonymous struct id with a mutex

2014-05-04 Thread Chia-I Wu
On Sat, May 3, 2014 at 1:33 AM, Ian Romanick wrote: > On 04/22/2014 01:58 AM, Chia-I Wu wrote: >> There may be two contexts compiling shaders at the same time, and we want the >> anonymous struct id to be globally unique. > > I am not very excited about this. > > Is

Re: [Mesa-dev] [PATCH 02/21] glsl: protect locale_t with a mutex

2014-05-04 Thread Chia-I Wu
On Sat, May 3, 2014 at 1:52 AM, Ian Romanick wrote: > On 04/22/2014 01:58 AM, Chia-I Wu wrote: >> There may be two contexts compiling shaders at the same time. locale_t needs >> to be protected. > > Rather than calling glsl_initialize_strtod from other places in the > c

Re: [Mesa-dev] [PATCH 05/21 v3] meta: Fix saving the program pipeline state

2014-05-01 Thread Chia-I Wu
ks, it fixes the bug. The patch looks good to me. A few minor comments/questions below. > Signed-off-by: Ian Romanick > Cc: Chia-I Wu > --- > src/mesa/drivers/common/meta.c | 86 > ++ > src/mesa/drivers/common/meta.h | 1 - > 2 files

Re: [Mesa-dev] [PATCH 05/21] meta: Fix saving the program pipeline state

2014-04-30 Thread Chia-I Wu
On Thu, May 1, 2014 at 12:11 AM, Ian Romanick wrote: > On 04/29/2014 08:43 PM, Chia-I Wu wrote: >> On Wed, Apr 30, 2014 at 8:52 AM, Ian Romanick wrote: >>> From: Ian Romanick >>> >>> This code was broken in some odd ways before. Too much state was being >

Re: [Mesa-dev] [PATCH 05/21] meta: Fix saving the program pipeline state

2014-04-29 Thread Chia-I Wu
l_shader_program *Shader[MESA_SHADER_STAGES]; > struct gl_shader_program *ActiveShader; > - struct gl_pipeline_object *_Shader; > struct gl_pipeline_object *Pipeline; > > /** MESA_META_STENCIL_TEST */ > -- > 1.8.1.4 > > ___

Re: [Mesa-dev] [PATCH 00/18] improvements for GL_KHR_debug support

2014-04-25 Thread Chia-I Wu
On Sat, Apr 26, 2014 at 2:53 AM, Emil Velikov wrote: > On 25/04/14 11:41, Chia-I Wu wrote: >> Hi, >> >> This series cleans up GL_KHR_debug support, fixes message control for some >> corner cases, and makes one enhancement: cheap >> glPushDebugGroup/glPopDebugGr

Re: [Mesa-dev] [PATCH 13/18] mesa: use accessors for struct gl_debug_state

2014-04-25 Thread Chia-I Wu
On Fri, Apr 25, 2014 at 10:30 PM, Brian Paul wrote: > On 04/25/2014 04:42 AM, Chia-I Wu wrote: >> >> When GL_DEBUG_OUTPUT_SYNCHRONOUS is GL_TRUE, drivers are allowed to log >> debug >> messages from other threads. That requires gl_debug_state to be protected >>

Re: [Mesa-dev] [PATCH 18/18] mesa: overhaul debug namespace support

2014-04-25 Thread Chia-I Wu
On Fri, Apr 25, 2014 at 10:30 PM, Brian Paul wrote: > On 04/25/2014 04:42 AM, Chia-I Wu wrote: >> >> _mesa_HashTable is not well-suited for us: it locks a mutex unnecessarily >> and >> it does not accept 0 as the key (and have branches to handle 1 specially). >>

[Mesa-dev] [PATCH 11/18] mesa: eliminate debug output should_log

2014-04-25 Thread Chia-I Wu
In both call sites, it could be easily replaced by direct debug_is_message_enabled calls. No functional change. Signed-off-by: Chia-I Wu --- src/mesa/main/errors.c | 40 +++- 1 file changed, 11 insertions(+), 29 deletions(-) diff --git a/src/mesa/main

  1   2   3   4   5   6   7   8   >