aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* glsl: fix constant packing for 64-bit big endian.Dave Airlie2020-07-012-10/+25
| | | | | | | | | In a piglit run on s390 a lot of double tests fail, explicitly packing/shifting things rather than using memcpy seems to help Cc: <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5679>
* mesa/swrast: use logf2 instead of util_fast_log2Dylan Baker2020-06-302-3/+3
| | | | | | | | | | | | | | | The fast version is apparently not accurate enough. I wrote a very simply test program that called logf2 and the old LOG2 function 100000 times. Across that the two functions had very similar run times, neither appeared meaningfully faster, so the optimization of bringing back yet another way to calculate log2f seems pointless. Fixes: bd4e769515345a6b20562310334bc828c0bb6605 ("replace LOG2 with util_fast_log2") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2856 Reviewed-by: Matt Turner <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5406>
* anv: disable i915_perf warning on non-LinuxJan Beich2020-06-301-2/+2
| | | | | | | | $ vkcube INTEL-MESA: warning: Performance support disabled, consider sysctl dev.i915.perf_stream_paranoid=0 Reviewed-by: Lionel Landwerlin <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5461>
* meson: Revert commit overriding C++ standard with gnu++11 on ppc64elFrédéric Bonnard2020-06-301-4/+0
| | | | | | | | | | | | | Since a few versions, mesa now needs c++14 and compiling with gnu++11 on ppc64el fails. Let's use the default standard and fix the collision of types between c++ and altivec in a another patch. Cc: mesa-stable Signed-off-by: Frédéric Bonnard <[email protected]> Reviewed-by: Francisco Jerez <[email protected]> Reviewed-by: Dylan Baker <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4948>
* clover: Fix types collision between c++ and altivecFrédéric Bonnard2020-06-301-0/+5
| | | | | | | | | | | For that, we undefine bool, vector, pixel as advised by altivec.h in the specific case that defines them. Cc: mesa-stable Signed-off-by: Frédéric Bonnard <[email protected]> Reviewed-by: Francisco Jerez <[email protected]> Reviewed-by: Dylan Baker <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4948>
* nir: Propagate *2*16 conversions into vectorsAlyssa Rosenzweig2020-06-301-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we have code like: ('f2f16', ('vec2', ('f2f32', 'a@16'), '#b@32')) We would like to eliminate the conversions, but the existing rules can't see into the the (heterogenous) vector. So instead of trying to eliminate in one pass, we add opts to propagate the f2f16 into the vector. Even if nothing further happens, this is often a win since then the created vector is smaller (half2 instead of float2). Hence the above gets transformed to ('vec2', ('f2f16', ('f2f32', 'a@16')), ('f2f16', '#b@32')) Then the existing f2f16(f2f32) rule will kick in for the first component and constant folding will for the second and we'll be left with ('vec2', 'a@16', '#b@16') ...eliminating all conversions. v2: Predicate on !options->vectorize_vec2_16bit. As discussed, this optimization helps greatly on true vector architectures (like Midgard) but wreaks havoc on more modern SIMD-within-a-register architectures (like Bifrost and modern AMD). So let's predicate on that. v3: Extend for integers as well and add a comment explaining the transforms. Results on Midgard (unfortunately a true SIMD architecture): total instructions in shared programs: 51359 -> 50963 (-0.77%) instructions in affected programs: 4523 -> 4127 (-8.76%) helped: 53 HURT: 0 helped stats (abs) min: 1 max: 86 x̄: 7.47 x̃: 6 helped stats (rel) min: 1.71% max: 28.00% x̄: 9.66% x̃: 7.34% 95% mean confidence interval for instructions value: -10.58 -4.36 95% mean confidence interval for instructions %-change: -11.45% -7.88% Instructions are helped. total bundles in shared programs: 25825 -> 25670 (-0.60%) bundles in affected programs: 2057 -> 1902 (-7.54%) helped: 53 HURT: 0 helped stats (abs) min: 1 max: 26 x̄: 2.92 x̃: 2 helped stats (rel) min: 2.86% max: 30.00% x̄: 8.64% x̃: 8.33% 95% mean confidence interval for bundles value: -3.93 -1.92 95% mean confidence interval for bundles %-change: -10.69% -6.59% Bundles are helped. total quadwords in shared programs: 41359 -> 41055 (-0.74%) quadwords in affected programs: 3801 -> 3497 (-8.00%) helped: 57 HURT: 0 helped stats (abs) min: 1 max: 57 x̄: 5.33 x̃: 4 helped stats (rel) min: 1.92% max: 21.05% x̄: 8.22% x̃: 6.67% 95% mean confidence interval for quadwords value: -7.35 -3.32 95% mean confidence interval for quadwords %-change: -9.54% -6.90% Quadwords are helped. total registers in shared programs: 3849 -> 3807 (-1.09%) registers in affected programs: 167 -> 125 (-25.15%) helped: 32 HURT: 1 helped stats (abs) min: 1 max: 3 x̄: 1.34 x̃: 1 helped stats (rel) min: 20.00% max: 50.00% x̄: 26.35% x̃: 20.00% HURT stats (abs) min: 1 max: 1 x̄: 1.00 x̃: 1 HURT stats (rel) min: 16.67% max: 16.67% x̄: 16.67% x̃: 16.67% 95% mean confidence interval for registers value: -1.54 -1.00 95% mean confidence interval for registers %-change: -29.41% -20.69% Registers are helped. total threads in shared programs: 2471 -> 2520 (1.98%) threads in affected programs: 49 -> 98 (100.00%) helped: 25 HURT: 0 helped stats (abs) min: 1 max: 2 x̄: 1.96 x̃: 2 helped stats (rel) min: 100.00% max: 100.00% x̄: 100.00% x̃: 100.00% 95% mean confidence interval for threads value: 1.88 2.04 95% mean confidence interval for threads %-change: 100.00% 100.00% Threads are [helped]. total spills in shared programs: 168 -> 168 (0.00%) spills in affected programs: 0 -> 0 helped: 0 HURT: 0 total fills in shared programs: 186 -> 186 (0.00%) fills in affected programs: 0 -> 0 helped: 0 HURT: 0 Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4999>
* panfrost: Do fine-grained flushing for occlusion query resultsIcecream952020-06-302-3/+9
| | | | | | | | This allows doing occlusion queries in one frame and getting the results in the next frame without having to flush. Reviewed-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5676>
* freedreno/a4xx: fix *_NONE enum conversionShawn Guo2020-06-302-8/+8
| | | | | | | | | | | Commit e369b8931c67 ("freedreno: Use explicit *_NONE enum for undefined formats") only partially converts ~0 to *_NONE enum. It breaks texture support, and glmark2 texture scene gives a black screen. Adding the missing conversion of ~0 to *_NONE enum fixes the issue. Signed-off-by: Shawn Guo <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5693>
* radeonsi: add a debug option to enable NGG culling for tessellationMarek Olšák2020-06-304-8/+15
| | | | | Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5524>
* radeonsi: don't try to enable NGG culling for GSMarek Olšák2020-06-301-1/+2
| | | | | | | It doesn't do anything. Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5524>
* radeonsi: always use Wave64 for HS/GS/VS shader stages (except GS fast launch)Marek Olšák2020-06-301-4/+8
| | | | | Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5524>
* radeonsi: always use Wave32 for GS fast launch, because Wave64 hangsMarek Olšák2020-06-304-6/+19
| | | | | Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5524>
* radeonsi: fix NGG culling for Wave64Marek Olšák2020-06-304-14/+23
| | | | | Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5524>
* ac/gpu_info: fix num_physical_sgprs_per_simd for gfx10Marek Olšák2020-06-301-4/+1
| | | | | Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5524>
* radeonsi: don't flush in fence_server_syncMarek Olšák2020-06-301-5/+8
| | | | | | | | | | This reverts commit 50b06cbc10dbca1dfee89b529ba9b564cc4ea6f6 and fixes an Android performance regression. Fixes: 50b06cbc10dbca1dfee89b529ba9b564cc4ea6f6 "radeonsi: fix fence_server_sync() holding up extra work v2" Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5602>
* radeonsi: bump SI_NUM_SHADER_BUFFERS to 32Pierre-Eric Pelloux-Prayer2020-06-305-35/+40
| | | | | | | | | | | | | Some app uses more than 8 SSBOs (https://gitlab.freedesktop.org/mesa/mesa/-/issues/2946), so increase SI_NUM_SHADER_BUFFERS to 32 (which allows 16 SSBOs). Since we're now using a 64 bits number to track buffers, we could bump SI_NUM_SHADER_BUFFERS to 48 but that would conflict with Mesa's MAX_COMBINED_ATOMIC_BUFFERS limit (= 90). Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2122 Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5632>
* glsl: remove stale FIXMETimothy Arceri2020-06-301-3/+0
| | | | | | | | This is no longer an issue, was likely fixed years ago. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5657>
* st/glsl_to_nir: disable st_nir_lower_builtin() when packing supportedTimothy Arceri2020-06-301-6/+5
| | | | | | | | | | | | There is no need to lower builtins when uniform packing is supported by the driver. Lowering is only required by other drivers because we prepack builtin uniforms. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3140 CC: <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5656>
* glsl: define gl_LightSource members in ARB_vertex_program orderTimothy Arceri2020-06-302-4/+4
| | | | | | | | | | | | | | | | | | | | GLSL shares functionality with ARB_vertex_program but the GLSL spec defines the gl_LightSource builtin with a member order that is different from the packing expected in ARB_vertex_program. This difference introduces a need for specialist lowering code when handling builtin structs that is not required for normal uniform structs due to member location mismatches. Since gl_LightSource can't be redefined it shouldn't matter if we add the members in the order listed in the spec, just so long as we add them all. So here we rearrange the definition of the glsl builtin to reflex our internal layout and that of ARB_vertex_program. This required for the following patch. CC: <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5656>
* mesa: add _mesa_program_state_value_size() helperTimothy Arceri2020-06-302-0/+11
| | | | | | | | | | This allows us to query the uniform size required to store the state value. CC: <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5656>
* mesa: remove _mesa prefix from static functionTimothy Arceri2020-06-301-8/+7
| | | | | | Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5656>
* zink: set lower_uadd_carry in nir optionsMike Blumenkrantz2020-06-291-0/+1
| | | | | | | fixes a bunch of mulextended piglit tests Reviewed-by: Erik Faye-Lund <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5685>
* loader/dri3: Check for window destruction in dri3_wait_for_event_lockedMichel Dänzer2020-06-292-1/+38
| | | | | | | | | | | | | | | | | | | | | | | If the underlying X11 window gets destroyed, the event we're waiting for may never be delivered, in which case xcb_wait_for_special_event would hang indefinitely. Solution: 1. Use xcb_poll_for_special_event to check if an event has arrived yet. 2. If not, Wait up to ~1s for XCB's file descriptor to become readable; if it does, go back to step 1. 3. If the file descriptor didn't become readable, make a round-trip to the X server to check that the window still exists. Go back to step 1 if it does, otherwise bail. Also add an early bail-out when it's known that the window was destroyed. Cc: mesa-stable Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/116 Reviewed-by: Kenneth Graunke <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5368>
* loader/dri3: Use dri3_wait_for_event_locked in loader_dri3_wait_for_mscMichel Dänzer2020-06-291-7/+1
| | | | | | | | | | | | | | | | | | | | Before, if one thread ended up waiting in dri3_wait_for_event_locked and another one in loader_dri3_wait_for_msc at the same time, one thread could end up processing an event the other thread was waiting for, which could result in the latter thread waiting longer than necessary (possibly indefinitely). Noticed by inspection. v2: * Drop xcb_flush call from loader_dri3_wait_for_msc in favour of the one in dri3_wait_for_event_locked (Kenneth Graunke) Fixes: 7b0e8264dd21 "loader/dri3: Try to make sure we only process our own NotifyMSC events" Reviewed-by: Kenneth Graunke <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5368>
* loader/dri3: Add dri3_wait_for_event_locked full_sequence out parameterMichel Dänzer2020-06-292-3/+10
| | | | | | | | Preparation for the next commit, no functional change intended. Cc: mesa-stable Reviewed-by: Kenneth Graunke <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5368>
* v3d: Fix -Wmaybe-uninitialized compiler warning in the v33 code.Eric Anholt2020-06-291-2/+4
| | | | | | | | We weren't initializing the VCM bits in the !gs path, but v33 doesn't have GS so we can just mark it unreachable. Reviewed-by: Jose Maria Casanova Crespo <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2952>
* v3d: Enable PIPE_CAP_TGSI_TEXCOORD.Eric Anholt2020-06-292-11/+7
| | | | | | | | Dave wants to drop the !TEXCOORD path from NIR, and it's easy enough to do. Untested. Reviewed-by: Jose Maria Casanova Crespo <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2952>
* vc4: Enable PIPE_CAP_TGSI_TEXCOORD.Eric Anholt2020-06-293-18/+7
| | | | | | | | Dave wants to drop the !TEXCOORD path from NIR, and it's easy enough to do. Untested. Reviewed-by: Jose Maria Casanova Crespo <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2952>
* gallium/util: Add a helper function for point sprite handling.Eric Anholt2020-06-291-0/+19
| | | | | | | Many drivers will need to do the same thing here, so consolidate it. Reviewed-by: Jose Maria Casanova Crespo <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2952>
* turnip: enable depthBiasClampJonathan Marek2020-06-291-1/+1
| | | | | | | Passes at least dEQP-VK.dynamic_state.rs_state.depth_bias_clamp Signed-off-by: Jonathan Marek <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5678>
* turnip: enable largePointsJonathan Marek2020-06-291-3/+3
| | | | | | | Passes dEQP-VK.rasterization.primitive_size.points.point_size_* Signed-off-by: Jonathan Marek <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5678>
* freedreno/regs: add extra bits for UBWC array pitchJonathan Marek2020-06-291-2/+2
| | | | | | | | | | | This is not completely tested, but matches the max array pitch allowed by A6XX_TEX_CONST_9_FLAG_BUFFER_ARRAY_PITCH. Note this still doesn't allow all image sizes, but it allows 16384x16384 cpp=4 images to work. Signed-off-by: Jonathan Marek <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5678>
* frontends/va: Handle dynamic resolution/SVC for VP9Satyajit Sahu2020-06-292-6/+16
| | | | | | | | | | VP9 allows frame to use another resolution frame as reference frames so updating the resolution for decoder when there is a resolution change. Signed-off-by: Satyajit Sahu <[email protected]> Reviewed-by: Leo Liu <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5646>
* v3d/compiler: fix spill offsetIago Toral Quiroga2020-06-291-1/+1
| | | | | | | Reviewed-by: Alejandro Piñeiro <[email protected]> Reviewed-by: Jose Maria Casanova Crespo <[email protected]> Fixes: 97566efe5cac0ff11b ("v3d: Rematerialize MOVs of uniforms instead of spilling them.") Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5664>
* radv: add support for MRTs compaction to avoid holesSamuel Pitoiset2020-06-294-43/+41
| | | | | | | | | | | | | | | | | | | SPI_SHADER_COL_FORMAT allocates export memory and CB_SHADER_MASK map them to higher MRTs if necessary. The hardware allows to remap MRTs to avoid holes somehow. For example, if we have a scenario where MRT0 is unused and only MRT1 and MRT2 are used, SPI_SHADER_COL_FORMAT is 0x77 and CB_SHADER_MASK/CB_TARGET_MASK are 0x770 (this assumes SPI_SHADER_UINT16_ABGR is set). This allows us to remove one workaround that was added for fixing GPU hangs with DXVK. I think this is because SPI_SHADER_COL_FORMAT expects contiguous MRTs to be allocated. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5434>
* radv: use SPI_SHADER_ZERO for non-written color attachmentsSamuel Pitoiset2020-06-291-1/+2
| | | | | | | | | When colorWriteMask is 0 we can assume that this color attachment is unused. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5434>
* radv: rework 8/16-bit color attachment formats detectionSamuel Pitoiset2020-06-291-51/+38
| | | | | | | | To prepare for MRTs compaction. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5434>
* radv: adjust CB_SHADER_MASK for dual-source blending in the shader info passSamuel Pitoiset2020-06-294-3/+9
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5434>
* radv: enable VK_AMD_shader_ballot on GFX6-7 with both compiler backendsSamuel Pitoiset2020-06-295-15/+7
| | | | | | | | It gives +1-2 FPS with Doom Eternal on Pitcairn. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Daniel Schürmann <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5659>
* nir: Add new rules to optimize NOOP pack/unpack pairsBoris Brezillon2020-06-292-9/+10
| | | | | | | | | nir_load_store_vectorize_test.ssbo_load_adjacent_32_32_64_64 expectations need to be fixed accordingly. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5589>
* gallivm/nir: fix const loading on big endian systemsDave Airlie2020-06-291-1/+1
| | | | | | | | | | | | The code was expecting the lower 32-bits of the 64-bit to be what it wanted, don't be implicit, pull the value from the union. This should fix rendering on big endian systems since NIR was introduced. Fixes: 44a6b0107b37 ("gallivm: add nir->llvm translation (v2)") Reviewed-by: Timothy Arceri <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5677>
* freedreno/ir3: fix resinfo wrmaskJonathan Marek2020-06-281-1/+3
| | | | | | | | | | | resinfo always writes 3 components, which was not being taken into account Fixes these tests: dEQP-VK.renderpass.suballocation.attachment_sparse_filling.input_attachment_3 dEQP-VK.renderpass.suballocation.attachment_sparse_filling.input_attachment_7 Signed-off-by: Jonathan Marek <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5674>
* rbug: Fix rbug_delete_vs_state lock acquisition.Vinson Lee2020-06-271-1/+1
| | | | | | | | | | | | | | Fix warning reported by Coverity Scan. Double unlock (LOCK) double_unlock: mtx_unlock unlocks rb_pipe->call_mutex while it is unlocked. Fixes: 07838ff990a7 ("rbug: Use the call mutex") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3023 Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Jakob Bornecrantz <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5196>
* v3d: moving v3d simulator to src/broadcomAlejandro Piñeiro2020-06-2713-44/+204
| | | | | | | | | | | | So it could be used by both the OpenGL and the Vulkan driver. In addition to the move, some small changes were needed to be made on the API. For example, the simulator was receiving v3d_screen on initialization, and that code setted v3d_screen->sim_file. Now it returns the new sim_file created. Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5666>
* turnip: Put VK_KHR_external_fence_fd stubs backKristian H. Kristensen2020-06-261-0/+19
| | | | | | | | tu_ImportFenceFdKHR is used by tu_AcquireImageANDROID, which may or may not work, but let's at least keep things compiling until somebody has time to tie up the loose ends on the Android side. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5670>
* iris: Implement pipe->texture_subdata directlyKenneth Graunke2020-06-261-1/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Chris Wilson noted that u_default_texture_subdata's transfer path sometimes results in wasteful double copies. This patch is based on an earlier path he wrote, but updated now that we have staging blits for busy or compressed textures. Consider the case of idle, non-CCS-compressed, tiled images: The transfer-based CPU path has to return a "linear" mapping, so upon map, it mallocs a temporary buffer. u_default_texture_subdata then copies the client memory to this malloc'd buffer, and transfer unmap performs a tiled_memcpy to copy it back into the texture. By writing a direct texture_subdata() implementation, we're able to directly do a tiled_memcpy from the client memory into the destination texture, resulting in only one copy. For linear buffers, there is no advantage to doing things directly, so we simply fall back to u_default_texture_subdata()'s transfer path to avoid replicating those cases. We still may want to use GPU staging buffers for busy destinations (to avoid stalls) or CCS-compressed images (to compress the data), at which point we also fall back to the existing path. We thought to try and use a tiled temporary, but this didn't appear to help. Improves performance in x11perf -shmput500 by 1.96x on my Icelake. Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2500 Reviewed-by: Tapani Pälli <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3818>
* turnip: Properly return VK_DEVICE_LOST on queuesubmit failures.Eric Anholt2020-06-264-8/+59
| | | | | | The device lost support closely matches the anv code for the same. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2769>
* turnip: Fix error handling of DRM_MSM_GEM_INFO ioctls.Eric Anholt2020-06-261-5/+11
| | | | | | | | | | | drmCommandWriteRead gives us a -errno, and we only checked for -1 (-EPERM, incidentally). All the callers wanted 0 for errors, which they were getting by the fact that req.value was 0-initialized in our stack allocation (though this only works as long as the kernel doesn't return an error after setting req.value to something), and -EPERM not really being an answer we would expect from an ioctl at this stage in the driver. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2769>
* turnip: Do better TU_DEBUG=startup logging of drmGetDevices2() failure.Eric Anholt2020-06-261-2/+6
| | | | Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2769>
* turnip: semaphore support.Bas Nieuwenhuizen2020-06-263-44/+289
| | | | | | | | | There is only one queue for now, so for non-shared semaphores, the implementation is basically a no-op. For shared semaphores, this always uses syncobjs. This depends on syncobj support in the msm kernel driver. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2769>