summaryrefslogtreecommitdiffstats
path: root/src/gallium
Commit message (Collapse)AuthorAgeFilesLines
* svga: add mksstats for surface view emulationCharmaine Lee2017-06-301-10/+17
| | | | | | | Add mksstats for surface view emulation and also tighten the stat CreateBackedView for the actual creation of backed view. Reviewed-by: Brian Paul <[email protected]>
* svga: change error handling convention for svga_set_stream_output()Brian Paul2017-06-303-12/+18
| | | | | | | | | | | | | | | | | | In general, the functions which emit commands to the command buffer check for failure and return a PIPE_ERROR_x code. It's up to the caller to flush the buffer and retry the command. But svga_set_stream_output() did its own flushing and the callers never checked the return value (though, it would always be PIPE_OK) in practice. This patch changes svga_set_stream_output() so that it does not call svga_context_flush() when the buffer is full. And we update the callers to check the return value as we do for other functions, like svga_set_shader(). No Piglit regressions. Also tested w/ Nature demo. Reviewed-by: Charmaine Lee <[email protected]>
* svga: fixed surface size to include array sizeCharmaine Lee2017-06-301-1/+2
| | | | | | | | | This patch fixes the total surface size in surface cache to include array size as well. Tested with MTT glretrace. Reviewed-by: Brian Paul <[email protected]>
* svga: loop over box.depth for ReadBack_image on each sliceNeha Bhende2017-06-301-7/+8
| | | | | | | | piglit test ext_texture_array-gen-mipmap is fixed with this patch. Tested with mtt piglit, glretrace, viewperf and conform. No regression. Reviewed-by: Brian Paul <[email protected]>
* svga: add mksstats for context creationCharmaine Lee2017-06-301-2/+7
| | | | Reviewed-by: Brian Paul <[email protected]>
* svga: re-validate sampler view at draw time if neededCharmaine Lee2017-06-304-2/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch validates those sampler views with backing copy of texture whose original copy has been updated since the view is last validated. This is done here at draw time because the texture binding might not have modified, hence validation is not triggered at state update time, and yet the texture might have been updated in another context, so we need to re-validate the sampler view in order to update the backing copy of the updated texture. This fixes a rendering flickering issue with Photoshop running in Linux VM with HWversion 11. The problem is Photoshop renders to texture A in context X, and then bind texture A to context Y. The first time when texture A is bound to context Y, cso calls pipe->set_sampler_views(). Validation of sampler views is done, rendering is fine. But when texture A is rendered to again in context X, and rebound in context Y, cso skips pipe->set_sampler_views() because texture A is already bound in context Y. SVGA driver is not given a chance to re-validate the texture binding, the backing copy of the texture is not updated, and hence causes black image. Tested with Photoshop, MTT glretrace, piglit. Fixes VMware bug 1769103. Reviewed-by: Jose Fonseca <[email protected]>
* gallium: os_process fixes for AndroidRob Herring2017-06-301-2/+2
| | | | | | | | | The function getprogname() is available on Android, since it reuses various BSD solutions C runtime. Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* etnaviv: Add unreachable statement to etna_amode to fix compilation warningsTomeu Vizoso2017-06-301-0/+2
| | | | | | Signed-off-by: Robert Foss <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* swr: Remove need to allocate vertex buffer scratch space all in one gocros-mesa-17.1.1-r14-vanillachadv/cros-mesa-17.1.1-r14-vanillaBruce Cherniak2017-06-291-23/+2
| | | | | | | | Deferred deletion (via "fence_work") has obsoleted the need to allocate all client vertex buffer scratch space in a single chunk. Scratch allocations are now valid until the referenced fence is complete. Reviewed-by: Tim Rowley <[email protected]>
* swr: conditionally validate vertex buffer stateBruce Cherniak2017-06-291-4/+5
| | | | | | | | | | | Vertex buffer state doesn't need to be validated on every call, only on dirty _NEW_VERTEX or indexed draws. Unconditional validation was introduced as part of patch 330d0607ed6, "remove pipe_index_buffer and set_index_buffer", with the expectation we'd optimize later. Reviewed-by: Tim Rowley <[email protected]>
* swr: set dynamic vertex sizeTim Rowley2017-06-291-2/+4
| | | | | | | Reduces the memory footprint of the frontend processing by packing vertices. Reviewed-by: Bruce Cherniak <[email protected]>
* radeonsi: set COMPUTE_DISPATCH_INITIATOR.ORDER_MODE = 1Marek Olšák2017-06-291-1/+4
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* radeonsi: use the DISPATCH packets to force COMPUTE_START_X/Y/Z = 0Marek Olšák2017-06-291-7/+6
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* Android: use symlinks for driver loadingRob Herring2017-06-2912-0/+21
| | | | | | | | | Instead of having special driver loading logic for Android, create symlinks to gallium_dri.so so we can use the standard loading logic. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Signed-off-by: Rob Herring <[email protected]>
* etnaviv: fix memory leak when BO allocation failsLucas Stach2017-06-291-1/+5
| | | | | | | | | | The resource struct is already allocated at this point and should be freed properly. Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Philipp Zabel <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> Reviewed-by: Wladimir J. van der Laan <[email protected]>
* etnaviv: fill in layer_stride for imported resourcesLucas Stach2017-06-291-0/+2
| | | | | | | | | | | The layer stride information is used in various parts of the driver, so it needs to be present regardless if the driver allocated the buffer itself or merely imported it from an external source. Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Philipp Zabel <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> Reviewed-by: Wladimir J. van der Laan <[email protected]>
* etnaviv: fix shader miscompilation with more than 16 labelsLucas Stach2017-06-281-28/+32
| | | | | | | | | | | | | The labels array may change its virtual address on a reallocation, so it is invalid to cache pointers into the array. Rather than using the pointer directly, remember the array index. Fixes miscompilation of shaders in glmark2 ideas, leading to GPU hangs. Fixes: c9e8b49b (etnaviv: gallium driver for Vivante GPUs) Cc: [email protected] Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]>
* radeonsi: move instance divisors into a constant bufferMarek Olšák2017-06-277-28/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Shader key size: 107 -> 47 Divisors of 0 and 1 are encoded in the shader key. Greater instance divisors are loaded from a constant buffer. The shader code doing the division is huge. Is it something we need to worry about? Does any app use instance divisors >= 2? VS prolog disassembly: s_load_dwordx4 s[12:15], s[0:1], 0x80 ; C00A0300 00000080 s_nop 0 ; BF800000 s_waitcnt lgkmcnt(0) ; BF8C007F s_buffer_load_dword s14, s[12:15], 0x4 ; C0220386 00000004 s_waitcnt lgkmcnt(0) ; BF8C007F v_cvt_f32_u32_e32 v4, s14 ; 7E080C0E v_rcp_iflag_f32_e32 v4, v4 ; 7E084704 v_mul_f32_e32 v4, 0x4f800000, v4 ; 0A0808FF 4F800000 v_cvt_u32_f32_e32 v4, v4 ; 7E080F04 v_mul_hi_u32 v5, v4, s14 ; D2860005 00001D04 v_mul_lo_i32 v6, v4, s14 ; D2850006 00001D04 v_cmp_eq_u32_e64 s[12:13], 0, v5 ; D0CA000C 00020A80 v_sub_i32_e32 v5, vcc, 0, v6 ; 340A0C80 v_cndmask_b32_e64 v5, v6, v5, s[12:13] ; D1000005 00320B06 v_mul_hi_u32 v5, v5, v4 ; D2860005 00020905 v_add_i32_e32 v6, vcc, v5, v4 ; 320C0905 v_subrev_i32_e32 v4, vcc, v5, v4 ; 36080905 v_cndmask_b32_e64 v4, v4, v6, s[12:13] ; D1000004 00320D04 v_mul_hi_u32 v5, v4, v1 ; D2860005 00020304 v_add_i32_e32 v4, vcc, s8, v0 ; 32080008 v_mul_lo_i32 v6, v5, s14 ; D2850006 00001D05 v_add_i32_e32 v7, vcc, 1, v5 ; 320E0A81 v_cmp_ge_u32_e64 s[12:13], v1, v6 ; D0CE000C 00020D01 v_sub_i32_e32 v6, vcc, v1, v6 ; 340C0D01 v_cmp_le_u32_e32 vcc, s14, v6 ; 7D960C0E v_cndmask_b32_e64 v8, 0, -1, s[12:13] ; D1000008 00318280 v_cndmask_b32_e64 v6, 0, -1, vcc ; D1000006 01A98280 v_and_b32_e32 v6, v8, v6 ; 260C0D08 v_cmp_eq_u32_e32 vcc, 0, v6 ; 7D940C80 v_cndmask_b32_e32 v6, v7, v5, vcc ; 000C0B07 v_add_i32_e32 v5, vcc, -1, v5 ; 320A0AC1 v_cmp_eq_u32_e32 vcc, 0, v8 ; 7D941080 v_cndmask_b32_e32 v5, v6, v5, vcc ; 000A0B06 v_add_i32_e32 v5, vcc, s9, v5 ; 320A0A09 v2: set prefer_mono for fetched instance divisors Reviewed-by: Nicolai Hähnle <[email protected]>
* radeonsi: check nr_cbufs in other places before flushing CBMarek Olšák2017-06-271-2/+4
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* radeonsi: use #pragma pack to pack si_shader_keyMarek Olšák2017-06-271-0/+8
| | | | | | | | | sizeof(struct si_shader_key): Before reverting the 2 commits: 120 bytes After reverting the 2 commits: 128 bytes With #pragma pack: 107 bytes Reviewed-by: Nicolai Hähnle <[email protected]>
* Revert "radeonsi: use uint32_t to declare si_shader_key.opt.kill_outputs"Marek Olšák2017-06-273-10/+6
| | | | | | This reverts commit 7b2240ac9ce3ba9bd86f4ae8aac53af8878c0b10. Reviewed-by: Nicolai Hähnle <[email protected]>
* Revert "radeonsi: remove 8 bytes from si_shader_key with uint32_t ↵Marek Olšák2017-06-273-14/+5
| | | | | | | | ff_tcs_inputs_to_copy" This reverts commit 6b6fed3a3c81c2b0d319ef121df20a0dc914705f. Reviewed-by: Nicolai Hähnle <[email protected]>
* radeon/vcn: enable h264 decode entension supportLeo Liu2017-06-272-0/+3
| | | | | | | It's enabled through message buffer for UVD Signed-off-by: Leo Liu <[email protected]> Acked-by: Christian König <[email protected]>
* svga: clean up format_cap_tableCharmaine Lee2017-06-271-403/+92
| | | | | | | | | | | Per Jose's suggestion, this patch cleans up format_cap_table to remove the unnecessary default cap value for vgpu10 formats since those devcap values can be retrieved from the device. Tested with MTT conform, glretrace, piglit in HWv13 and HWv8. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* svga: fix the default devcap for SVGA3D_Z_D24S8_INTCharmaine Lee2017-06-271-4/+1
| | | | | | | | | | The default devcap for format SVGA3D_Z_D24S8_INT in HWv8 when its devcap is not explicitly advertised should be set to zero to match the default value in the device. Tested with MTT piglit in HW version 8. Reviewed-by: Neha Bhende <[email protected]>
* svga: create buffer surfaces for incompatible bind flagsCharmaine Lee2017-06-274-27/+217
| | | | | | | | | | | | | | | | | | | | | | In cases where certain bind flags cannot be enabled together, such as CONSTANT_BUFFER cannot be combined with any other flags, a separate host surface will be created. For example, if a stream output buffer is reused as a constant buffer, two host surfaces will be created, one for stream output, and another one for constant buffer. Data will be copied from the stream output surface to the constant buffer surface. Fixes piglit test ext_transform_feedback-immediate-reuse-index-buffer, ext_transform_feedback-immediate-reuse-uniform-buffer Tested with MTT piglit, MTT glretrace, Nature, NobelClinician Viewer, Tropics. v2: Fix bind flags compatibility check as suggested by Brian. v3: Use the list utility to maintain the buffer surface list. v4: Use the SAFE rev of LIST_FOR_EACH_ENTRY Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* svga: do not unconditionally enable streamout bind flagCharmaine Lee2017-06-274-11/+78
| | | | | | | | | | | | | | | | | | Currently we unconditionally enable streamout bind flag at buffer resource creation time. This is not necessary if the buffer is never used as a streamout buffer. With this patch, we enable streamout bind flag as indicated by the state tracker. If the buffer is later bound to streamout and does not already has streamout bind flag enabled, we will recreate the buffer with the new set of bind flags. Buffer content will be copied from the old buffer to the new one. Tested with MTT piglit, Nature, Tropics, Lightsmark. v2: Fix bind flags check as suggested by Brian. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* svga: pass tobind_flags to svga_buffer_handleCharmaine Lee2017-06-278-15/+26
| | | | | | | | This is to prepare for more bind_flags optimization in subsequent patches. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* svga: pass bind_flags to surface create functionsCharmaine Lee2017-06-273-26/+34
| | | | | | | | This is to prepare for other bind_flags optimization in subsequent patches. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* pipe_loader_sw: fix compilation warningBrian Paul2017-06-271-1/+2
| | | | | | Add the new 'flags' parameter to pipe_loader_sw_create_screen(). Reviewed-by: Marek Olšák <[email protected]>
* i915: use different CFLAGS/LIBS variables than i965/anvLionel Landwerlin2017-06-273-3/+3
| | | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* nv50/ir: fix combineLd/St to update existing records as necessaryIlia Mirkin2017-06-261-0/+8
| | | | | | | | | | | | | | | | | | | | | Previously the logic would decide that the record is kept, which translates into keep = false in the caller, which meant that these passes did not run. While it's right that keep = false which means that a new record does not need to be added, we do still have to perform the usual list maintenance. It's easiest to do this pre-merge rather than post. The lowering that clip/cull distance passes produce triggers this bug in TCS (since reading outputs is done differently in other stages), but it should be possible to achieve it with the right sequence of regular reads/writes. Fixes: KHR-GL45.cull_distance.functional Fixes: generated_tests/spec/arb_tessellation_shader/execution/tes-input/tes-input-gl_ClipDistance.shader_test Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]> Cc: [email protected]
* nv50/ir: adjust overlapping logic to take fileIndex-relative offsetsIlia Mirkin2017-06-261-1/+5
| | | | | | | | | | | | | | | If the fileIndex is different, that means they are in logically different spaces. However if there's also a relative offset, then they could end up pointing at the same spot again. Also add a note about potential for multiple buffers to overlap even if they're at different file indexes. However that's potentially lowered away by the point that this logic hits. Not known to fix any specific application or test. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* nv50/ir: VFETCH is also considered a load for MemoryOptIlia Mirkin2017-06-261-1/+1
| | | | | | | | This has no effect since in practice this will only play for memory-backed files, for which VFETCH will never happen. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* nv50,nvc0: remove IDX from bufctx immediately, to avoid conflicts with clearIlia Mirkin2017-06-262-9/+10
| | | | | | | | | | | | The idxbuf could linger, and when a clear happened, which also uses the 3d bufctx, we could get an error trying to access it. This fixes spurious crashes/errors in CTS tests. Fixes: 61d8f3387d ("nv50,nvc0: clear index buffer bufctx bin unconditionally") Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]> Cc: [email protected]
* nv50/ir: fetch indirect sources BEFORE the op that uses themIlia Mirkin2017-06-261-19/+32
| | | | | | | | | | All the BuildUtil helpers just insert the operation into the current BB. So we have to take care that any fetchSrc() operations happen before the operation whose setIndirect() it goes into. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]> Cc: [email protected]
* Android: add renderonly files to libmesa_galliumRob Herring2017-06-261-0/+1
| | | | | | | | | | | | | | | vc4 now depends on renderonly functions, but these weren't added to the Android build resulting in the following errors: src/gallium/drivers/vc4/vc4_resource.c:380: error: undefined reference to 'renderonly_scanout_destroy' src/gallium/drivers/vc4/vc4_resource.c:681: error: undefined reference to 'renderonly_create_gpu_import_for_resource' src/gallium/drivers/vc4/vc4_screen.c:625: error: undefined reference to 'renderonly_dup' src/gallium/winsys/pl111/drm/pl111_drm_winsys.c:37: error: undefined reference to 'renderonly_create_gpu_import_for_resource' src/gallium/winsys/pl111/drm/pl111_drm_winsys.c:37: error: undefined reference to 'renderonly_create_gpu_import_for_resource' Fixes: 7029ec05e2c7 ("gallium: Add renderonly-based support for pl111+vc4.") Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* radeonsi: don't flush and wait for CB after depth-only renderingMarek Olšák2017-06-261-1/+4
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* etnaviv: only flush resource to self if no scanout buffer existsLucas Stach2017-06-261-4/+5
| | | | | | | | | | | | Currently a resource flush may trigger a self resolve, even if a scanout buffer exists, but is up to date. If a scanout buffer exists we only ever want to flush the resource to the scanout buffer. This fixes a performance regression. Fixes: dda956340ce9 (etnaviv: resolve tile status when flushing resource) Cc: [email protected] Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Philipp Zabel <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]>
* etnaviv: add support for snorm texturesChristian Gmeiner2017-06-262-3/+7
| | | | | | | | | Based on a patch from Wladimir J. van der Laan and untested due to lack of hardware. Binary blob emits those formats if GPU supports HALTI1 (faked with ibvivhook). Signed-off-by: Christian Gmeiner <[email protected]> Reviewed-by: Wladimir J. van der Laan <[email protected]>
* etnaviv: add R8G8 texture supportChristian Gmeiner2017-06-261-1/+1
| | | | | | | Passes texwrap GL_ARB_texture_rg piglit (with faked full texture rg support). Signed-off-by: Christian Gmeiner <[email protected]> Reviewed-by: Wladimir J. van der Laan <[email protected]>
* etnaviv: add support for swizzled texture formatsChristian Gmeiner2017-06-264-39/+99
| | | | | | | Passes all ext_texture_swizzle piglits. Signed-off-by: Christian Gmeiner <[email protected]> Reviewed-By: Wladimir J. van der Laan <[email protected]>
* etnaviv: add support for extended texture formatsChristian Gmeiner2017-06-264-4/+10
| | | | | Signed-off-by: Christian Gmeiner <[email protected]> Reviewed-by: Wladimir J. van der Laan <[email protected]>
* swr: set an explicit clear_rect if scissor is not enabled.Bruce Cherniak2017-06-261-1/+9
| | | | | | | | | | | | | Fix regression of "no rendering" on simple apps like glxgears by setting an explicit full surface clear_rect when scissor is not enabled. This regressed with commit 00173d91 "st/mesa: don't set 16 scissors and 16 viewports if they're unused" due to an assumption that a default scissor rect is always set, which was the case prior to this optimization. Reviewed-by: Tim Rowley <[email protected]>
* swr/rast: adjust std::string usage to fix buildTim Rowley2017-06-261-3/+9
| | | | | | | | | | Some combinations of c++ compilers and standard libraries had problems with the string::replace code we were using previously. This should fix the travis-ci system. Tested-by: Eric Engestrom <[email protected]> Reviewed-by: Bruce Cherniak <[email protected]>
* radeonsi: support indirect indexing in INTERP_* opcodesNicolai Hähnle2017-06-261-20/+58
| | | | | | | | | | | | The hardware doesn't support it, so we just interpolate all array elements and then use indirect indexing on the resulting vector. Clearly, this is not very efficient. There is an argument to be had for adding if/else, or perhaps even pulling the data out of LDS directly. Both don't really seem worth the effort, considering that it seems nobody actually uses this feature. Reviewed-by: Marek Olšák <[email protected]>
* r600g: fix crash when file in R600_TRACE doesn't existConstantine Charlamov2017-06-261-4/+5
| | | | | | | | | | …and print error in such case. Which probably is not a rare event btw because fopen doesn't expand ~ to $HOME. Also get rid of unused "bool ret" variable. Signed-off-by: Constantine Kharlamov <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* r600g: take into account offset to system inputs at tgsi_interp_egcm()Constantine Charlamov2017-06-262-6/+7
| | | | | | | | | Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=100785 v2: I was too much twiddling whether to initialize nsys_inputs at the beginning of shader initialization or for allocation of system values, and by the time I decided to go with the first one, I forgot to change it back. Signed-off-by: Constantine Kharlamov <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* r600g: get rid of trailing whitespaceConstantine Charlamov2017-06-261-22/+22
| | | | | Signed-off-by: Constantine Kharlamov <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* r600/asm: add support for other GDS operations.Dave Airlie2017-06-263-4/+26
| | | | | | | This adds support for the GDS operations needed to do atomic counters. Signed-off-by: Dave Airlie <[email protected]>