Marek Olšák
ea77958fea
nir: gather information about fbfetch and dual source color
...
Reviewed-by: Eric Anholt <eric@anholt.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6758 >
2020-09-25 02:29:30 -04:00
Marek Olšák
a6abf175ef
nir: fix input/output info gathering for lowered IO
...
Ooops.
Fixes: 17af07024d - nir: gather all IO info from IO intrinsics
Reviewed-by: Eric Anholt <eric@anholt.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6758 >
2020-09-25 02:29:30 -04:00
Marek Olšák
ef98c175c0
nir: gather fs.uses_sample_qualifier from lowered IO
...
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6758 >
2020-09-25 02:29:30 -04:00
Marek Olšák
7b108e6ac4
nir: set system_values_read for all intrinsics
...
Reviewed-by: Eric Anholt <eric@anholt.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6758 >
2020-09-25 02:29:30 -04:00
Marek Olšák
abe9588ff0
nir: gather tess.tcs_cross_invocation info from lowered IO intrinsics
...
Reviewed-by: Eric Anholt <eric@anholt.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6758 >
2020-09-25 02:29:30 -04:00
Marek Olšák
10be706778
nir: gather indirect info from lowered IO intrinsics
...
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6758 >
2020-09-25 02:29:30 -04:00
Jason Ekstrand
3173367a47
spirv: vtn_fail with a nice message on unsupported rounding modes
...
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6845 >
2020-09-25 01:43:28 +00:00
Vinson Lee
03e7b75c22
gallium/dri2: Move image->texture assignment after image NULL check.
...
Fix defect reported by Coverity Scan.
Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking image suggests that it may be
null, but it has already been dereferenced on all paths leading to
the check.
Fixes: ad609bf55a ("frontend/dri: Implement mapping individual planes.")
Signed-off-by: Vinson Lee <vlee@freedesktop.org >
Reviewed-by: Tapani Pälli <tapani.palli@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6807 >
2020-09-25 00:47:26 +00:00
Vinson Lee
4bd0df0e4a
r600/sfn: Initialize GPRValue member m_pin_to_channel.
...
Fix defects reported by Coverity Scan.
Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member m_pin_to_channel is not
initialized in this constructor nor in any functions that it calls.
Signed-off-by: Vinson Lee <vlee@freedesktop.org >
Reviewed-by: Gert Wollny <gert.wollny@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6830 >
2020-09-24 17:29:04 -07:00
Eric Anholt
974981c4e6
gallium/drm: Make the pipe loader handle the driconf merging.
...
We can pretty easily handle merging the driver's driconf with the common
driverconf right there, rather than pushing that to each driver.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6751 >
2020-09-24 16:35:17 -07:00
Eric Anholt
87392385b5
gallium/drm: Define the DRM entrypoints in drm_helper.h
...
This cuts even more code duplication.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6751 >
2020-09-24 16:35:17 -07:00
Eric Anholt
bc10b4968e
gallium/drm: Refactor the stub screen create functions.
...
This gives me one place to document why it works this way. This does make
the debug message a little less helpful ("etna" instead of "etnaviv" and
"vmwgfx" instead of "svga", but you should only be able to reach this when
doing something like trying the radeon/nouveau vdpau target on the wrong
DRM device for example.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6751 >
2020-09-24 15:34:52 -07:00
Eric Anholt
9ec28b8d22
gallium/drm: Deduplicate screen creation for the dynamic (clover) pipe loader.
...
We can just reuse drm_helper.h, which has either the real code or the stub
for all pipe_screens based on the GALLIUM_* driver defines, and the
dynamic pipe loader's .c build will only define one GALLIUM_* driver
define. The remaining stubs should get GCed by the linker.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6751 >
2020-09-24 15:34:52 -07:00
Jason Ekstrand
472a20c5fc
radeonsi: Only call nir_lower_var_copies at the end of the opt loop
...
In 283ad85944 , radeonsi started using nir_find_var_copies. However,
it was also calling nir_lower_var_copies in the optimization loop and
the two can end up fighting. The simple solution is to wait to lower
copies until the end of the optimization loop.
Fixes: 283ad85944
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3550
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6841 >
2020-09-24 21:01:30 +00:00
Mike Blumenkrantz
7971918924
zink: reorder create_stream_output_target to fix failure case leak
...
the previous version of this leaked a reference to the streamout buffer here
thanks to deltragon on my blog for pointing this out!
Fixes: 37778fcd9a ("zink: implement transform feedback support to finish off opengl 3.0")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6457 >
2020-09-24 20:55:02 +00:00
Mike Blumenkrantz
bc5c0433be
zink: apply viewport count when creating pipelines
...
without VK_EXT_extended_dynamic_state, we need to pass this directly or
else only the first viewport will work
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6349 >
2020-09-24 20:48:51 +00:00
Mike Blumenkrantz
cc939fe9b7
zink: correctly set up fb-sized scissors for each viewport
...
each viewport must have a corresponding scissor, so we need to generate
an array of these to ensure our states match up
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6349 >
2020-09-24 20:48:51 +00:00
Mike Blumenkrantz
8a2ddcb4a9
zink: set multiviewport cap in ntv when gl_ViewportIndex is a written output
...
this cap varies based on the shader stage, but it must be enabled any time this
output is written
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6349 >
2020-09-24 20:48:51 +00:00
Mike Blumenkrantz
09be30b9e4
zink: move viewport count to zink_gfx_pipeline_state
...
this is part of the pipeline state (there's an extension for setting it
dynamically but we don't supprot that atm
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6349 >
2020-09-24 20:48:51 +00:00
Mike Blumenkrantz
818bd61099
zink: implement ARB_instanced_arrays
...
this is just a simple case of connecting up the vertex state to the pipeline
state
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6270 >
2020-09-24 20:40:39 +00:00
Mike Blumenkrantz
0051551701
zink: verify that src and dst aspects are the same in resource_copy_region hook
...
this is required by spec
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6263 >
2020-09-24 20:31:37 +00:00
Mike Blumenkrantz
6feec2d40e
zink: clamp min created fb size to 1x1
...
this is required by spec
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6263 >
2020-09-24 20:31:37 +00:00
Mike Blumenkrantz
9ce1e99913
zink: use correct layer count when creating framebuffer
...
pipe_framebuffer_state::layers doesn't necessarily reflect the value we
need to use here, so we can use the util function to verify
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6263 >
2020-09-24 20:31:37 +00:00
Mike Blumenkrantz
e30367a273
zink: use correct number of samples on framebuffer in set_framebuffer_state
...
state->samples doesn't necessarily reflect the correct value here, so we need
to use the util function
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6263 >
2020-09-24 20:31:37 +00:00
Mike Blumenkrantz
f6c87216d3
zink: use correct value for color buffer sample count when creating renderpass
...
nr_samples is valid on the texture pipe_resource, not the surface
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6263 >
2020-09-24 20:31:37 +00:00
Kenneth Graunke
140f53e646
Revert "nir: replace lower_ffma and fuse_ffma with has_ffma"
...
This reverts commit 939ddf3f67 .
Intel has a separate pass for fusing FFMAs selectively. We split
these flags in commit 1b72c31e1f and
the reasoning still stands. The patch being reverted was just a
cleanup, so there should be no issue with reverting it.
Acked-by: Matt Turner <mattst88@gmail.com >
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6849 >
2020-09-24 13:11:50 -07:00
Jonathan Marek
d8cdcd4adf
radv: use syncobj for wsi fence
...
Note: this also fixes vk_object_base_init() not being called for the wsi
fences, now that it goes through radv_CreateFence().
Signed-off-by: Jonathan Marek <jonathan@marek.ca >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6846 >
2020-09-24 14:58:48 -04:00
Jonathan Marek
1aa1b9f86c
radv: fix incorrect ResetFences path for WSI fence
...
Looks like this path is meant for RADV_FENCE_WINSYS type fences.
Signed-off-by: Jonathan Marek <jonathan@marek.ca >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6846 >
2020-09-24 14:19:23 -04:00
Pierre-Eric Pelloux-Prayer
90b98c0649
amd/tmz: move uses_secure_bos to radeon_winsys
...
This allows to inline radeon_uses_secure_bos calls and reduce CPU overhead.
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6049 >
2020-09-24 14:51:16 +00:00
Pierre-Eric Pelloux-Prayer
2479689968
radeonsi/tmz: add workaround for mpv/vaapi subtitles
...
Subtitles are rendering with an upload through a staging texture.
So the sequence is:
1. draw video (with a secure cs)
2. copy staging texture to the real texture (via si_resource_copy_region) in
a non-secure cs.
3. draw video (with a secure cs)
Step 2 and 3 both generates a flush with RADEON_FLUSH_TOGGLE_SECURE_SUBMISSION.
These flushes are executed quite late: right before doing the draw/dispatch,
so maybe the issue here is the handling of dependencies.
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6049 >
2020-09-24 14:51:16 +00:00
Pierre-Eric Pelloux-Prayer
2c6643546a
radeonsi/tmz: add a tmz variant for sctx::eop_bug_scratch
...
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6049 >
2020-09-24 14:51:16 +00:00
Pierre-Eric Pelloux-Prayer
133895574c
radeonsi: disable primitive discard if tmz is in use
...
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6049 >
2020-09-24 14:51:16 +00:00
Pierre-Eric Pelloux-Prayer
8e2768bbfb
radeonsi/tmz: add tmz variant for sctx::tess_rings
...
tess_rings must be encrypted when used in a secure job so this commit
introduces a tess_rings_tmz resource.
The cs_preamble_state doesn't contain the tess_rings address anymore since
it can change. The tess_rings related registers go in a separate preamble.
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6049 >
2020-09-24 14:51:16 +00:00
Pierre-Eric Pelloux-Prayer
2589888ce9
radeonsi/tmz: add tmz variant of sctx::wait_mem_scratch
...
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6049 >
2020-09-24 14:51:16 +00:00
Pierre-Eric Pelloux-Prayer
de088daccc
radeonsi/tmz: fail si_texture_transfer_map if tex is encrypted
...
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6049 >
2020-09-24 14:51:16 +00:00
Pierre-Eric Pelloux-Prayer
55b018b634
amd/winsys: add RADEON_FLUSH_TOGGLE_SECURE_SUBMISSION
...
Instead of exposing a cs_set_secure() callback that always needs a call
to si_flush_gfx_cs before a switch, this commit introduces a new
flag to switch between secure and non-secure on submissions.
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6049 >
2020-09-24 14:51:16 +00:00
Pierre-Eric Pelloux-Prayer
1b0d660cbc
radeonsi/tmz: allow secure job if the app made a tmz allocation
...
This commit makes TMZ always allowed instead of being either off or forced-on
with AMD_DEBUG=tmz.
With this change:
- secure job can be used as soon as the application made a tmz allocation. Driver
internal allocations are not enough to enable secure jobs (if tmz is supported
and enabled by the kernel)
- AMD_DEBUG=tmz forces all scanout/depth/stencil buffers to be allocated as TMZ.
This is useful to test app thats don't explicitely support protected content.
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6049 >
2020-09-24 14:51:16 +00:00
Pierre-Eric Pelloux-Prayer
f5ec617677
ac/gpu_info: add detection of TMZ support
...
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6049 >
2020-09-24 14:51:16 +00:00
Pierre-Eric Pelloux-Prayer
846e393142
amd: add AMDGPU_IDS_FLAGS_TMZ definition to amdgpu_drm.h
...
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6049 >
2020-09-24 14:51:16 +00:00
Pierre-Eric Pelloux-Prayer
5e4aecec93
radeonsi: introduce SI_RESOURCE_FLAG_INTERNAL / RADEON_FLAG_DRIVER_INTERNAL
...
Tag allocations as driver internal.
Some of these allocations will need to be doubled to handle TMZ (one secure bo,
one normal bo) but these allocations shouldn't switch the winsys in "the app
is using TMZ".
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6049 >
2020-09-24 14:51:16 +00:00
Pierre-Eric Pelloux-Prayer
131412cc4d
radeonsi/tmz: allocate depth/stencil buffers as encrypted
...
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6049 >
2020-09-24 14:51:16 +00:00
Pierre-Eric Pelloux-Prayer
0a59d2a3e9
radeonsi/tmz: add safety assert when tmz is enabled
...
This commit adds asserts verifying the following conditions when
using a secure job:
- fb textures are encrypted (both colors and depth/stencil buffers)
- all writeable bo are encrypted
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6049 >
2020-09-24 14:51:16 +00:00
Pierre-Eric Pelloux-Prayer
59b267dea4
radeonsi/tmz: use secure job if using an encrypted z/s buffer
...
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6049 >
2020-09-24 14:51:16 +00:00
Pierre-Eric Pelloux-Prayer
5bc24fe283
radeonsi/tmz: use secure job if framebuffer has dcc
...
Fixes a hang with DCC.
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6049 >
2020-09-24 14:51:16 +00:00
Jonathan Marek
cec0bc73e5
turnip: rework fences to use syncobjs
...
Fences are now just a syncobj, which makes our life easier.
The next step will be to fill out ImportFenceFdKHR()/GetFenceFdKHR().
Signed-off-by: Jonathan Marek <jonathan@marek.ca >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6683 >
2020-09-24 14:37:13 +00:00
Jonathan Marek
c23206757a
turnip: require syncobj support
...
Note: this means turnip requires kernel 5.8 (or older with syncobj patch).
Signed-off-by: Jonathan Marek <jonathan@marek.ca >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6683 >
2020-09-24 14:37:13 +00:00
Jonathan Marek
89ffe859a8
turnip: add a fd field to tu_device
...
Avoid the extra indirect for this commonly used field.
Signed-off-by: Jonathan Marek <jonathan@marek.ca >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6683 >
2020-09-24 14:37:13 +00:00
Jonathan Marek
ec4fe92c83
turnip: delete unused tu_fence_signal function
...
Signed-off-by: Jonathan Marek <jonathan@marek.ca >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6683 >
2020-09-24 14:37:13 +00:00
Erik Faye-Lund
9e13a16c97
mesa: handle GL_FRONT after translating to it
...
Without this, we end up throwing errors on code along these lines when
rendering using single-buffering:
GLint att;
glGetIntegerv(GL_READ_BUFFER, &att);
glGetFramebufferAttachmentParameteriv(GL_READ_FRAMEBUFFER, att, ...);
This is because we internally translate GL_BACK (which is what
glGetIntegerv returned) to GL_FRONT, which we don't handle in the
Desktop GL case. So let's start handling it.
This fixes the GLTF-GL33.gtf21.GL2FixedTests.buffer_color.blend_color
test for me.
Fixes: e6ca6e587e ("mesa: Handle pbuffers in desktop GL framebuffer attachment queries")
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6815 >
2020-09-24 14:11:29 +00:00
Samuel Pitoiset
005d9d2219
ci: adjust RadeonSI rules
...
src/amd/vulkan is specific to RADV and shouldn't trigger RadeonSI CI.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com >
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6839 >
2020-09-24 13:54:49 +00:00