platform/upstream/mesa.git
20 months agointel: Add intel_kmd_type parameter to intel_engine_get_info()
José Roberto de Souza [Mon, 22 Aug 2022 19:56:27 +0000 (12:56 -0700)]
intel: Add intel_kmd_type parameter to intel_engine_get_info()

This will be needed to execute proper function to fetch engines from
kernel mode driver.

Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20773>

20 months agointel/dev: Detect what is the kernel mode driver loaded
José Roberto de Souza [Thu, 4 Aug 2022 20:21:05 +0000 (13:21 -0700)]
intel/dev: Detect what is the kernel mode driver loaded

Intel GPUs will have a new kernel mode driver, support for some
platforms will overlap so we will need to detect in runtime what is
the kernel mode driver loaded for each device.

Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20773>

20 months agoradeonsi: correctly declare YUV420_10 RT Format support for AV1
Philip Langdale [Mon, 23 Jan 2023 10:36:26 +0000 (18:36 +0800)]
radeonsi: correctly declare YUV420_10 RT Format support for AV1

This appears to have been an oversight. AV1 Main profile requires
support for both 8bit and 10bit, and so we should always declare
support for the YUV420_10 RT Format. This support then cascades
into supporting the appropriate surface formats and meets expectations
of vaapi clients (especially ffmpeg based) on how to detect support
for these formats.

Note that the commit [0b02db3007] was also made with the intention of
fixing this problem, but it does so in a non-idiomatic way. With that
change, there is still no declared YUV420_10 RT Format, and instead
the P010 surface format is reported under the YUV420 RT Format. This
is not going to work with all vaapi clients. I recommend that this
commit be reverted.

Signed-off-by: Philip Langdale <philipl@overt.org>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20870>

20 months agoradv: Merge the leaf and internal converter
Konstantin Seurer [Wed, 18 Jan 2023 15:34:55 +0000 (16:34 +0100)]
radv: Merge the leaf and internal converter

We have everything we need in the internal one already so we can just
encode leaf nodes there. Since this functionality isn't split anymore,
the shader was renamed to "encode".

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20768>

20 months agoradv: skip creation of null TLAS for null winsys
Rhys Perry [Tue, 24 Jan 2023 14:15:26 +0000 (14:15 +0000)]
radv: skip creation of null TLAS for null winsys

This won't work because there are no memory types.

Fixes fossilize replay with NULL winsys.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Fixes: 31ca19589fe ("radv: Create a null TLAS as meta state")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20878>

20 months agoci/b2c: uprev to b2c v0.9.9
Martin Roukala (né Peres) [Fri, 20 Jan 2023 06:35:20 +0000 (08:35 +0200)]
ci/b2c: uprev to b2c v0.9.9

No functional change expected, just a minor reduction in size compared
to the previous version and updated components.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20806>

20 months agoci/android: add android to the ci
Helen Koike [Mon, 21 Nov 2022 17:37:22 +0000 (14:37 -0300)]
ci/android: add android to the ci

Add android to the ci, so we can test mesa on it.

Add debian/x86_test-android and test-android jobs.
One build the container to run tests, and the other execute the tests.

Android is executed on top of cuttlefish VM with virgl.
Mesa libs are replaced on the cuttlefish image, and deqp and deqp-runner
are used to execute tests.

Co-developed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Sergi Blanch Torné <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20019>

20 months agoci: export artifacts from debian-android
Helen Koike [Mon, 21 Nov 2022 17:14:24 +0000 (14:14 -0300)]
ci: export artifacts from debian-android

export mesa build from this job, so it can be picked up by an android
testing job.

Co-developed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Sergi Blanch Torné <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20019>

20 months agoci: debian-android compile virgl
Helen Koike [Mon, 21 Nov 2022 18:02:44 +0000 (15:02 -0300)]
ci: debian-android compile virgl

compile virgl so we can test android on a vm.

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Sergi Blanch Torné <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20019>

20 months agoci: compile deqp-runner for android
Helen Koike [Mon, 21 Nov 2022 17:27:33 +0000 (14:27 -0300)]
ci: compile deqp-runner for android

To allow testing mesa on android, we need deqp-runner compiled for it,
so we can add android on the ci.

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Sergi Blanch Torné <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20019>

20 months agoci: compile deqp for android
Helen Koike [Mon, 21 Nov 2022 17:31:39 +0000 (14:31 -0300)]
ci: compile deqp for android

To allow testing mesa on android, we need deqp compiled for it, so we
can add android on the ci.

Add patch that redirect logs to stdout instead of logcat.
Compile deqp to allow running it directly from command line instead of
Android activity.

Co-developed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Sergi Blanch Torné <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20019>

20 months agoci: Use NDK 25b to build for the Android ABI level 33
Tomeu Vizoso [Mon, 21 Nov 2022 17:17:22 +0000 (14:17 -0300)]
ci: Use NDK 25b to build for the Android ABI level 33

25b is the currently supported NDK, as per the below:

https://github.com/android/ndk/wiki

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Sergi Blanch Torné <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20019>

20 months agoci/android: move sdk version and ndk to a job variable
Helen Koike [Fri, 2 Dec 2022 14:30:44 +0000 (11:30 -0300)]
ci/android: move sdk version and ndk to a job variable

make it easier to update sdk version and ndk without the need to make
changes all over the code.

Suggested-by: David Heidelberg <david.heidelberg@collabora.com>
Signed-off-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Sergi Blanch Torné <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20019>

20 months agoci: Build for Android with libbacktrace=false
Tomeu Vizoso [Wed, 16 Nov 2022 08:27:24 +0000 (09:27 +0100)]
ci: Build for Android with libbacktrace=false

This is needed for using this build inside Android systems with VNDK
enabled, as in recent versions of it libbacktrace isn't available to
libraries in /vendor.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Sergi Blanch Torné <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20019>

20 months agoandroid: Cleanup unneeded headers from the sync stub
Tomeu Vizoso [Wed, 16 Nov 2022 07:03:01 +0000 (08:03 +0100)]
android: Cleanup unneeded headers from the sync stub

These were probably copy pasted from the previous unified stub.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Sergi Blanch Torné <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20019>

20 months agoandroid: Make libbacktrace optional again
Tomeu Vizoso [Tue, 15 Nov 2022 08:48:02 +0000 (09:48 +0100)]
android: Make libbacktrace optional again

For the same reason why we used to have USE_LIBBACKTRACE with the old
Android makefiles, allow to build Mesa without linking to it.

In recent VNDK versions, libbacktrace isn't available.

When building without linking libbacktrace, for some reason some symbols
related to C++ exception handling are exposed. Allow them in the symbols
check script.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Sergi Blanch Torné <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20019>

20 months agoandroid: allow system = 'android' on cross file
Helen Koike [Sat, 3 Dec 2022 12:42:19 +0000 (09:42 -0300)]
android: allow system = 'android' on cross file

Allow building with system = 'android' on the cross file.
This avoids creating symlinks for the libs.

Suggested-by: Roman Stratiienko <r.stratiienko@gmail.com>
Suggested-by: David Heidelberg <david.heidelberg@collabora.com>
Signed-off-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Sergi Blanch Torné <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20019>

20 months agoci: move patches to patches directory
Helen Koike [Thu, 1 Dec 2022 23:24:12 +0000 (20:24 -0300)]
ci: move patches to patches directory

Group all patches in a directory.
Improve organization to organize the current and future patches.

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Sergi Blanch Torné <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20019>

20 months agoci/debian-android: move pkgconfig paths to the cross file
Helen Koike [Thu, 1 Dec 2022 20:42:17 +0000 (17:42 -0300)]
ci/debian-android: move pkgconfig paths to the cross file

Move pkgconfig paths out of the job script into the cross file.
Use pkg_config_libdir on the cross file instead.
Which makes more sense and cleaner code.

Suggested-by: David Heidelberg <david.heidelberg@collabora.com>
Suggested-by: Roman Stratiienko <r.stratiienko@gmail.com>
Signed-off-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Sergi Blanch Torné <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20019>

20 months agopanfrost: fix off-by-one when exporting format modifiers
Italo Nicola [Tue, 24 Jan 2023 14:23:56 +0000 (14:23 +0000)]
panfrost: fix off-by-one when exporting format modifiers

`count` should not be incremented before the check, because it causes
the modifiers array to be filled starting from position 1 instead of 0.

This bug causes one less format modifier to be available than would
otherwise be expected, which could then lead to a dmabuf query failing
in situations where a supported modifier wouldn't be advertised.

It also causes garbage data to be advertised as a modifier in position 0
of the array, although this is not very likely to cause issues.

Fixes: 2a1217513 ("panfrost: Implement panfrost_query_dmabuf_modifiers")
Cc: mesa-stable
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20879>

20 months agoradv: fix RADV_DEBUG=hang with multiple cmdbuffer per submission
Samuel Pitoiset [Mon, 23 Jan 2023 15:43:32 +0000 (16:43 +0100)]
radv: fix RADV_DEBUG=hang with multiple cmdbuffer per submission

With RADV_DEBUG=hang, there is only one cmdbuffer per submission and
this has been broken recently.

This fixes a segfault when generating GPU hang reports.

Fixes: 76deaa1b1a9 ("radv: Refactor command buffer handling in radv_queue_submit_normal.")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20860>

20 months agoradv: Reduce descriptor pool allocation for alignment.
Bas Nieuwenhuizen [Sun, 22 Jan 2023 23:37:32 +0000 (00:37 +0100)]
radv: Reduce descriptor pool allocation for alignment.

Since we can now rely on this due to the stricter layout code.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20847>

20 months agoradv: Strictly limit alignment needed within a descriptor set.
Bas Nieuwenhuizen [Sun, 22 Jan 2023 23:30:15 +0000 (00:30 +0100)]
radv: Strictly limit alignment needed within a descriptor set.

By doing two passes we limit the number of times we need to have a gap
after a 16-byte descriptor to align for an image descriptor.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20847>

20 months agoradeonsi/gfx11: fix ge_cntl programming
Pierre-Eric Pelloux-Prayer [Fri, 13 Jan 2023 15:13:46 +0000 (16:13 +0100)]
radeonsi/gfx11: fix ge_cntl programming

gfx11 renamed PRIM_GRP_SIZE to VERTS_PER_SUBGRP but another change was
was missed.

Update our code based on PAL's UniversalCmdBuffer::CalcGeCntl function
(especially useVgtOnchipCntlForTess being false for gfx11).

Fixes: 25a66477d02 ("radeonsi/gfx11: register changes")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20728>

20 months agoradeonsi/gfx11: clamp PRIM_GRP_SIZE
Pierre-Eric Pelloux-Prayer [Fri, 13 Jan 2023 10:00:07 +0000 (11:00 +0100)]
radeonsi/gfx11: clamp PRIM_GRP_SIZE

Legal range of values is [1, 256].

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20728>

20 months agowinsys/amdgpu: use DMA_BUF_SET_NAME_B if available
Pierre-Eric Pelloux-Prayer [Thu, 12 Jan 2023 16:31:53 +0000 (17:31 +0100)]
winsys/amdgpu: use DMA_BUF_SET_NAME_B if available

Give a name to dma-buf. This name appears in /sys/kernel/debug/dma_buf/bufinfo
and could be useful to debug dma-buf:

Dma-buf Objects:
size     flags    mode     count    exp_name ino      name
00606208 00000002 00080007 00000003 drm 00192014 2321705-glxgears

The name is only added to non-shared buffer, to avoid overwriting
an existing name when exporting an imported buffer (otherwise all
dma-buf will pretend to be created by XWayland).

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20728>

20 months agodrm-uapi/dma-buf.h: use __u32/__u64 types
Pierre-Eric Pelloux-Prayer [Tue, 17 Jan 2023 20:50:09 +0000 (21:50 +0100)]
drm-uapi/dma-buf.h: use __u32/__u64 types

Otherwise we might get build errors: https://gitlab.freedesktop.org/mesa/mesa/-/jobs/34886940

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20728>

20 months agoiris: Add missing untyped data port flush on PIPELINE_SELECT
Kenneth Graunke [Wed, 18 Jan 2023 18:33:49 +0000 (10:33 -0800)]
iris: Add missing untyped data port flush on PIPELINE_SELECT

This is needed when switching away from GPGPU mode.  See the previous
commit for anv.  This is not likely to make a practical difference for
iris because it never switches back and forth between modes like anv.

Fixes: 172e0b0ebff ("iris: Update PIPELINE_CONTROL flush when switching pipeline mode in TGL+")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20774>

20 months agoanv: Add missing untyped data port flush on PIPELINE_SELECT
Kenneth Graunke [Wed, 18 Jan 2023 10:50:32 +0000 (02:50 -0800)]
anv: Add missing untyped data port flush on PIPELINE_SELECT

See the comments in emit_apply_pipe_flushes().  Flushing HDC is not
sufficient in GPGPU mode, and we need to set the untyped data port flush
bit as well.

Fixes many dEQP-VK failures with INTEL_COMPUTE_CLASS=1 on Alchemist.

Fixes: 1067ec90a59 ("anv: Update PIPELINE_CONTROL flush when switching pipeline mode in TGL+")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20774>

20 months agoradeonsi: remove some shadow reg optimization for bf1 game
Yogesh Mohan Marimuthu [Fri, 20 Jan 2023 06:59:00 +0000 (12:29 +0530)]
radeonsi: remove some shadow reg optimization for bf1 game

This patch removes below shadow reg optimization. This is done for
Vega64 battlefield 1 crash when shadow regs enabled.

  + reset only dirty states with buffers in si_pm4_reset_emitted()
  + various draw states in si_begin_new_gfx_cs()

v2: remove first_cs parameter from si_pm4_reset_emitted() (Marek Olšák)

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18301>

20 months agoradv: allow NULL initial_preamble_cs in radv_amdgpu_winsys_cs_submit_sysmem()
Yogesh Mohan Marimuthu [Thu, 12 Jan 2023 04:12:53 +0000 (09:42 +0530)]
radv: allow NULL initial_preamble_cs in radv_amdgpu_winsys_cs_submit_sysmem()

In case of mcbp, shadowed_regs is initialized early in radv_queue_init()
function by submitting the command buffer. The command buffer is submitted in
radv_init_shadowed_regs_buffer_state() function. When RADV_DEBUG=noibs is used
radv_amdgpu_winsys_cs_submit_sysmem() function is used to submit command buffer.
radv_amdgpu_winsys_cs_submit_sysmem() crashes here because initial_preamble_cs
is NULL. This patch fixes the radv_amdgpu_winsys_cs_submit_sysmem() function
to support NULL initial_preamble_cs.

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18301>

20 months agoradv: fence complete struct is 4 qw size
Yogesh Mohan Marimuthu [Tue, 18 Oct 2022 06:54:36 +0000 (12:24 +0530)]
radv: fence complete struct is 4 qw size

also libdrm function amdgpu_cs_chunk_fence_info_to_data() has qw multiplier
and hence need not do it in radv_amdgpu_cs_submit().

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18301>

20 months agoradv: INDEX_TYPE and NUM_INSTANCES PKT3 are not shadowed
Yogesh Mohan Marimuthu [Mon, 12 Sep 2022 18:01:11 +0000 (23:31 +0530)]
radv: INDEX_TYPE and NUM_INSTANCES PKT3 are not shadowed

INDEX_TYPE and NUM_INSTANCES PKT3 should be always written
if shadowing is enabled since they are not shadowed.

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18301>

20 months agoradv: set preemp flag and pre_ena bit for shadowregs
Yogesh Mohan Marimuthu [Tue, 22 Nov 2022 08:12:17 +0000 (13:42 +0530)]
radv: set preemp flag and pre_ena bit for shadowregs

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18301>

20 months agoradv: add support for register shadowing
Yogesh Mohan Marimuthu [Thu, 22 Sep 2022 18:52:42 +0000 (00:22 +0530)]
radv: add support for register shadowing

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18301>

20 months agoradv: add shadowregs variable to RADV_DEBUG environment variable
Yogesh Mohan Marimuthu [Mon, 29 Aug 2022 05:23:28 +0000 (10:53 +0530)]
radv: add shadowregs variable to RADV_DEBUG environment variable

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18301>

20 months agoac,radeonsi: move shadow regs create ib preamble function to amd common
Yogesh Mohan Marimuthu [Tue, 20 Sep 2022 18:25:53 +0000 (23:55 +0530)]
ac,radeonsi: move shadow regs create ib preamble function to amd common

The si_create_shadowing_ib_preamble() function can be reused from radv also.
Hence it is moved.

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18301>

20 months agoci/freedreno: Mark max-texture-size as a flake.
Emma Anholt [Wed, 25 Jan 2023 01:03:27 +0000 (17:03 -0800)]
ci/freedreno: Mark max-texture-size as a flake.

It's been a popular spurious fail in merges in the last week.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20894>

20 months agomesa: Fix format transform on big endian platforms
Jakub Kulík [Wed, 12 Oct 2022 13:28:01 +0000 (15:28 +0200)]
mesa: Fix format transform on big endian platforms

Reviewed-by: Emma Anholt <emma@anholt.net>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6001
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19051>

20 months agoci/zink: Update radv xfails for the recent shadow fixes.
Emma Anholt [Tue, 24 Jan 2023 18:47:37 +0000 (10:47 -0800)]
ci/zink: Update radv xfails for the recent shadow fixes.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20756>

20 months agoci/zink: Update TGL full-run xfails.
Emma Anholt [Thu, 19 Jan 2023 05:36:33 +0000 (21:36 -0800)]
ci/zink: Update TGL full-run xfails.

arb_shader_texture_lod-texgradcube was a fail incorrectly removed in the
sahdow changes.  line-smooth-* is new piglit coverage.

Haven't pinpointed when the rest were fixed.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20756>

20 months agoci/zink: Add coverage using the vulkan validation layer on lvp.
Emma Anholt [Thu, 12 Jan 2023 22:28:26 +0000 (14:28 -0800)]
ci/zink: Add coverage using the vulkan validation layer on lvp.

Let's make sure we aren't introducing new validation failures as
development proceeds.  Basically, we record the current set of known
validation failures from the CTS, and for any validation failure we have
the layer log it and abort.

I had started encoding xfails from piglit, but it turns out that piglit
and the validation layer fight about the teardown process, producing
use-after-frees.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20756>

20 months agozink: Re-emit the SpvBuiltInSampleMask access chain each load.
Emma Anholt [Thu, 19 Jan 2023 00:59:11 +0000 (16:59 -0800)]
zink: Re-emit the SpvBuiltInSampleMask access chain each load.

Otherwise, the access chain you emitted last time may not dominate the
current use.

Fixes the following validation failure in
dEQP-GLES31.functional.shaders.sample_variables.sample_mask_in.bits_unique_per_sample.multisample_texture_2:

  UNASSIGNED-CoreValidation-Shader-InconsistentSpirv(ERROR / SPEC):
  msgNum: 7060244 - Validation Error: [
  UNASSIGNED-CoreValidation-Shader-InconsistentSpirv ] Object 0: handle =
  0x55cf3cea2c60, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x6bbb14 |
  SPIR-V module not valid: ID '67[%67]' defined in block '23[%23]' does
  not dominate its use in block '31[%31]'

Fixes: 8899f6a19857 ("zink: fix gl_SampleMaskIn spirv generation")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20756>

20 months agozink: Fix up mismatches of memory model vs addressing model.
Emma Anholt [Wed, 18 Jan 2023 22:29:55 +0000 (14:29 -0800)]
zink: Fix up mismatches of memory model vs addressing model.

MemoryModelVulkan was left out for CSes using it.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20756>

20 months agozink: Fix validation failure for maxLod < minLod.
Emma Anholt [Tue, 17 Jan 2023 21:33:32 +0000 (13:33 -0800)]
zink: Fix validation failure for maxLod < minLod.

GL lets you set a silly state, so do something plausible instead of
undefined.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20756>

20 months agozink: Add missing Flat decorations on some inputs.
Emma Anholt [Thu, 12 Jan 2023 22:43:38 +0000 (14:43 -0800)]
zink: Add missing Flat decorations on some inputs.

Fixes validation failures:

Test case 'dEQP-GLES31.functional.android_extension_pack.shaders.es32.extension_directive.oes_sample_variables'..
MESA: error: Validation Error: [
UNASSIGNED-CoreValidation-Shader-InconsistentSpirv ] Object 0: handle =
0x563a1838b790, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x6bbb14 |
SPIR-V module not valid: [VUID-StandaloneSpirv-Flat-04744] Fragment
OpEntryPoint operand 31 with Input interfaces with integer or float type
must have a Flat decoration for Entry Point id 4.
%gl_SampleId = OpVariable %_ptr_Input_uint Input

Test case 'KHR-GL46.shader_ballot_tests.ShaderBallotAvailability'..
MESA: error: Validation Error: [ UNASSIGNED-CoreValidation-Shader-InconsistentSpirv ] Object 0: handle = 0x5558e12f17e0, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x6bbb14 | SPIR-V module not valid: [VUID-StandaloneSpirv-Flat-04744] Fragment OpEntryPoint operand 28 with Input interfaces with integer or float type must have a Flat decoration for Entry Point id 4.
  %gl_SubgroupLocalInvocationId = OpVariable %_ptr_Input_uint Input

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20756>

20 months agozink: Fatal error if requesting validation and we fail to load the layer.
Emma Anholt [Fri, 13 Jan 2023 00:03:20 +0000 (16:03 -0800)]
zink: Fatal error if requesting validation and we fail to load the layer.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20756>

20 months agodzn: Use core feature matching logic instead of rolling our own
Jesse Natalie [Thu, 19 Jan 2023 21:31:12 +0000 (13:31 -0800)]
dzn: Use core feature matching logic instead of rolling our own

This will print nice messages on unsupported features

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20801>

20 months agodzn: Implement subgroup size control extension
Jesse Natalie [Thu, 19 Jan 2023 21:30:49 +0000 (13:30 -0800)]
dzn: Implement subgroup size control extension

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20801>

20 months agodzn: Support more subgroup/quad ops
Jesse Natalie [Thu, 19 Jan 2023 21:30:23 +0000 (13:30 -0800)]
dzn: Support more subgroup/quad ops

See the comment around supported shader stages - to avoid
introducing CTS failures, vertex/geometry support for
subgroups are turned off since they cannot support quads.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20801>

20 months agospirv2dxil: Support subgroup SPIR-V caps
Jesse Natalie [Thu, 19 Jan 2023 21:28:33 +0000 (13:28 -0800)]
spirv2dxil: Support subgroup SPIR-V caps

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20801>

20 months agospirv2dxil: Lower some wave op properties
Jesse Natalie [Thu, 19 Jan 2023 21:28:18 +0000 (13:28 -0800)]
spirv2dxil: Lower some wave op properties

DXIL has no concept of subgroup mask ops, relative
shuffle ops, and everything is scalar.

Most wave broadcast ops support i1 overloads, except
for quad swap operations. Go figure. Use lower_bit_size
to promote those to i32 instead.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20801>

20 months agomicrosoft/compiler: Support emitting the SM6.6 wave size tag
Jesse Natalie [Thu, 19 Jan 2023 21:26:13 +0000 (13:26 -0800)]
microsoft/compiler: Support emitting the SM6.6 wave size tag

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20801>

20 months agomicrosoft/compiler: Implement more wave/quad ops
Jesse Natalie [Thu, 19 Jan 2023 21:25:53 +0000 (13:25 -0800)]
microsoft/compiler: Implement more wave/quad ops

This handles ballot, vote, shuffle, broadcast, and quads

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20801>

20 months agomicrosoft/compiler: Handle i1 overloads
Jesse Natalie [Thu, 19 Jan 2023 21:24:42 +0000 (13:24 -0800)]
microsoft/compiler: Handle i1 overloads

Some wave ops can have bool/i1 overloads

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20801>

20 months agomicrosoft/compiler: Handle i2i1 and u2u1
Jesse Natalie [Thu, 19 Jan 2023 21:23:54 +0000 (13:23 -0800)]
microsoft/compiler: Handle i2i1 and u2u1

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20801>

20 months agomicrosoft/compiler: Don't emit threadgroup barriers for graphics shaders
Jesse Natalie [Thu, 19 Jan 2023 21:23:35 +0000 (13:23 -0800)]
microsoft/compiler: Don't emit threadgroup barriers for graphics shaders

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20801>

20 months agospirv_to_dxil: Unify spirv_to_nir_options
Pedro J. Estébanez [Tue, 24 Jan 2023 13:42:07 +0000 (14:42 +0100)]
spirv_to_dxil: Unify spirv_to_nir_options

Beyond the pure refactoring, this fixes spirv2dxil, which was using outdated values.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20884>

20 months agodzn: Enable Vulkan 1.1
Jesse Natalie [Tue, 24 Jan 2023 16:24:56 +0000 (08:24 -0800)]
dzn: Enable Vulkan 1.1

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>

20 months agodzn: Fix independent blend check
Jesse Natalie [Sat, 21 Jan 2023 00:48:27 +0000 (16:48 -0800)]
dzn: Fix independent blend check

Memcmp returns 0 on equal, so !memcmp means equal.

Fixes: c92729c3 ("dzn: Enable independent blending")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>

20 months agodzn: Don't expose variable pointers
Jesse Natalie [Fri, 20 Jan 2023 21:47:44 +0000 (13:47 -0800)]
dzn: Don't expose variable pointers

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>

20 months agodzn: A single sampler descriptor set needs to support 1024 samplers
Jesse Natalie [Fri, 20 Jan 2023 18:12:15 +0000 (10:12 -0800)]
dzn: A single sampler descriptor set needs to support 1024 samplers

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>

20 months agodzn: Descriptor limits are based on binding tier, not heap tier
Jesse Natalie [Fri, 20 Jan 2023 18:11:42 +0000 (10:11 -0800)]
dzn: Descriptor limits are based on binding tier, not heap tier

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>

20 months agodzn: Usage MULTISAMPLE_LOAD support instead of RT/DS support for MSAA
Jesse Natalie [Fri, 20 Jan 2023 17:44:12 +0000 (09:44 -0800)]
dzn: Usage MULTISAMPLE_LOAD support instead of RT/DS support for MSAA

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>

20 months agodzn: Support EXTENDED_USAGE bit
Jesse Natalie [Fri, 20 Jan 2023 17:43:52 +0000 (09:43 -0800)]
dzn: Support EXTENDED_USAGE bit

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>

20 months agodzn: Usage image view usage instead of image usage
Jesse Natalie [Fri, 20 Jan 2023 17:43:02 +0000 (09:43 -0800)]
dzn: Usage image view usage instead of image usage

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>

20 months agodzn: Use SHADER_LOAD to indicate SAMPLED_IMAGE support
Jesse Natalie [Fri, 20 Jan 2023 17:41:55 +0000 (09:41 -0800)]
dzn: Use SHADER_LOAD to indicate SAMPLED_IMAGE support

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>

20 months agodzn: Move patched vertex buffer capability check up a level
Jesse Natalie [Fri, 20 Jan 2023 17:37:26 +0000 (09:37 -0800)]
dzn: Move patched vertex buffer capability check up a level

Some of these patched formats are also needed as (trivial) image
formats, so we can't just report vertex buffer as the only supported
operation.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>

20 months agodzn: When rendering to 3D, don't treat layers as subresources for barriers
Jesse Natalie [Wed, 11 Jan 2023 23:33:25 +0000 (15:33 -0800)]
dzn: When rendering to 3D, don't treat layers as subresources for barriers

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>

20 months agodzn: Set dynamic rendering caps
Jesse Natalie [Wed, 11 Jan 2023 23:27:38 +0000 (15:27 -0800)]
dzn: Set dynamic rendering caps

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>

20 months agodzn: Respect suspending/resuming flags to omit clears/resolves
Jesse Natalie [Wed, 11 Jan 2023 23:27:24 +0000 (15:27 -0800)]
dzn: Respect suspending/resuming flags to omit clears/resolves

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>

20 months agodzn: Use common physical device list/enumeration helpers
Jesse Natalie [Wed, 11 Jan 2023 23:11:26 +0000 (15:11 -0800)]
dzn: Use common physical device list/enumeration helpers

Implements EnumeratePhysicalDeviceGroups for us for free

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>

20 months agodzn: Support vkCmdDispatchBase
Jesse Natalie [Wed, 11 Jan 2023 23:10:15 +0000 (15:10 -0800)]
dzn: Support vkCmdDispatchBase

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>

20 months agospirv2dxil: Support dispatches with base group indices
Jesse Natalie [Wed, 11 Jan 2023 23:09:33 +0000 (15:09 -0800)]
spirv2dxil: Support dispatches with base group indices

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>

20 months agomicrosoft/compiler: Lower device index to zero
Jesse Natalie [Wed, 11 Jan 2023 23:08:45 +0000 (15:08 -0800)]
microsoft/compiler: Lower device index to zero

Maybe we'll support actual device groups at some point, but today
is not that day.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>

20 months agomicrosoft/compiler: Fix atomic image umax
Jesse Natalie [Wed, 18 Jan 2023 18:13:55 +0000 (10:13 -0800)]
microsoft/compiler: Fix atomic image umax

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>

20 months agozink: fix implicit feedback loop detection
Mike Blumenkrantz [Mon, 23 Jan 2023 19:53:38 +0000 (14:53 -0500)]
zink: fix implicit feedback loop detection

the code here was all expecting the VkPipelineStageFlags bitfield expansions,
but u_foreach_bit() gives the actual bit, so implicit feedback loops were never
actually being detected

instead, convert back to the bitfield at the top of the loop so the value works
as expected

Fixes: 9ba06579035 ("zink: make implicit feedback loop application stricter")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20863>

20 months agoradv: print depth image size with RADV_DEBUG=img
Samuel Pitoiset [Tue, 24 Jan 2023 07:26:26 +0000 (08:26 +0100)]
radv: print depth image size with RADV_DEBUG=img

This turned out to be useful when investigating a GPU hang.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20872>

20 months agointel/common: add a INTEL_DECODE variable to parameter decoder at runtime
Lionel Landwerlin [Fri, 20 Jan 2023 09:30:46 +0000 (11:30 +0200)]
intel/common: add a INTEL_DECODE variable to parameter decoder at runtime

Sometimes you want to diff 2 runs with INTEL_DEBUG=bat, but a tiny
allocation change can mess quite badly with offsets printed in the
decoding, making it hard to look at the diff with meld.

Fortunately our decoder can avoid printing offsets. We just need a
variable to specify that.

We still use the defaults specified by the driver but you can turn
things on/off with :

INTEL_DECODE=+color,-offsets,-floats INTEL_DEBUG=bat ./my_app

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20874>

20 months agointel/decoder: print out compute push constants
Lionel Landwerlin [Wed, 11 Jan 2023 09:53:02 +0000 (11:53 +0200)]
intel/decoder: print out compute push constants

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20874>

20 months agointel/compiler/mesh: handle const data in task & mesh programs
Marcin Ślusarz [Tue, 24 Jan 2023 09:52:10 +0000 (10:52 +0100)]
intel/compiler/mesh: handle const data in task & mesh programs

Started showing up when nir_opt_large_constants call was moved in 88756cee8da.
Fixes dEQP-VK.mesh_shader.ext.smoke.monolithic.fullscreen_gradient*

Suggested-by: Kenneth Graunke <kenneth@whitecape.org>
Fixes: 88756cee8da ("intel/compiler: Run nir_opt_large_constants before scalarizing consts")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20876>

20 months agointel/compiler: fix generation of vec8/vec16 alu instruction
Marcin Ślusarz [Thu, 12 Jan 2023 15:06:42 +0000 (16:06 +0100)]
intel/compiler: fix generation of vec8/vec16 alu instruction

I stumbled on this when I inserted some suboptimal lowering code after all
optimizations. Adding certain subset of optimizations after my lowering code
actually avoided this bug, so I think it's not possible to hit this on upstream.

Let's fix this for the next person generating suboptimal code...

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20857>

20 months agoloader,glx,egl: remove is_different_gpu variable from loader
Yogesh Mohan Marimuthu [Sat, 17 Dec 2022 18:27:50 +0000 (23:57 +0530)]
loader,glx,egl: remove is_different_gpu variable from loader

v2: fd number is different (Pierre-Eric)
v1: remove is_different_gpu (Pierre-Eric)

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13422>

20 months agoglx: remove is_different_gpu variable from struct dri_screen
Yogesh Mohan Marimuthu [Mon, 23 Jan 2023 11:06:48 +0000 (16:36 +0530)]
glx: remove is_different_gpu variable from struct dri_screen

v2: fd number is different (Pierre-Eric)
v1: remove is_different_gpu (Pierre-Eric)

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13422>

20 months agoegl: remove is_different_gpu variable from struct dri2_egl_display
Yogesh Mohan Marimuthu [Sat, 17 Dec 2022 17:47:15 +0000 (23:17 +0530)]
egl: remove is_different_gpu variable from struct dri2_egl_display

v2: fd number is different (Pierre-Eric)
v1: remove is_different_gpu (Pierre-Eric)

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13422>

20 months agoloader,glx,egl,vl,d3d: loader_get_user_preferred_fd() function to return original_fd
Yogesh Mohan Marimuthu [Sat, 17 Dec 2022 17:21:08 +0000 (22:51 +0530)]
loader,glx,egl,vl,d3d: loader_get_user_preferred_fd() function to return original_fd

v1: return original_fd in loader_get_user_preferred_fd() (Pierre-Eric)
v2: fix *original_id crash for android, haiku... (Pierre-Eric)
    remove extra comment (Pierre-Eric)
v2: also return render fd in case of original_fd passed is NULL (Pierre-Eric)

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13422>

20 months agoloader,glx: add render_gpu tag psc->driScreen and psc->fd
Yogesh Mohan Marimuthu [Mon, 23 Jan 2023 11:04:40 +0000 (16:34 +0530)]
loader,glx: add render_gpu tag psc->driScreen and psc->fd

v1: add render_gpu_tag (Pierre-Eric)

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13422>

20 months agoegl: add render_gpu tag to dri2_dpy->fd and dri2_dpy->dri_screen variable
Yogesh Mohan Marimuthu [Thu, 1 Dec 2022 09:29:34 +0000 (14:59 +0530)]
egl: add render_gpu tag to dri2_dpy->fd and dri2_dpy->dri_screen variable

v1: add render_gpu_tag (Pierre-Eric)

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13422>

20 months agoegl/wayland: for prime, allocate linear_copy from display GPU VRAM
Yogesh Mohanmarimuthu [Wed, 20 Oct 2021 14:48:05 +0000 (20:18 +0530)]
egl/wayland: for prime, allocate linear_copy from display GPU VRAM

Allocates VRAM in display GPU in case of prime. Then the dma_buf is imported
into prime GPU.

v4: add image tag to __DRIimage (Marek Olšák)
v3: move display fd opening to separate commit (Pierre-Eric)
    image_format_to_fourcc() non-static to seperate commit (Pierre-Eric)
v2: close query fds after linear_copy buffer import (Marek Olšák)
    use image_format_to_fourcc() from loader_dri3_helper.c (Marek Olšák)

Signed-off-by: Yogesh Mohanmarimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13422>

20 months agoloader: make image_format_to_fourcc() non-static
Yogesh Mohanmarimuthu [Mon, 22 Nov 2021 14:25:41 +0000 (19:55 +0530)]
loader: make image_format_to_fourcc() non-static

the image_format_to_fourcc() function will be used from
egl/wayland hence make it non-static. Also move the function
into loader_dri_helper.c from loader_dri3_helper.c since
loader_dri3_helper library depends on xcb which will make
egl wayland depend on xcb indirectly.

v2: add loader tag to extern image_format_to_fourcc() (Marek Olšák)

V3: move image_format_to_fourcc to loader_dri_helper.c
Signed-off-by: Yogesh Mohanmarimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13422>

20 months agoegl/wayland: keep display fd open for prime
Yogesh Mohanmarimuthu [Mon, 22 Nov 2021 13:15:18 +0000 (18:45 +0530)]
egl/wayland: keep display fd open for prime

Keep the display fd open for creating DRI screen on display gpu in
case of prime.

Signed-off-by: Yogesh Mohanmarimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13422>

20 months agoloader,glx,egl/x11: init dri_screen_display_gpu in struct loader_dri3_drawable
Yogesh Mohanmarimuthu [Mon, 18 Oct 2021 16:14:25 +0000 (21:44 +0530)]
loader,glx,egl/x11: init dri_screen_display_gpu in struct loader_dri3_drawable

Initialize dri_screendisplay_gpu variable in struct laoder_dri3_drawable.
Also make dri_screen_display_gpu variable as input parameter to function
loader_dri3_drawable_init() since dri_screen variable is initialized this way.
This also helps to avoid duplicate initializing dri_screen_display_gpu
in glx and egl code.

Signed-off-by: Yogesh Mohanmarimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13422>

20 months agoegl: create DRI screen for display GPU in case of prime
Yogesh Mohanmarimuthu [Mon, 18 Oct 2021 04:22:16 +0000 (09:52 +0530)]
egl: create DRI screen for display GPU in case of prime

The created DRI screen can be used to allocate VRAM memory from
display GPU in case of prime.

v2: remove extra whitespace (Marek Olšák)

Signed-off-by: Yogesh Mohanmarimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13422>

20 months agoegl,egl/x11: keep display fd open for prime
Yogesh Mohanmarimuthu [Mon, 22 Nov 2021 15:34:53 +0000 (21:04 +0530)]
egl,egl/x11: keep display fd open for prime

Keep the display fd open for creating DRI screen on display gpu in
case of prime. Also close the fd opened in dri2_display_destroy()

Signed-off-by: Yogesh Mohanmarimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13422>

20 months agoegl: add fd_display_gpu to struct dri2_egl_display
Yogesh Mohanmarimuthu [Sun, 17 Oct 2021 16:54:10 +0000 (22:24 +0530)]
egl: add fd_display_gpu to struct dri2_egl_display

fd opened on display gpu is saved in fd_display_gpu. It is later used
to create dri screen on display gpu.

Signed-off-by: Yogesh Mohanmarimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13422>

20 months agointel/genxml: set unused 3DSTATE_PS_EXTRA field as mbz
Tapani Pälli [Mon, 23 Jan 2023 08:57:20 +0000 (10:57 +0200)]
intel/genxml: set unused 3DSTATE_PS_EXTRA field as mbz

Wa_14015360517 mentions situations where HW produces invalid
occlusion query results when "Pixel Shader Does not write to RT"
bit is set.

"When Pixel Shader Kills Pixel is set, SW must perform a dummy render
 target write from the shader and not set this bit, so that Occlusion
 Query is correct."

Another situation is when writing to UAV or to NULL render target.
Patch sets field as 'must be zero' to discourage possible use of it.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20849>

20 months agomesa: move component bits queries as GL ES only
Tapani Pälli [Thu, 12 Jan 2023 09:52:16 +0000 (11:52 +0200)]
mesa: move component bits queries as GL ES only

These enums have been removed/deprecated long time ago from desktop
GL. Here we remove them from modern GL while still allow for compat
contexts (~old apps). This change matches proprietary drivers and makes
our behaviour same within CTS with some tests.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20719>

20 months agov3dv: ensure we allocate at least the requested space for a CL
Iago Toral Quiroga [Tue, 24 Jan 2023 07:24:49 +0000 (08:24 +0100)]
v3dv: ensure we allocate at least the requested space for a CL

While we are already ensuring we allocate at least 8192 bytes should
this not be the first allocation and our allocations are typically just
a few bytes, multilayered framebuffers with large numbers of layers may
require more space than that in a single allocation.

Fixes: 3325950648 ('v3dv: increase BO allocation size when growing CLs')
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20871>

20 months agomesa: (more) correctly handle incomplete depth textures
Mike Blumenkrantz [Fri, 20 Jan 2023 19:53:32 +0000 (14:53 -0500)]
mesa: (more) correctly handle incomplete depth textures

according to GL spec, incomplete shadow samplers should return 0

this is technically possible for drivers to do using a RGBA texture in
the sense that somehow it's been working, but it's broken at the gallium-level
for what drivers should be expecting to see in such circumstances given
that such scenarios have been binding a RGBA texture to use with shadow samplers

instead, we can give drivers a fallback Z32 texture to avoid format/sampler
mismatches and complying with expected behavior

see also KHR-GL46.incomplete_texture_access.sampler for driver-specific testing

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/20817>

20 months agomesa: populate gl_program::ShadowSamplers mask from shader data
Mike Blumenkrantz [Fri, 20 Jan 2023 19:52:21 +0000 (14:52 -0500)]
mesa: populate gl_program::ShadowSamplers mask from shader data

this data is already processed, it just isn't being propagated for whatever reason

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/20817>