Commit Graph

149152 Commits

Author SHA1 Message Date
Melissa Wen a7052dcf2c v3dv: enable multiple semaphores for csd job
Whenever v3d kernel-driver supports multisync extension, use it to
allow add multiple semaphores as csd job dependency.

Signed-off-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13178>
2022-01-21 10:59:17 +00:00
Melissa Wen ad09e50129 v3dv: enable multiple semaphores for tfu job
Whenever v3d kernel-driver supports multisync extension, use it to
enable more than one semaphores in a tfu job.

Signed-off-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13178>
2022-01-21 10:59:17 +00:00
Melissa Wen ff8586c345 v3dv: enable multiple semaphores on cl submission
Whenever v3d kernel-driver supports multisync extension, use it to
enable more than one semaphores in cl submission. In CL, we have two
kind of job (bin and render), therefore, we need also to determine
the stage to sync, that means to add job dependencies/wait
semaphores.

Also, as we currently process all signal semaphores of a cmd buffer
batch together in the submit master thread (when the last wait
thread completes), there isn't now a situation in which GPU jobs
need to handle signal VkSemaphores.

Signed-off-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13178>
2022-01-21 10:59:17 +00:00
Melissa Wen 85c49db10d v3dv: check multiple semaphores capability
Check if kernel-driver supports multisync extension

Signed-off-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13178>
2022-01-21 10:59:17 +00:00
Melissa Wen 264dedf690 drm-uapi/v3d: extend interface for multiple semaphores support
Extends command submission ioctls to support multiple semaphores through
generic ioctl extension design. In this approach, a multisync extension
subclasses a generic ioctl extension struct (base) and enables more than
one wait and signal semaphores. Multisync extension also uses v3d_queue
to specify the wait_stage, i.e. which job should sync before start (wait
semaphores).

Signed-off-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13178>
2022-01-21 10:59:17 +00:00
Melissa Wen d5bd18fbb3 v3dv: store wait semaphores in event_wait_cpu_job_info
Instead of a boolean (sem_wait) in v3dv_event_wait_cpu_job_info,
that is used to determine wait condition for jobs put in a wait
thread, copy the wait semaphores data and store it as struct
v3dv_submit_info_semaphores. In the following patches we enable
multiple semaphores in GPU jobs, and therefore we need this data
to add wait semaphores as job dependencies for pending jobs
submitted from a wait thread.

Signed-off-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13178>
2022-01-21 10:59:17 +00:00
Melissa Wen d148379edf v3dv: wrap wait semaphores info in v3dv_submit_info_semaphores
Instead of pass pSubmit to queue_submit_cmd_buffer, create a struct
v3dv_submit_info_semaphores to wrap semaphores data from VkSubmitInfo.
In the next commit, this struct will help to handle wait condition for
jobs submitted in a wait event context, since we need to hold this
data when handle wait events and pass it to queue_submit_job() called
from wait threads. The main goal is to allow multiple wait semaphores
in a job submission. Later, this struct will be extended to include a
copy of signal semaphores too.

Signed-off-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13178>
2022-01-21 10:59:17 +00:00
Melissa Wen 09991fc47b v3dv: drop unused variable on handle_set_event_cpu_job
is_wait_thread is passed, but not actually used; and cpu_queue_handle_idle
is in charge to handle wait threads spawned before this one.

Signed-off-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13178>
2022-01-21 10:59:17 +00:00
Pierre-Eric Pelloux-Prayer 3b4d4c7d84 mesa: use less temporaries in build_lighting
Preallocating temporaries can cause "out of temporaries" error.
Switch to on-demand allocation.

Growing temp_in_use would be an alternative, but some drivers
support less than 64 temps (see PIPE_SHADER_CAP_MAX_TEMPS) so
this wouldn't help them.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5777
Fixes: 272acbed0e ("mesa: merge STATE_LIGHTPROD parameters")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14590>
2022-01-21 09:59:16 +00:00
Samuel Pitoiset b8c518f0fb radv: fix computing the number of color samples if no attachments
When no color attachments, the rasterization samples should be used.

Fixes: 0222dace90 ("radv: Support VK_KHR_dynamic_rendering for pipeline creation.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5830
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14642>
2022-01-21 09:38:37 +00:00
Pierre-Eric Pelloux-Prayer 4e4a2d0f97 driconf: enable vs_position_always_invariant for Dirt Rally
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5648
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14614>
2022-01-21 10:00:35 +01:00
Pavel Ondračka b5b105df96 r300: properly initialize new_vs in r300_draw_init_vertex_shader
Fixes the following valgrind warnings:
 Conditional jump or move depends on uninitialised value(s)
    at 0x5D1298C: draw_pt_so_emit_prepare (draw_pt_so_emit.c:95)
    by 0x5D89FD7: llvm_middle_end_prepare (draw_pt_fetch_shade_pipeline_llvm.c:319)
    by 0x5D13BFF: vsplit_prepare (draw_pt_vsplit.c:229)
    by 0x5D0D5D8: draw_pt_arrays.isra.0 (draw_pt.c:124)
    by 0x5D0DA08: draw_instances (draw_pt.c:484)
    by 0x5D0DEB9: draw_vbo (draw_pt.c:610)
    by 0x5E847D6: r300_swtcl_draw_vbo (r300_render.c:901)
    by 0x5D67125: u_vbuf_draw_vbo (u_vbuf.c:1470)
    by 0x5CFCAD3: cso_multi_draw (cso_context.c:1639)
    by 0x58FEC37: st_draw_gallium (st_draw.c:186)
    by 0x5A486BA: _mesa_draw_arrays.part.0 (draw.c:1323)
    by 0x48B4E27: stub_glDrawArrays (piglit-dispatch-gen.c:12421)
  Uninitialised value was created by a stack allocation
    at 0x5E90D3F: r300_draw_init_vertex_shader (r300_vs_draw.c:313)

 Conditional jump or move depends on uninitialised value(s)
    at 0x5D175D9: draw_create_vertex_shader (draw_vs.c:70)
    by 0x5E90E7A: r300_draw_init_vertex_shader (r300_vs_draw.c:366)
    by 0x5E8751F: r300_create_vs_state (r300_state.c:1950)
    by 0x594453B: st_create_common_variant (st_program.c:888)
    by 0x594720C: st_get_common_variant (st_program.c:973)
    by 0x59484B6: st_precompile_shader_variant (st_program.c:1994)
    by 0x59484B6: st_finalize_program (st_program.c:2056)
    by 0x58F0571: st_program_string_notify (st_cb_program.c:128)
    by 0x5928C9B: st_link_tgsi (st_glsl_to_tgsi.cpp:7514)
    by 0x5904B53: st_link_shader (st_glsl_to_ir.cpp:178)
    by 0x58D3E08: _mesa_glsl_link_shader (link_program.cpp:91)
    by 0x58865C7: link_program (shaderapi.c:1363)
    by 0x58865C7: link_program_error.part.0 (shaderapi.c:1474)
    by 0x48DBC5A: stub_glLinkProgram (piglit-dispatch-gen.c:34426)
  Uninitialised value was created by a stack allocation
    at 0x5E90D4F: r300_draw_init_vertex_shader (r300_vs_draw.c:313)

Based on Filip Gawin's
   r300: set new_vs.type to PIPE_SHADER_IR_TGSI

CC: mesa-stable
Reviewed-by: Emma Anholt <emma@anholt.net>
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14620>
2022-01-21 03:35:29 +00:00
Dave Airlie 5decf569fc mesa/st: move perf query test to st_context, drop files.
This removes the unused cb perf query files

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>
2022-01-21 01:18:20 +00:00
Dave Airlie 3f8e7b8735 mesa/st: drop lots of perfquery wrappers
Just direct call into pipe driver.

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>
2022-01-21 01:18:19 +00:00
Dave Airlie 78d13fdbb2 mesa/st: drop some bindless wrappers
Just call directly into pipe

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>
2022-01-21 01:18:19 +00:00
Dave Airlie 8467047f6d mesa/st: move memory query into mesa.
Drop the gl_memory_info type as it's equiv to the pipe one, and
internal

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>
2022-01-21 01:18:19 +00:00
Dave Airlie 6e99b10632 mesa/st: move shader completion into mesa
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>
2022-01-21 01:18:19 +00:00
Dave Airlie 03f180d88b mesa/st: inline st_max_shader_compiler_threads
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>
2022-01-21 01:18:19 +00:00
Dave Airlie 74d40c68dc mesa/ctx: store screen pointer in ctx as well
This is actually useful to have.

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>
2022-01-21 01:18:19 +00:00
Dave Airlie df9d5795c1 mesa/st: move evaluate depth values into mesa
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>
2022-01-21 01:18:19 +00:00
Dave Airlie a64e5c02bd mesa/st/vdpau: direct call the vdpau functions.
This provides versions when vdpau is turned off, removes dd.h entries

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>
2022-01-21 01:18:19 +00:00
Dave Airlie 0f8a3a7175 mesa/st: drop release all sampler views wrapper
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>
2022-01-21 01:18:19 +00:00
Dave Airlie 31d3e3ebeb mesa/st: move st_TexParameter into mesa
Some places this just passes an always true pname, so just call
sampler view invalidate directly

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>
2022-01-21 01:18:19 +00:00
Dave Airlie 96b57faf35 mesa/st: drop useless tex parameter calls.
st_TexParameter never does anything for these

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>
2022-01-21 01:18:19 +00:00
Dave Airlie 9244c792f9 mesa/dd: drop GetProgramBinaryDriverSHA1
Just call direct into state tracker

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>
2022-01-21 01:18:19 +00:00
Dave Airlie 4a055c1940 mesa/st: move pin l3 cache to direct check/call.
Drop another dd.h entry

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>
2022-01-21 01:18:19 +00:00
Dave Airlie 10ac88b72f mesa/st: drop emit string marker device table entry.
Just check for the gallium callback instead

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>
2022-01-21 01:18:19 +00:00
Dave Airlie 5618fac786 mesa/st: directly call the uuid get funcs.
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>
2022-01-21 01:18:19 +00:00
Dave Airlie ec0d62ceb5 mesa/st: drop last user of st_Enable.
Move the debug output piece into mesa

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>
2022-01-21 01:18:19 +00:00
Dave Airlie 84fe99b2a0 mesa/st: migrate debug callback code into mesa
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>
2022-01-21 01:18:19 +00:00
Dave Airlie bc122e0769 mesa/st: remove st_context from debug callback
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>
2022-01-21 01:18:19 +00:00
Dave Airlie e344a117af mesa/st: move intel blackhole noop enable to frontend
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>
2022-01-21 01:18:19 +00:00
Mike Blumenkrantz 129e31cd4f zink: hook up planar image format creation
it'll explode if used for anything, but this is how it's done

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13865>
2022-01-21 01:02:18 +00:00
Mike Blumenkrantz bff042fd43 zink: link with vulkan utils
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13865>
2022-01-21 01:02:18 +00:00
Ian Romanick 926d78a645 ntt: Extend ntt_compile::addr_declared and ntt_compile::addr_reg
This was identified by Coverity.  4bb9c0a28a added uses of a third
address register, but the arrays for tracking address registers only
have two slots.

Add back a version of the assertion from before 4bb9c0a28a to help
prevent future problems.  I don't think any drivers that would hit
this path use NIR-to-TGSI yet, so it may be moot.

Reviewed-by: Matt Turner <mattst88@gmail.com>
CID: 1496942
CID: 1496944
Fixes: 4bb9c0a28a ("nir_to_tgsi: Use the same address reg mappings as GLSL-to-TGSI did.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14487>
2022-01-21 00:25:38 +00:00
Rhys Perry 495debebad nir/algebraic: optimize expressions using fmulz/ffmaz
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13436>
2022-01-20 22:54:42 +00:00
Rhys Perry 14b8227083 nir: add some missing nir_alu_type_get_base_type
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13436>
2022-01-20 22:54:42 +00:00
Rhys Perry f2fbba7920 nir/algebraic: optimize open-coded fmulz/ffmaz
This pattern will be found in future versions of D3D9 DXVK.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13436>
2022-01-20 22:54:42 +00:00
Rhys Perry 312a284980 nir/algebraic: add ignore_exact() wrapper
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13436>
2022-01-20 22:54:42 +00:00
Rhys Perry f68797ead7 aco: create v_mac_legacy_f32/v_fmac_legacy_f32
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13436>
2022-01-20 22:54:42 +00:00
Rhys Perry 43e32ad074 aco: consider legacy multiplications in optimizer
Optimize omod, -(a*b), b2f(a)*b, a*1, a*0 and create MAD/FMA.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13436>
2022-01-20 22:54:42 +00:00
Rhys Perry e7f91b194a radv,aco,ac/llvm: implement fmulz and ffmaz
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13436>
2022-01-20 22:54:42 +00:00
Rhys Perry 7f05ea3793 nir: add nir_op_fmulz and nir_op_ffmaz
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13436>
2022-01-20 22:54:42 +00:00
Ian Romanick 945fb51fb5 intel/fs: Fix gl_FrontFacing optimization on Gfx12+
It's not obvious why the (gl_FrontFacing ? -1.0 : 1.0) case was handled
different for Gfx12+ than for previous generations, and it's not
correct.  It tries to negate the result as an integer, and it does this
before the mask operation that clears the other bits in the value.

When we eventually support dual-SIMD8 dispatch, the other front-facing
bit is in g1.6 at bit 15, so similar code should be possible there.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Fixes: c92fb60007 ("intel/fs/gen12: Implement gl_FrontFacing on gen12+.")
Closes: #5876
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14625>
2022-01-20 22:37:18 +00:00
Mike Blumenkrantz 4aaedc20c1 zink: fix non-modifer dmabuf usage
drivers/hardware lacking VK_EXT_image_drm_format_modifier can still use dmabuf,
but that setup has to do the old copy to linear scanout instead of copy to
modifier scanout

this requires a couple extra checks to be added to handle the case

Fixes: 619438bf7ce ("zink: check EXT_image_drm_format_modifier for dmabuf support")

fixes #5836

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14597>
2022-01-20 21:33:54 +00:00
Renato Pereyra 4d95a7f800 anv: add helper methods related to enabling CCS for external images
Also, clarify/improve related comments

Signed-off-by: Renato Pereyra <renatopereyra@google.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14416>
2022-01-20 11:37:29 -08:00
Renato Pereyra b664349973 anv: Enable implicit CCS for external images
AUX and clear state is stored in the VkDevice private binding

Signed-off-by: Renato Pereyra <renatopereyra@google.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14416>
2022-01-20 11:37:15 -08:00
Mike Blumenkrantz a4c9276de2 docs: add features/relnotes for zink sparse texture support
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14381>
2022-01-20 15:51:30 +00:00
Mike Blumenkrantz f86e97ab34 zink: ARB_sparse_texture2
there is no vulkan driver that can currently pass all these tests, and
some of the tests themselves are broken, but this seems like it should be
correct

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14381>
2022-01-20 15:51:30 +00:00
Mike Blumenkrantz 7c918a807b zink: enable ARB_sparse_texture pipe caps
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14381>
2022-01-20 15:51:30 +00:00