[Mesa-dev] [PATCH 57/84] st/nine: Implement Fast path for dynamic buffers and csmt

2016-12-07 Thread Axel Davy
Use the secondary pipe for DISCARD/NOOVERWRITE, which avoids stalling to get the pipe from the worker thread. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/buffer9.c | 62 ++ src/gallium/state_trackers/nine/buffer9.h

[Mesa-dev] [PATCH 39/84] st/nine: Reimplement nine_context_apply_stateblock

2016-12-07 Thread Axel Davy
The new version uses nine_context functions instead of applying the changes directly to nine_context. This will enable it to work with CSMT. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/nine_state.c | 205 +++ 1 file change

[Mesa-dev] [PATCH 73/84] st/nine: Implement nine_context_box_upload

2016-12-07 Thread Axel Davy
This function will be used for surface and volume uploads Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/nine_state.c | 39 src/gallium/state_trackers/nine/nine_state.h | 11 2 files changed, 50 insertions(+) diff

[Mesa-dev] [PATCH 42/84] st/nine: Create pipe_surfaces on resource creation.

2016-12-07 Thread Axel Davy
Create the pipe_surfaces on renderable resources creation. This enables to avoid creating them on the fly. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/surface9.c | 9 + src/gallium/state_trackers/nine/surface9.h | 5 ++--- 2 files chang

[Mesa-dev] [PATCH 79/84] st/nine: Idem for nine_context_gen_mipmap

2016-12-07 Thread Axel Davy
Will enable to use the bind count as an information for whether the surface/volume is used in the worker thread. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/basetexture9.c | 3 ++- src/gallium/state_trackers/nine/nine_state.c | 4 src/g

[Mesa-dev] [PATCH 47/84] st/nine: Print threadid in debug log

2016-12-07 Thread Axel Davy
From: Patrick Rudolph To ease debugging. Signed-off-by: Patrick Rudolph --- src/gallium/state_trackers/nine/nine_debug.c | 24 ++-- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git

[Mesa-dev] [PATCH 78/84] st/nine: Bind destination for surface/volume uploads

2016-12-07 Thread Axel Davy
Will enable to use the bind count as an information for whether the surface/volume is used in the worker thread. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/nine_state.c | 4 src/gallium/state_trackers/nine/nine_state.h | 1 + src/gallium/state_tr

[Mesa-dev] [PATCH 49/84] st/nine: Use nine_context for blit

2016-12-07 Thread Axel Davy
From: Patrick Rudolph Enables to offload it with CSMT. Signed-off-by: Patrick Rudolph --- src/gallium/state_trackers/nine/device9.c| 5 +++-- src/gallium/state_trackers/nine/nine_state.c | 8 src/gallium/state_trackers/nine/nine_state.h | 4

[Mesa-dev] [PATCH 80/84] st/nine: Add arguments to context's blit and copy_region

2016-12-07 Thread Axel Davy
The new arguments enable to reference the objects while the function hasn't run. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/device9.c| 14 -- src/gallium/state_trackers/nine/nine_state.c | 10 ++ src/gallium/state_tracker

[Mesa-dev] [PATCH 61/84] st/nine: Use nine_context_clear_render_target

2016-12-07 Thread Axel Davy
Enables to not wait for the worker thread for ColorFill. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/device9.c| 7 +-- src/gallium/state_trackers/nine/nine_state.c | 17 + src/gallium/state_trackers/nine/nine_state.

[Mesa-dev] [PATCH 83/84] st/nine: Allow non-zero resource offset for vertex buffers

2016-12-07 Thread Axel Davy
Next patches will introduce an offset. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/nine_state.c| 15 +-- src/gallium/state_trackers/nine/vertexbuffer9.c | 3 ++- src/gallium/state_trackers/nine/vertexbuffer9.h | 2 +- 3 files chang

[Mesa-dev] [PATCH 70/84] st/nine: Optimize managed buffer upload

2016-12-07 Thread Axel Davy
Do the upload in the other thread. Usually managed buffers are used once per frame. It is then very likely pending_upload is 0 at Lock time. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/buffer9.c | 3 +++ src/gallium/state_trackers/nine/buffer9.

[Mesa-dev] [PATCH 84/84] st/nine: Implement new buffer upload path

2016-12-07 Thread Axel Davy
This new buffer upload path enables to lock faster than the normal path when using DISCARD/NOOVERWRITE. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/Makefile.sources | 2 + src/gallium/state_trackers/nine/buffer9.c | 75 +- src/g

[Mesa-dev] [PATCH 66/84] st/nine: Detach buffers in swapchain dtor.

2016-12-07 Thread Axel Davy
BackBuffers can survive swapchain dtor if the user has a reference on them. The swapchain itself has no reference on the buffer. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/swapchain9.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[Mesa-dev] [PATCH 31/84] st/nine: Rename pipe to pipe_data in nine_context

2016-12-07 Thread Axel Davy
This patch it to avoid name conflict when device->pipe will be moved to nine_context. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/nine_ff.c| 20 +++ src/gallium/state_trackers/nine/nine_state.c | 90 ++-- sr

[Mesa-dev] [PATCH 77/84] st/nine: Use nine_context_box_upload for volumes

2016-12-07 Thread Axel Davy
Use nine_context_box_upload for uploads: . systemmem volume to default volume . managed volume internal content to its resource. Check the uploads are executed before any action that can alter the data, that is LockBox and volume destruction. Signed-off-by: Axel Davy <axel.d...@ens.fr> --

[Mesa-dev] [PATCH 58/84] st/nine: use get_pipe_acquire/release when possible

2016-12-07 Thread Axel Davy
Use the acquire/release semantic when we don't need to wait for any pending command. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/basetexture9.c | 8 ++-- src/gallium/state_trackers/nine/buffer9.c | 4 +++- src/gallium/state_tracker

[Mesa-dev] [PATCH 69/84] st/nine: Implement nine_context_range_upload

2016-12-07 Thread Axel Davy
Will be used to upload buffers. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/nine_state.c | 11 +++ src/gallium/state_trackers/nine/nine_state.h | 8 2 files changed, 19 insertions(+) diff --git a/src/gallium/state_trackers/nine/nine_s

[Mesa-dev] [PATCH 82/84] st/nine: Do not wait for DEFAULT lock for volumes when we can

2016-12-07 Thread Axel Davy
If the volumes (and the texture container) are not referenced, then they are no pending operations on them. We can lock directly. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/volume9.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff

[Mesa-dev] [PATCH 81/84] st/nine: Do not wait for DEFAULT lock for surfaces when we can

2016-12-07 Thread Axel Davy
If the surfaces (and the texture container) are not referenced, then they are no pending operations on them. We can lock directly. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/surface9.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-)

[Mesa-dev] [PATCH 74/84] st/nine: Use nine_context_box_upload for surfaces

2016-12-07 Thread Axel Davy
-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/surface9.c | 63 +++--- src/gallium/state_trackers/nine/surface9.h | 2 + 2 files changed, 33 insertions(+), 32 deletions(-) diff --git a/src/gallium/state_trackers/nine/surface9.c b/src/gallium/state_tr

[Mesa-dev] [PATCH 71/84] st/nine: Implement nine_context_gen_mipmap

2016-12-07 Thread Axel Davy
To offload mipmap generation as well. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/nine_state.c | 15 +++ src/gallium/state_trackers/nine/nine_state.h | 7 +++ 2 files changed, 22 insertions(+) diff --git a/src/gallium/state_tracker

[Mesa-dev] [PATCH 76/84] st/nine: Fix leak with volume dtor

2016-12-07 Thread Axel Davy
The last level was not released. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/volumetexture9.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/state_trackers/nine/volumetexture9.c b/src/gallium/state_trackers/nine/volumete

[Mesa-dev] [PATCH 56/84] st/nine: Add secondary pipe for device

2016-12-07 Thread Axel Davy
The secondary pipe will be used for operations that don't need synchronization. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/device9.c | 4 +++- src/gallium/state_trackers/nine/device9.h | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git

[Mesa-dev] [PATCH 46/84] st/nine: Implement gallium nine CSMT

2016-12-07 Thread Axel Davy
From: Patrick Rudolph <s...@das-labor.org> Use an offloading thread for all nine_context functions. Macros are used to ease the reading of the code. Signed-off-by: Patrick Rudolph <s...@das-labor.org> Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/auxili

[Mesa-dev] [PATCH 36/84] st/nine: Decompose nine_context_set_stream_source

2016-12-07 Thread Axel Davy
Part of the refactor to move all gallium calls to nine_state.c, and have all internal states required for those calls in nine_context. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/nine_state.c | 34 1 file changed, 25 inse

[Mesa-dev] [PATCH 23/84] st/nine: Back ps to nine_context

2016-12-07 Thread Axel Davy
Part of the refactor to move all gallium calls to nine_state.c, and have all internal states required for those calls in nine_context. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/device9.c| 29 src/gallium/state_trackers/nine/nin

[Mesa-dev] [PATCH 32/84] st/nine: Move pipe and cso to nine_context

2016-12-07 Thread Axel Davy
Part of the refactor to move all gallium calls to nine_state.c, and have all internal states required for those calls in nine_context. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/device9.c| 32 +++ src/gallium/state_trackers/nine/device9.h

[Mesa-dev] [PATCH 35/84] st/nine: Do not use NineBaseTexture9 in nine_context

2016-12-07 Thread Axel Davy
Some fields are subject to modification outside of nine_context (SetLod, etc). Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/basetexture9.c | 21 src/gallium/state_trackers/nine/nine_ff.c | 6 +-- src/gallium/state_trackers/nine/nine_s

[Mesa-dev] [PATCH 11/84] st/nine: Back vs to nine_context

2016-12-07 Thread Axel Davy
And move programmable_vs storage and computation. Part of the refactor to move all gallium calls to nine_state.c, and have all internal states required for those calls in nine_context. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/device9.c

[Mesa-dev] [PATCH 27/84] st/nine: Move query9 pipe calls to nine_context

2016-12-07 Thread Axel Davy
This will enable to use threading for them. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/nine_state.c | 33 src/gallium/state_trackers/nine/nine_state.h | 17 ++ src/gallium/state_trackers/nine/query9.c

[Mesa-dev] [PATCH 51/84] st/nine: Simplify the logic to bind textures

2016-12-07 Thread Axel Davy
This makes the code more readable. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/basetexture9.h | 20 ++ src/gallium/state_trackers/nine/device9.c | 11 +- src/gallium/state_trackers/nine/stateblock9.c | 55 -- 3

[Mesa-dev] [PATCH 45/84] st/nine: Pass size of memory to nine_state

2016-12-07 Thread Axel Davy
From: Patrick Rudolph Required for CSMT. Signed-off-by: Patrick Rudolph --- src/gallium/state_trackers/nine/device9.c| 20 ++-- src/gallium/state_trackers/nine/nine_state.c | 18 ++

[Mesa-dev] [PATCH 16/84] st/nine: Back scissor to nine_context

2016-12-07 Thread Axel Davy
Part of the refactor to move all gallium calls to nine_state.c, and have all internal states required for those calls in nine_context. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/device9.c| 7 +- src/gallium/state_trackers/nine/nine_state.

[Mesa-dev] [PATCH 53/84] st/nine: Track bindings for buffers

2016-12-07 Thread Axel Davy
Similar code than for textures. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/buffer9.h | 18 ++ src/gallium/state_trackers/nine/device9.c | 9 +-- src/gallium/state_trackers/nine/stateblock9.c | 34 +++ 3

[Mesa-dev] [PATCH 68/84] st/nine: Do not bind the container if forward is false

2016-12-07 Thread Axel Davy
This doesn't make sense to bind the container in that specific case. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/iunknown.h | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/gallium/state_trackers/nine/iunknown.h

[Mesa-dev] [PATCH 14/84] st/nine: Back current index buffer to nine_context

2016-12-07 Thread Axel Davy
Part of the refactor to move all gallium calls to nine_state.c, and have all internal states required for those calls in nine_context. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/device9.c| 16 ++- src/gallium/state_trackers/nine/nine_s

[Mesa-dev] [PATCH 54/84] st/nine: Upload Managed buffers just before draw call using them

2016-12-07 Thread Axel Davy
Previously we were uploading Managed buffers at the next draw call after they were set dirty. This is not the expected behaviour. Instead upload just before draw call needing the content. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/buffer9.

[Mesa-dev] [PATCH 48/84] st/nine: Add NINE_DEBUG=tid to turn threadid on or off

2016-12-07 Thread Axel Davy
From: Patrick Rudolph To ease debugging. Signed-off-by: Patrick Rudolph --- src/gallium/state_trackers/nine/nine_debug.c | 14 +- src/gallium/state_trackers/nine/nine_debug.h | 1 + 2 files changed, 10 insertions(+), 5 deletions(-) diff

[Mesa-dev] [PATCH 05/84] st/nine: Move texture setting to nine_context_*

2016-12-07 Thread Axel Davy
And move samplers_shadow to nine_context. Part of the refactor to move all gallium calls to nine_state.c, and have all internal states required for those calls in nine_context. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/device9.c

[Mesa-dev] [PATCH 18/84] st/nine: Put ff data in a separate structure

2016-12-07 Thread Axel Davy
And make nine_state_access_transform take this new structure as input. Part of the refactor to move all gallium calls to nine_state.c, and have all internal states required for those calls in nine_context. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/dev

[Mesa-dev] [PATCH 09/84] st/nine: Move stream freq data to nine_context

2016-12-07 Thread Axel Davy
Part of the refactor to move all gallium calls to nine_state.c, and have all internal states required for those calls in nine_context. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/device9.c | 19 src/gallium/state_trackers/nine/nine_s

[Mesa-dev] [PATCH 13/84] st/nine: Back all shader constants to nine_context

2016-12-07 Thread Axel Davy
For device vs shader float constants and may_swvp, the same tips than for the other constant types is used. Also memset the constants properly. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/device9.c | 138 ++ src/gallium/state_tracker

[Mesa-dev] [PATCH 06/84] st/nine: Back textures into nine_context

2016-12-07 Thread Axel Davy
Part of the refactor to move all gallium calls to nine_state.c, and have all internal states required for those calls in nine_context. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/basetexture9.c | 1 + src/gallium/state_trackers/nine/device9.c

[Mesa-dev] [PATCH 04/84] st/nine: Track changed.texture only for stateblocks

2016-12-07 Thread Axel Davy
Part of the refactor to move all gallium calls to nine_state.c, and have all internal states required for those calls in nine_context. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/basetexture9.c | 4 +--- src/gallium/state_trackers/nine/device9.c

[Mesa-dev] [PATCH 02/84] st/nine: Move core of device clear to nine_state

2016-12-07 Thread Axel Davy
Part of the refactor to move all gallium calls to nine_state.c, and have all internal states required for those calls in nine_context. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/device9.c| 130 + src/gallium/state_tracker

[Mesa-dev] [PATCH 07/84] st/nine: Move stream_usage_mask to nine_context

2016-12-07 Thread Axel Davy
Part of the refactor to move all gallium calls to nine_state.c, and have all internal states required for those calls in nine_context. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/nine_state.c | 6 +++--- src/gallium/state_trackers/nine/nine_state.h | 3

[Mesa-dev] [PATCH 19/84] st/nine: Refactor SetLight

2016-12-07 Thread Axel Davy
Call a helper function to set the light. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/device9.c| 24 src/gallium/state_trackers/nine/nine_state.c | 28 src/gallium/state_trackers/nine/nine_state.

[Mesa-dev] [PATCH 29/84] st/nine: Access pipe_context via NineDevice9_GetPipe

2016-12-07 Thread Axel Davy
Except for nine_ff and nine_state. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/basetexture9.c | 13 +--- src/gallium/state_trackers/nine/basetexture9.h | 1 - src/gallium/state_trackers/nine/buffer9.c | 16 + src/gallium/state_tr

[Mesa-dev] [PATCH 00/84] Introduce gallium nine internal multithreading

2016-12-07 Thread Axel Davy
are said to be put into a worker thread, while buffer locks and check for query results are made with reentrant functions in the main thread. Some tests suggest MANAGED pool upload is done in the worker thread, like the gallium patch serie implements. Thus we expect performance to be comparable. Axel

[Mesa-dev] [PATCH 44/84] st/nine: Add struct nine_clipplane

2016-12-07 Thread Axel Davy
From: Patrick Rudolph Required to know the size exact size of the plane. Signed-off-by: Patrick Rudolph --- src/gallium/state_trackers/nine/device9.c| 2 +- src/gallium/state_trackers/nine/nine_state.c | 4 ++--

[Mesa-dev] [PATCH 43/84] st/nine: Add nine_queue

2016-12-07 Thread Axel Davy
From: Patrick Rudolph This queue mechanism will be used for CSMT. Signed-off-by: Patrick Rudolph --- src/gallium/state_trackers/nine/Makefile.sources | 2 + src/gallium/state_trackers/nine/nine_queue.c | 251 +++

[Mesa-dev] [PATCH 64/84] st/nine: Simplify ARG_BIND_REF

2016-12-07 Thread Axel Davy
Remove some noop operations. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/nine_csmt_helper.h | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/gallium/state_trackers/nine/nine_csmt_helper.h b/src/gallium/state_tracker

[Mesa-dev] [PATCH 50/84] st/nine: Use nine_context for resource_copy_region

2016-12-07 Thread Axel Davy
From: Patrick Rudolph Use nine_context wrapper for resource_copy_region. Enables to offload it with CSMT. Signed-off-by: Patrick Rudolph --- src/gallium/state_trackers/nine/device9.c| 6 ++ src/gallium/state_trackers/nine/nine_state.c | 17

[Mesa-dev] [PATCH 75/84] st/nine: Fix leak with cubetexture dtor

2016-12-07 Thread Axel Davy
The last level was not released. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/cubetexture9.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/state_trackers/nine/cubetexture9.c b/src/gallium/state_trackers/nine/cubetext

[Mesa-dev] [PATCH 40/84] st/nine: Change the way nine_shader gets the pipe

2016-12-07 Thread Axel Davy
The change is required with csmt, where depending on the thread you don't access the pipe the same way. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/nine_shader.c | 3 +-- src/gallium/state_trackers/nine/nine_shader.h | 4 +++- src/gallium/state_tr

[Mesa-dev] [PATCH 52/84] st/nine: Fix BASETEX_REGISTER_UPDATE

2016-12-07 Thread Axel Davy
BASETEX_REGISTER_UPDATE was adding the texture to the list of textures to upload in too many cases. tex->base.base.bind will be set to true if the texture is in a stateblock, whereas we want to upload only if bound to the device, which is what bind_count is for. Signed-off-by: Axel Davy <

[Mesa-dev] [PATCH 59/84] st/nine: Simplify ColorFill

2016-12-07 Thread Axel Davy
For render targets, NineSurface9_GetSurface is not expected to fail. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/device9.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/gallium/state_trackers/nine/device9.c b/src/g

[Mesa-dev] [PATCH 38/84] st/nine: Decompose nine_context_set_texture

2016-12-07 Thread Axel Davy
Part of the refactor to move all gallium calls to nine_state.c, and have all internal states required for those calls in nine_context. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/nine_state.c | 73 ++-- 1 file changed, 48 inse

[Mesa-dev] [PATCH 72/84] st/nine: Use nine_context_gen_mipmap in BaseTexture9

2016-12-07 Thread Axel Davy
Generate mipmaps in the worker thread. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/basetexture9.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/gallium/state_trackers/nine/basetexture9.c b/src/gallium/state_tracker

[Mesa-dev] [PATCH 01/36] st/nine: Improve doc of D3DPMISCCAPS_POSTBLENDSRGBCONVERT

2016-12-07 Thread Axel Davy
The cap should be advertised for d3d10 able cards, but only for Ex contexts. Unfortunately at this point Mesa has no way to know if Ex is used or not (the info is got later). Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/adapter9.c | 2 +- 1 file chan

[Mesa-dev] [PATCH 17/36] st/nine: Do not generate gallium NOP on d3d NOP

2016-12-07 Thread Axel Davy
Some drivers crash if NOP is generated. Besides there is no point to generate NOP. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/nine_shader.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gallium/state_tracker

[Mesa-dev] [PATCH 31/36] st/nine: Fix ff cases when stages should be disabled

2016-12-07 Thread Axel Davy
When a texture is read by a stage for colorop, it should be disabled, and disable following stages. When a texture is read for alphaop, 1.0f is read for the input, which is the behaviour for a dummy texture. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_tracker

[Mesa-dev] [PATCH 30/36] st/nine: Always initialize current in ff ps

2016-12-07 Thread Axel Davy
The check was not catching all possible cases. NVE4 should be fine. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/nine_ff.c | 25 + 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/src/gallium/state_trackers/nine/nine_f

[Mesa-dev] [PATCH 19/36] d3dadapter/present: Add new API to ID3DPresent

2016-12-07 Thread Axel Davy
The API will enable better support for the commonly used DISCARD swapchain parameter. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- include/d3dadapter/present.h | 24 1 file changed, 24 insertions(+) diff --git a/include/d3dadapter/present.h b/include/d3da

[Mesa-dev] [PATCH 14/36] st/nine: Handle when cursor stride is not what is expected

2016-12-07 Thread Axel Davy
SetCursor assumes for now a 32x32 argb cursor with pitch 128. 32x32 argb doesn't have pitch 128 on all hw, thus use a temporary surface with the correct pitch when needed. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/device9.c | 20 ++-

[Mesa-dev] [PATCH 00/36] Some gallium nine fixes

2016-12-07 Thread Axel Davy
proposed behaviour (which is equivalent to the 'opengl triple buffering'). Axel Davy (36): st/nine: Improve doc of D3DPMISCCAPS_POSTBLENDSRGBCONVERT st/nine: Add validation to SetSamplerState st/nine: Remove useless call to nine_update_state st/nine: Don't update stream_usage_mask in sw path

[Mesa-dev] [PATCH 02/36] st/nine: Add validation to SetSamplerState

2016-12-07 Thread Axel Davy
Check value validity and mimick Win behaviour. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/device9.c | 9 --- src/gallium/state_trackers/nine/nine_limits.h | 36 +++ src/gallium/state_trackers/nine/nine_state.c | 2 +

[Mesa-dev] [PATCH 04/36] st/nine: Don't update stream_usage_mask in sw path

2016-12-07 Thread Axel Davy
The variable is used only in the hw path. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/nine_state.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/gallium/state_trackers/nine/nine_state.c b/src/gallium/state_trackers/nine/nine_state.c index 5

[Mesa-dev] [PATCH 28/36] st/nine: Do not saturate illumination coefficients in ff

2016-12-07 Thread Axel Davy
Fixes bad rendering of a test app. Wine has the same behaviour. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/nine_ff.c | 4 1 file changed, 4 deletions(-) diff --git a/src/gallium/state_trackers/nine/nine_ff.c b/src/gallium/state_trackers/nine/nin

[Mesa-dev] [PATCH 33/36] st/nine: Fix two special cases in ff ps

2016-12-07 Thread Axel Davy
if first alpha stage is disabled and writes to temp, diffuse alpha is written to temp. Last stage always writes to current. Behaviour was deduced by tests with a test app. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/nine_ff.c | 20

[Mesa-dev] [PATCH 05/36] st/nine: Fix useless swapchain init checks

2016-12-07 Thread Axel Davy
In NineDevice9_SetDefaultState we can assume the implicit swapchain is properly initialized. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/device9.c | 21 +++-- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/src/g

[Mesa-dev] [PATCH] st/nine: SYSTEMMEM ignores DISCARD.

2016-12-13 Thread Axel Davy
Tests show SYSTEMMEM should ignore DISCARD. Prevents game bugs with following patches reimplementing DISCARD. Halo is affected. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- This patch prevents a regression on radeonsi for Halo (and probably other games) with "st/nine: Implemen

[Mesa-dev] [PATCH 84/84 v4] st/nine: Implement new buffer upload path

2016-12-13 Thread Axel Davy
content is copied to the new resource used. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- Still open for comments. src/gallium/state_trackers/nine/Makefile.sources | 2 + src/gallium/state_trackers/nine/buffer9.c | 90 ++- src/gallium/state_trackers/nine/buf

[Mesa-dev] [PATCH] st/nine: Dirty MANAGED buffers at Lock time

2016-12-13 Thread Axel Davy
Tests suggest MANAGED buffers are made dirty at Lock time, not at Unlock time. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- Dirtying MANAGED buffers at Unlock was a requirement of our previous implementation, since we were uploading all dirty MANAGED buffers as soon as a draw call wa

Re: [Mesa-dev] [PATCH 45/84] st/nine: Pass size of memory to nine_state

2016-12-15 Thread Axel Davy
This patch breaks build because it doesn't replace some calls. The replacements are introduced by the patch after. I suggest to just merge the two patches. I'm not so sure this patch makes sense alone. Axel On 07/12/2016 23:55, Axel Davy wrote: From: Patrick Rudolph <s...@das-labor.

[Mesa-dev] [PATCH 39/84 v2] st/nine: Reimplement nine_context_apply_stateblock

2016-12-15 Thread Axel Davy
The new version uses nine_context functions instead of applying the changes directly to nine_context. This will enable it to work with CSMT. v2: Fix nine_context_light_enable_stateblock. The memcpy arguments were wrong, and the state wasn't set dirty. Signed-off-by: Axel Davy <axel.d...@ens

[Mesa-dev] [PATCH 03/84 v2] st/nine: Move draw calls to nine_state

2016-12-17 Thread Axel Davy
-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/device9.c | 210 -- src/gallium/state_trackers/nine/nine_ff.c | 84 +++ src/gallium/state_trackers/nine/nine_state.c| 278 +--- src/gallium/state_tracker

[Mesa-dev] [PATCH 84/84 v2] st/nine: Implement new buffer upload path

2016-12-11 Thread Axel Davy
This new buffer upload path enables to lock faster than the normal path when using DISCARD/NOOVERWRITE. v2: Diverse cleanups and fixes. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- This patch needed a few cleanups, whih this new version adds. With this version, I wasn't able to rep

[Mesa-dev] [PATCH 84/84 v3] st/nine: Implement new buffer upload path

2016-12-11 Thread Axel Davy
This new buffer upload path enables to lock faster than the normal path when using DISCARD/NOOVERWRITE. v2: Diverse cleanups and fixes. v3: Fix allocation size for 'lone' buffers and add more debug info. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- This fixes the reported 'leak'

[Mesa-dev] [PATCH 23/36] st/nine: Add new driconf options to control DISCARD behaviour

2016-12-07 Thread Axel Davy
See the patch for the new controls added. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/adapter9.h | 2 ++ src/gallium/state_trackers/nine/swapchain9.c| 4 ++-- src/gallium/targets/d3dadapter9/drm.c | 17 + src/mesa/d

[Mesa-dev] [PATCH 10/36] st/nine: Add some debug info in stateblocks

2016-12-07 Thread Axel Davy
This is useful to check what is exactly recorded. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/stateblock9.c | 5 + 1 file changed, 5 insertions(+) diff --git a/src/gallium/state_trackers/nine/stateblock9.c b/src/gallium/state_trackers/nine/statebl

[Mesa-dev] [PATCH 27/36] st/nine: Fix ff COLOR0 w component computation

2016-12-07 Thread Axel Davy
The computation was wrong. COLOR0's last component should be equal to the material diffuse w component. The behaviour was checked with a test app on Windows. Wine has the same behaviour. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/nine_ff.

[Mesa-dev] [PATCH 34/36] st/nine: Convert redundant check to assert in ff ps

2016-12-07 Thread Axel Davy
We disable the alpha stage if the color stage is disabled. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/nine_ff.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gallium/state_trackers/nine/nine_ff.c b/src/gallium/state_tr

[Mesa-dev] [PATCH 16/36] st/nine: Fix leak in user constant upload path

2016-12-07 Thread Axel Davy
The new code properly releases the previous buffers allocated. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/nine_ff.c| 22 +++-- src/gallium/state_trackers/nine/nine_state.c | 46 2 files changed, 39 insertions(

[Mesa-dev] [PATCH 11/36] st/nine: Add missing changed states to pixel stateblocks

2016-12-07 Thread Axel Davy
Some states were not properly recorded in pixel stateblocks. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/device9.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_tr

[Mesa-dev] [PATCH 32/36] st/nine: Remove useless code in ff ps

2016-12-07 Thread Axel Davy
Current is already initialized to Diffuse. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/nine_ff.c | 5 - 1 file changed, 5 deletions(-) diff --git a/src/gallium/state_trackers/nine/nine_ff.c b/src/gallium/state_trackers/nine/nine_ff.c index 7

[Mesa-dev] [PATCH 08/36] st/nine: Fix bad light initialization in stateblocks

2016-12-07 Thread Axel Davy
src was initialized instead of dst. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/stateblock9.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/state_trackers/nine/stateblock9.c b/src/gallium/state_trackers/nine/statebl

[Mesa-dev] [PATCH 35/36] st/nine: Fix ff texture coordinate selection

2016-12-07 Thread Axel Davy
The code was wrongly detecting which texture coordinates to generate when the coordinate index was different to the stage index. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/nine_ff.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff

[Mesa-dev] [PATCH 20/36] d3dadapter/present: Add precision for WaitBufferReleased

2016-12-07 Thread Axel Davy
Add precision on the behaviour of WaitBufferReleased. All implementers and users of the API were expecting that behaviour. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- include/d3dadapter/present.h | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/d3da

[Mesa-dev] [PATCH 25/36] st/nine: Ignore MULTISAMPLEMASK when RT is not multisampled

2016-12-07 Thread Axel Davy
We were ignoring MULTISAMPLEMASK for non-maskable multisample modes, but we were missing the non-multisampled case. Fixes a crash in Halo. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/device9.c| 4 ++-- src/gallium/state_trackers/nine/nine_state

Re: [Mesa-dev] [PATCH 00/84] Introduce gallium nine internal multithreading

2016-12-07 Thread Axel Davy
On 08/12/2016 00:38, Dieter Nützel wrote: Am 07.12.2016 23:54, schrieb Axel Davy: This patch adds internal multithreading to gallium nine. The goal is to offload almost all gallium nine calls (and some other work) to a worker thread. Hello Axel, really nice job! 'But' show us the 'numbers

Re: [Mesa-dev] [PATCH 84/84] st/nine: Implement new buffer upload path

2016-12-08 Thread Axel Davy
There seems to be a regression with this patch. I noticed one mistake: nine_upload_create_buffer should initialize buf->resource to NULL. However someone reports crash after GTT memory exhaustion. I can't find the mistake. Anyone ? Axel On 07/12/2016 23:55, Axel Davy wrote: This new buf

[Mesa-dev] [PATCH 07/36] st/nine: Remove unused ff.changed.group

2016-12-07 Thread Axel Davy
It was unused. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/nine_state.h | 1 - src/gallium/state_trackers/nine/stateblock9.c | 5 - 2 files changed, 6 deletions(-) diff --git a/src/gallium/state_trackers/nine/nine_state.h b/src/gallium/state_tr

[Mesa-dev] [PATCH 12/36] st/nine: Capture texturestage states in pixel stateblocks

2016-12-07 Thread Axel Davy
pixels stateblocks need to capture these. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/device9.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c

[Mesa-dev] [PATCH 26/36] st/nine: Fix specular enable for alpha

2016-12-07 Thread Axel Davy
Apparently specular enable doesn't affect the alpha channel. Fixes https://github.com/iXit/Mesa-3D/issues/253 Behaviour comfirmed looking in wine sources. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/nine_ff.c | 2 +- 1 file changed, 1 insertion

[Mesa-dev] [PATCH 22/36] st/nine: Rework buffer presentation path

2016-12-07 Thread Axel Davy
Use the new API for DISCARD. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/swapchain9.c | 180 --- 1 file changed, 132 insertions(+), 48 deletions(-) diff --git a/src/gallium/state_trackers/nine/swapchain9.c b/src/gallium/state_tr

[Mesa-dev] [PATCH 21/36] st/nine: Fix a leak in Swapchain dtor

2016-12-07 Thread Axel Davy
Count properly the number of backbuffers, and use the new info to release the correct number of buffers Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/swapchain9.c | 31 ++-- src/gallium/state_trackers/nine/swapchain9.h | 1 + 2

[Mesa-dev] [PATCH 18/36] st/nine: Silent warnings with guid_str

2016-12-07 Thread Axel Davy
In non-debug build, the variables are unused, and thus trigger a compilation warning. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/iunknown.c | 8 src/gallium/state_trackers/nine/surface9.c | 2 ++ src/gallium/state_trackers/nine/volume9.c | 2

[Mesa-dev] [PATCH 29/36] st/nine: Fix check for ff specular

2016-12-07 Thread Axel Davy
Fix the check for computing ff specular. This seems to match the opengl behavior, and give the correct output on windows. Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/nine_ff.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git

<    4   5   6   7   8   9   10   11   >