summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
Commit message (Collapse)AuthorAgeFilesLines
* st/nine: Protect dtors with mutexAxel Davy2017-01-124-19/+64
| | | | | | | | | | | | | | | | | | | | | When the flag D3DCREATE_MULTITHREAD is set, a global mutex is used to protect nine calls. However for performance reasons, AddRef and Release didn't hold the mutex, and instead used atomics. Unfortunately at item release, the item can be destroyed, and that destruction path should be protected by a mutex (at least for some objects). Without this patch, it is possible an app thread is in a dtor while another thread is making gallium nine calls. It is possible that two threads are using the same gallium pipe, which is forbiden. The problem has been made worse with csmt, because it can cause hang, since nine_csmt_process is not threadsafe. Fixes Hitman hang, and possibly others. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Flush the queue at device dtorAxel Davy2017-01-121-1/+6
| | | | | | | | Flush the queue to get refcounts right, and properly release the items, instead of throwing away all pending commands. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Process pending commands on ResetAxel Davy2017-01-123-0/+5
| | | | | | | | Some nine_state_* and nine_context_* functions used for Reset() require all pending commands are flushed. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Flush pending commands if needed for surface9 changesAxel Davy2017-01-122-13/+32
| | | | | | | nine_context uses NineSurface9 fields, thus we need to flush pending commands using the surface before changing the fields. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Rework CreatePipeSurfaceAxel Davy2017-01-122-22/+30
| | | | | | Create both surfaces in one call. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Remove duplicated checksAxel Davy2017-01-122-10/+7
| | | | | | | | There is no need to check on csmt_active before calling nine_csmt_process, because the function checks already. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Don't call u_box_union_* when dirty region is emptyMasanori Kakura2017-01-123-10/+22
| | | | | | | | | | When dirty region is empty, u_box_union_* incorrectly expands the new region. This fixes broken font rendering issue in WOLF RPG Editor v2.10 games. Signed-off-by: Masanori Kakura <[email protected]> Reviewed-by: Axel Davy <[email protected]>
* clover: Check for executables before enqueueing a kernelPierre Moreau2017-01-111-1/+4
| | | | | | | | | | Without this check, the kernel::bind() method would fail with a std::out_of_range exception, letting an exception escape from the library into the client, rather than returning the corresponding error code CL_INVALID_PROGRAM_EXECUTABLE. Signed-off-by: Pierre Moreau <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
* st/dri: remove trailing whitespaceMauro Rossi2017-01-111-1/+1
| | | | | Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* gallium: remove TGSI_OPCODE_SUBMarek Olšák2017-01-051-2/+2
| | | | | | It's redundant with the source modifier. Reviewed-by: Nicolai Hähnle <[email protected]>
* st/nine: Remove all usage of ureg_SUB in nine_shaderAxel Davy2017-01-051-8/+8
| | | | | | | This is required to drop gallium SUB. Signed-off-by: Axel Davy <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* st/nine: Remove all usage of ureg_SUB in nine_ffAxel Davy2017-01-051-20/+20
| | | | | | | This is required to remove gallium SUB. Signed-off-by: Axel Davy <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* st/nine: Do not map SUB and ABS to their gallium equivalent.Axel Davy2017-01-051-2/+23
| | | | | | | This is required for gallium SUB and ABS to be removed. Signed-off-by: Axel Davy <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* st/va: fix incorrect argument in vl_compositor_cleanupNayan Deshmukh2017-01-051-1/+1
| | | | | | | | This fixes the mistake introduced in commit b6737a8bcd03ea68952799144c0c6e6e6679bee9 Signed-off-by: Nayan Deshmukh <[email protected]> Reviewed-by: Christian König <[email protected]>
* va: call texture_get_handle while the mutex is being heldMarek Olšák2017-01-041-2/+5
| | | | | | | The context may be used by texture_get_handle. Reviewed-by: Christian König <[email protected]> Cc: 13.0 <[email protected]>
* vdpau: call texture_get_handle while the mutex is being heldMarek Olšák2017-01-042-6/+13
| | | | | | | | | The context may be used by texture_get_handle. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99158 Reviewed-by: Christian König <[email protected]> Cc: 13.0 <[email protected]>
* st/va: error handlingNayan Deshmukh2017-01-031-3/+15
| | | | | | | | handle the cases when vl_compositor_set_csc_matrix(), vl_compositor_init_state() and vl_compositor_init() fail Signed-off-by: Nayan Deshmukh <[email protected]> Reviewed-by: Christian König <[email protected]>
* st/vdpau: error handlingNayan Deshmukh2017-01-033-15/+50
| | | | | | | | handle the cases when vl_compositor_set_csc_matrix(), vl_compositor_init_state() and vl_compositor_init() fail Signed-off-by: Nayan Deshmukh <[email protected]> Reviewed-by: Christian König <[email protected]>
* clover: Use Clang's diagnosticsVedran Miletić2016-12-241-1/+6
| | | | | | | | | | | | | | | | Presently errors from frontend are handled only if they occur in clang::CompilerInvocation::CreateFromArgs(). This patch uses clang::DiagnosticsEngine to detect errors such as invalid values for Clang frontend arguments. Fixes Piglit's cl/program/build/fail/invalid-version-declaration.cl test. v2: fix inconsistent code formatting Signed-off-by: Vedran Miletić <[email protected]> Reviewed-by: Francisco Jerez <[email protected]> Tested-by: Aaron Watry <[email protected]>
* st/nine: Upload on secondary context for Draw*UpAxel Davy2016-12-201-8/+15
| | | | | | | | | | Avoid synchronization by using the secondary context for uploading the vertex data for Draw*Up. v2: Rely on u_upload_mgr to use persistent coherent buffers. Do not flush. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Dirty MANAGED buffers at Lock timeAxel Davy2016-12-201-2/+3
| | | | | | | Tests suggest MANAGED buffers are made dirty at Lock time, not at Unlock time. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Implement new buffer upload pathAxel Davy2016-12-2010-24/+461
| | | | | | | | | | | | | | | | | | | | 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. v4: Rewrite of the path to handle when DISCARD/NOOVERWRITE is not used anymore. The resource content is copied to the new resource used. v5: flush for safety after unmap (not sure it is really required here, but safer to flush). v6: Do not use the path if persistent coherent mapping is unavailable. Fix buffer creation flags. v7: Do not flush since it is not needed. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Allow non-zero resource offset for vertex buffersAxel Davy2016-12-203-8/+12
| | | | | | Next patches will introduce an offset. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Do not wait for DEFAULT lock for volumes when we canAxel Davy2016-12-201-1/+8
| | | | | | | 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 <[email protected]>
* st/nine: Do not wait for DEFAULT lock for surfaces when we canAxel Davy2016-12-201-1/+11
| | | | | | | 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 <[email protected]>
* st/nine: Add arguments to context's blit and copy_regionAxel Davy2016-12-203-6/+22
| | | | | | | The new arguments enable to reference the objects while the function hasn't run. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Idem for nine_context_gen_mipmapAxel Davy2016-12-203-1/+7
| | | | | | | 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 <[email protected]>
* st/nine: Bind destination for surface/volume uploadsAxel Davy2016-12-204-0/+9
| | | | | | | 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 <[email protected]>
* st/nine: Use nine_context_box_upload for volumesAxel Davy2016-12-202-36/+26
| | | | | | | | | | | | 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 <[email protected]>
* st/nine: Fix leak with volume dtorAxel Davy2016-12-201-1/+1
| | | | | | The last level was not released. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Fix leak with cubetexture dtorAxel Davy2016-12-201-1/+1
| | | | | | The last level was not released. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Use nine_context_box_upload for surfacesAxel Davy2016-12-202-32/+33
| | | | | | | | | | | | Use nine_context_box_upload for uploads: . systemmem surface to default surface . managed surface internal content to its resource. Check the uploads are executed before any action that can alter the data, that is LockRect, NineSurface9_CopyDefaultToMem and surface destruction. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Implement nine_context_box_uploadAxel Davy2016-12-202-0/+50
| | | | | | This function will be used for surface and volume uploads Signed-off-by: Axel Davy <[email protected]>
* st/nine: Use nine_context_gen_mipmap in BaseTexture9Axel Davy2016-12-201-9/+3
| | | | | | Generate mipmaps in the worker thread. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Implement nine_context_gen_mipmapAxel Davy2016-12-202-0/+22
| | | | | | To offload mipmap generation as well. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Optimize managed buffer uploadAxel Davy2016-12-202-5/+10
| | | | | | | | | | 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 <[email protected]>
* st/nine: Implement nine_context_range_uploadAxel Davy2016-12-202-0/+19
| | | | | | Will be used to upload buffers. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Do not bind the container if forward is falseAxel Davy2016-12-201-7/+5
| | | | | | This doesn't make sense to bind the container in that specific case. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Comment and simplify iunknownAxel Davy2016-12-202-21/+18
| | | | | | The behaviour is a bit less obscure now. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Detach buffers in swapchain dtor.Axel Davy2016-12-201-1/+1
| | | | | | | | | 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 <[email protected]>
* st/nine: Fix NineUnknown_DetachAxel Davy2016-12-201-2/+1
| | | | | | We don't bind the container in AddRef. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Simplify ARG_BIND_REFAxel Davy2016-12-201-7/+3
| | | | | | Remove some noop operations. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Avoid flushing the queue for queries GetDataAxel Davy2016-12-204-19/+33
| | | | | | | Use the newly introduced counter to know when we don't need synchronization. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Add CSMT_NO_WAIT_WITH_COUNTERPatrick Rudolph2016-12-201-0/+54
| | | | | | | | Similar to the other macros, but introduces a counter, which enables to know when the instructions has been executed. Signed-off-by: Patrick Rudolph <[email protected]>
* st/nine: Use nine_context_clear_render_targetAxel Davy2016-12-204-15/+29
| | | | | | Enables to not wait for the worker thread for ColorFill. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Optimize ColorFillAxel Davy2016-12-201-1/+1
| | | | | | When we lock the whole surface to overwrite it, we can use DISCARD. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Simplify ColorFillAxel Davy2016-12-201-9/+1
| | | | | | | For render targets, NineSurface9_GetSurface is not expected to fail. Signed-off-by: Axel Davy <[email protected]>
* st/nine: use get_pipe_acquire/release when possibleAxel Davy2016-12-208-16/+34
| | | | | | | Use the acquire/release semantic when we don't need to wait for any pending command. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Implement Fast path for dynamic buffers and csmtAxel Davy2016-12-203-10/+64
| | | | | | | | | | | | Use the secondary pipe for DISCARD/NOOVERWRITE, which avoids stalling to get the pipe from the worker thread. v2: flush at unmap. This is required for example if the driver does hidden draw calls or copies. In the case of unsynchronized it is probably not required, but it is more safe. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Add secondary pipe for deviceAxel Davy2016-12-202-1/+5
| | | | | | | The secondary pipe will be used for operations that don't need synchronization. Signed-off-by: Axel Davy <[email protected]>