Commit Graph

138252 Commits

Author SHA1 Message Date
Yiwei Zhang 757a711f39 venus: fix virtgpu_bo_init_dmabuf for classic resource
1. only do size check if the input size is not 0
2. blob_mem can be 0 because guest minigbm uses RESOURCE_CREATE_3D
3. set bo->blob_flags to 0 for classic resource to fail virtgpu_bo_map

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10273>
2021-04-16 04:56:19 +00:00
Eric Anholt 23159f1a7a ci/freedreno: Skip some precision tests on a530.
These have flaked as Timeouts in CI in the last month.  .precision.* is
generally very slow (some in the 15s-30s range), but it's unclear to me
why they sometimes spike up to 60 seconds (thermal throttling?).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10274>
2021-04-16 04:34:14 +00:00
Eric Anholt afa965b7c5 ci/virgl: Mark a couple of new Crash tests as flakes.
These have shown up in CI runs since the deqp uprev.  Also, link the bug
report I made for one of the failing tests.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10274>
2021-04-16 04:34:14 +00:00
Alexander Shi 55fb9417a6 mesa: texparam: Add a clamping macro to handle out-of-range floats returned as integers.
The parameters GL_TEXTURE_MIN_LOD, GL_TEXTURE_MAX_LOD,
GL_TEXTURE_MAX_ANISOTROPY_EXT, GL_TEXTURE_LOD_BIAS are stored as floats but
returned as integers. Setting their values outside of the integer range results
has undefined behaviour when the c-runtime method lroundf converts the value
back to an integer.

Fixes: 53c36dfc('replace IROUND with util functions')
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10244>
2021-04-16 01:44:16 +00:00
Adam Jackson 31dba8d51b gallium/xlib: Fix for recent gl_config changes
This mirrors the changes needed elsewhere for parts of !9817:

Fixes: 4daef7ffe3 mesa: Remove redundant gl_config::sampleBuffers
Fixes: 4fbe1cbe4c mesa: Stop tracking visual rating in gl_config
Fixes: d21b8afa3d mesa: Remove the pretense of aux buffer support
Fixes: 78dfab95b8 mesa: Remove unused gl_config::level
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4544
Acked-by: Eric Anholt <eric@anholt.net>
Tested-by: Jan Zielinski <jan.zielinski@intel.com>
Acked-by: Jan Zielinski <jan.zielinski@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10050>
2021-04-16 00:56:15 +00:00
Icecream95 3af12216e3 panfrost: Unset shared/scanout binding flags for staging resources
Fixes Xwayland crashes when starting non-GL applications.

Fixes: e00d94f14f ("panfrost: Enable AFBC buffer sharing")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10266>
2021-04-15 23:12:30 +00:00
Icecream95 716ce3cc1a panfrost: Assert staging resource allocation was successful
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10266>
2021-04-15 23:12:30 +00:00
Adam Jackson fc9b3b260e Revert "glx: Lift sending the MakeCurrent request to top-level code"
This provokes crashes in Cinnamon for some reason that I haven't
diagnosed yet.

This reverts commit 80b67a3b44.

Fixes: 80b67a3b44 glx: Lift sending the MakeCurrent request to top-level code
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4639
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10260>
2021-04-15 19:48:10 +00:00
Yiwei Zhang d148540e5a venus: cap api version to 1.1 for Android
Android hasn't officially adopted 1.2 yet, so we just cap it to avoid
troubles(e.g. vkjson doesn't like 1.2 atm).

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10258>
2021-04-15 18:31:31 +00:00
Eric Anholt 7d234da6ee freedreno: Fix YUV sampler regression.
We have to keep sampler uniforms around for later YUV lowering, and we
only need to remove uniforms that take up storage space.  Code comes from
radeonsi.

Closes: #4644.
Fixes: de17b4aab5 ("freedreno: Remove uniform variables after finalizing NIR.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10246>
2021-04-15 16:20:15 +00:00
Michel Dänzer 1bccefb3fc ci: Move -Werror enabling from job definitions to meson build script
It was enabled in all jobs.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10220>
2021-04-15 16:01:22 +00:00
Michel Dänzer 63e4bdd90c ci: Enable -Werror for the remaining GCC build jobs
Same principle as for clang, with much fewer exceptions left.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10220>
2021-04-15 16:01:22 +00:00
Michel Dänzer bf480cc9c2 osmesa: Replace default case FALLTHROUGH annotation by following return
Avoids warning about the annotation with GCC 10:

../src/gallium/frontends/osmesa/osmesa.c: In function ‘osmesa_choose_format’:
../src/util/compiler.h:84:21: warning: attribute ‘fallthrough’ not preceding a case label or default label
   84 | #define FALLTHROUGH __attribute__((fallthrough))
      |                     ^~~~~~~~~~~~~
../src/gallium/frontends/osmesa/osmesa.c:316:7: note: in expansion of macro ‘FALLTHROUGH’
  316 |       FALLTHROUGH;
      |       ^~~~~~~~~~~

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10220>
2021-04-15 16:01:22 +00:00
Michel Dänzer 2391ffc9d4 ci: Enable -Werror in clang jobs
They're not warning-clean yet, but we can enable -Werror in general and
just allow the existing types of warnings as exceptions with
-Wno-error=[...]. This way, new warnings of all other types will be
prevented from entering the code base.

Once all warnings of a certain type have been eliminated in a job, the
exception for that type can be dropped from that job. This provides a
realistic path to a fully warning-clean CI build in the future.

v2:
* Use echo -n (Juan A. Suarez)

Reviewed-by: Eric Anholt <eric@anholt.net> # v1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10220>
2021-04-15 16:01:22 +00:00
Michel Dänzer d200f45875 Use explicit break instead of fall-through to break-only case
clang generates a warning if there's no explicit break or fall-through
annotation. The latter would be kind of silly in this case, and not
robust against any future changes turning the fall-through invalid.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10220>
2021-04-15 16:01:22 +00:00
Michel Dänzer 8d4c31b3c7 iris: Drop unneeded default switch case
Avoids clang warning about the fall-through annotation.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10220>
2021-04-15 16:01:22 +00:00
Michel Dänzer a8a88a8d39 llvmpipe: Drop switch with only default case
Replace it with the default case contents.

Avoids clang warning about the fall-through annotation.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10220>
2021-04-15 16:01:22 +00:00
Michel Dänzer 9ef5372441 Guard FALLTHROUGH annotations after assert()
clang warns if it can determine that the assert() never returns and
there's a fall-through annotation below.

Acked-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10220>
2021-04-15 16:01:22 +00:00
Michel Dänzer 2928c21eb7 Convert most remaining free-form fall-through comments to FALLTHROUGH
One exception is src/amd/addrlib/, for which -Wimplicit-fallthrough is
explicitly disabled.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10220>
2021-04-15 16:01:22 +00:00
Michel Dänzer 96f0f46350 util: Remove unused Android options_tbl_lock
Avoids warning:

../src/util/os_misc.c:132:21: error: unused variable 'options_tbl_lock' [-Werror,-Wunused-variable]
static simple_mtx_t options_tbl_lock = _SIMPLE_MTX_INITIALIZER_NP;
                    ^

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10220>
2021-04-15 16:01:21 +00:00
Michel Dänzer 7e5911846e lima/ppir: Cast pointer to uintptr_t instead of uint64_t
Avoids warnings on armhf:

./src/gallium/drivers/lima/ir/pp/nir.c: In function 'ppir_get_block':
../src/gallium/drivers/lima/ir/pp/nir.c:554:66: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
    ppir_block *block = _mesa_hash_table_u64_search(comp->blocks, (uint64_t)nblock);
                                                                  ^
../src/gallium/drivers/lima/ir/pp/nir.c: In function 'ppir_compile_nir':
../src/gallium/drivers/lima/ir/pp/nir.c:899:52: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
          _mesa_hash_table_u64_insert(comp->blocks, (uint64_t)nblock, block);
                                                    ^

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10220>
2021-04-15 16:01:21 +00:00
Connor Abbott cf727e6ba4 tu: Expose VK_EXT_robustness2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7573>
2021-04-15 16:05:13 +02:00
Connor Abbott 0fb14420da tu: Handle null descriptors
Writing all 0's, including for the format, seems to work. Actually
setting the format seems to break textureSize() (getsize returns 1 for
some reason).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7573>
2021-04-15 16:05:13 +02:00
Connor Abbott f58ece08da tu: Handle robust UBO behavior for pushed UBO ranges
If we push a UBO range but then find out at draw-time that part of the
pushed range is out of range of the UBO descriptor, then we have to fill
in the rest of the range with 0's to mimic the bounds-checking that ldc
would've done.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7573>
2021-04-15 16:05:13 +02:00
Connor Abbott cb02a48f83 tu: Correctly preserve old push descriptor contents
We were never setting set->size, so we were always copying 0 bytes. But
as we only copy the contents when the layout and therefore the size is
the same, we don't have to take the old size into account anyway.

This fixes some VK_EXT_robustness2 tests that use push descriptors.

Fixes: 6d4f33e ("turnip: initial implementation of VK_KHR_push_descriptor")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7573>
2021-04-15 16:05:13 +02:00
Connor Abbott c68ea960a7 ir3, tu: Add compiler flag for robust UBO behavior
This needs to be part of the compiler because it's the only piece that
we always have access to in all the places ir3_optimize_loop() is
called, and it's only enabled for the whole Vulkan device. Right now
it's just used for constraining vectorization, but the next commit adds
another use.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7573>
2021-04-15 16:05:11 +02:00
Connor Abbott 8f54028479 ir3: Reduce max const file indirect offset base to 9 bits
This fixes
dEQP-VK.robustness.robustness2.bind.notemplate.r32i.dontunroll.nonvolatile.uniform_buffer.no_fmt_qual.len_260.samples_1.1d.frag,
which accesses the shader UBO with c<a0.x + 512> due to the constant
data UBO coming before it in the const file. The len_256 variant has a
smaller constant data UBO, so it uses c<a0.x + 256> instead, and that
works, so 512 seems to be the real limit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7573>
2021-04-15 16:03:54 +02:00
Connor Abbott 8e11f0560e ir3: Fix list corruption in legalize_block()
We forgot to remove the instruction under consideration from instr_list
before inserting it into the block's list, which caused instr_list to
become corrupted. This happened to work but caused further corruption in
some rare scenarios.

Fixes: adf1659 ("freedreno/ir3: use standard list implementation")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7573>
2021-04-15 16:03:54 +02:00
Gustavo Padovan f601fd635b gitlab-ci: enable Intel AML-Y as experimental
The LAVA lab has been running well with the rammus chromebook for some
time now. Let's add it to MesaCI as experimental to get more testing,
and later enable it in production.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10238>
2021-04-15 13:03:19 +00:00
Gustavo Padovan e8bc0a28a4 traces-iris: fix expectation for Intel GLK
glmark2/buffer-columns=200:interleave=true:update-dispersion=0.9:upd...
was missing the expectation checksum.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10238>
2021-04-15 13:03:19 +00:00
Iago Toral Quiroga bed3f31fc6 v3dv: don't use a dedicated BO for each occlusion query
Dedicated BOs waste memory and are also a significant cause of CPU
overhead when applications use hundreds of them per frame due to
all the work the kernel has to do to page in all these BOs for a job.
The UE4 Vehicle demo was hitting this causing it to freeze and stutter
under 1fps.

The hardware allows us to setup groups of 16 queries in consecutive
4-byte addresses, requiring only that each group of 16 queries is
aligned to a 1024 byte boundary. With this change, we allocate all
the queries in a pool in a single BO and we assign them different
offsets based on the above restriction. This eliminates the freezes
and stutters in the Vehicle sample.

One caveat of this solution is that we can only wait or test for
completion of a query by testing if the GPU is still using its BO,
which basically means that we can only wait for all active queries
in a pool to complete and not just the ones being requested by the
API. Since the Vulkan recommendation is to use a different query
pool per frame this should not be a big issue though.

If this ever becomes a problem (for example if an application does't
follow the recommendation and instead allocates a single pool and
splits its queries between frames), we could try to group queries
in a pool into a number of BOs to try and find a balance, but for
now this should work fine in most cases.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10253>
2021-04-15 12:45:07 +00:00
Mike Blumenkrantz a43da5c999 docs: update GL_ARB_texture_filter_minmax for zink
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10248>
2021-04-15 12:35:09 +00:00
Mike Blumenkrantz cca616ebd5 zink: export PIPE_CAP_SAMPLER_REDUCTION_MINMAX_ARB
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10248>
2021-04-15 12:35:09 +00:00
Mike Blumenkrantz 92f5006814 zink: handle minmax sampler creation for VK_EXT_sampler_filter_minmax
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10248>
2021-04-15 12:35:09 +00:00
Mike Blumenkrantz 22e1ed5722 zink: support format queries for VK_EXT_sampler_filter_minmax
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10248>
2021-04-15 12:35:09 +00:00
Mike Blumenkrantz b62633c599 zink: hook up VK_EXT_sampler_filter_minmax
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10248>
2021-04-15 12:35:09 +00:00
Rhys Perry ec70882238 radv: fix barrier in radv_decompress_dcc_compute shader
ACO doesn't create a waitcnt for barriers between texture samples and
image stores because texture samples are supposed to use read-only
memory. It could also schedule the barrier to above the texture sample.
We also have use a larger memory scope to avoid an ACO optimization.

Tested on GFX8 with Sachsa Willems deferred sample. With some DCC
decompressions and the compute path forced.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: 21.1 <mesa-stable>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9496>
2021-04-15 12:02:36 +00:00
Hans-Kristian Arntzen 08fdaec473 radv: Allocate buffer list for MUTABLE descriptor types as well.
Fixes: 86644b84b9 ("radv: Implement VK_VALVE_mutable_descriptor_type.")
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10132>
2021-04-15 11:51:33 +00:00
Hans-Kristian Arntzen b60bc59180 radv: Take image alignment into account when allocating MUTABLE pool.
Allocating a descriptor set is aligned to 32 bytes, so just like the
other buffer types, bump the descriptor size to 32 bytes when allocating
MUTABLE descriptor types from a pool.

Fixes: 86644b84b9 ("radv: Implement VK_VALVE_mutable_descriptor_type.")
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10132>
2021-04-15 11:51:33 +00:00
Karol Herbst f945cca983 clover/llvm: handle Fixed vs Scalable vectors explicitly starting with llvm-11
This fixes compilation with llvm-13.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4200
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9973>
2021-04-15 11:39:47 +00:00
Iago Toral Quiroga 917049e7d6 v3dv: fix array sizes when tracking BOs during uniform setup
The resource indices we get point to descriptor map entries that include
all shader stages, so we need to size the arrays to account for more than
just one stage.

For now we only support up to 2 stages in a pipeline, so we use that.

Fixes: 002304482c ('v3dv: avoid redundant BO job additions for UBO/SSBO')
Fixes: fa170dab4c ('v3dv: avoid redundant BO job additions for textures and samplers')
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10252>
2021-04-15 11:26:04 +00:00
Iago Toral Quiroga e7e8464d94 v3dv: fix descriptor set limits
There were various issues here:
   - MAX_DYNAMIC_UNIFORM_BUFFERS was larger than MAX_UNIFORM_BUFFERS.
   - In some cases we were exposing more than the minimums required.
     While that is not incorrect, it is not following what we have
     been doing in general.
   - The Vulkan spec states that some of the MaxDescriptorSet limits
     need to be multipled by 6 to include all shader stages, even
     if the implementation doesn't support all shader stages.

Fixes: cbd299b051 ('v3dv/device: do not compute per-pipeline limits multiplying per-stage')
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10252>
2021-04-15 11:26:04 +00:00
Alejandro Piñeiro a0152c5948 v3dv/debug: use gl stage when checking debug flag
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10229>
2021-04-15 10:29:44 +00:00
Alejandro Piñeiro 98698c4d01 v3dv/debug: print correct stage name
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10229>
2021-04-15 10:29:44 +00:00
Eric Anholt 6d510fd473 ci/freedreno: Merge a630 piglit to a single job.
piglit_gl clocked in at 6:12 end-to-end runtime, and piglit_shader spent
2:53 in deqp-runner, so merging them together should be about 9 minutes.
Removing a boot should save us a minute or two of runner time per
pipeline.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10243>
2021-04-15 10:06:14 +00:00
Simon Ser 35e25ea1d0 ac/surface: allow non-DCC modifiers for YUV on GFX9+
Accept non-linear tiling for multi-planar formats on GFX9+, as long
as DCC is disabled. DCC support is possible in theory, but untested
for now.

GFX8 is still restricted to linear tiling because it's not yet clear
how modifiers should be handled on these chips for multi-planar
formats. Each plane may need a different modifier.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Acked-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10134>
2021-04-15 09:43:17 +00:00
Simon Ser 979e138695 radeonsi: stop special-casing YUV formats in si_query_dmabuf_modifiers
Instead of having a special case for YUV formats in
si_query_dmabuf_modifiers, let ac_get_supported_modifiers handle
them. Keep setting external_only = 1 for YUV formats, since we
can only sample from such formats (we can't use them as render
targets).

This shouldn't change si_query_dmabuf_modifiers's behavior, because
for YUV formats ac_get_supported_modifiers will return a single
LINEAR modifier.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Acked-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10134>
2021-04-15 09:43:17 +00:00
Simon Ser 19378dfe3c ac/surface: use blocksizebits instead of blocksize
util_format_get_blocksize asserts that the blocksize isn't zero.
However the blocksize will be zero if the format's channel encoding
is unspecified. The channel encoding is only meaningful for the
plain u_format layout, so util_format_get_blocksize can't be used
for formats with another layout. For example, YUV formats don't have
the channel encoding specified.

Use util_format_get_blocksizebits, which just returns zero without
an assertion for formats which don't have a channel encoding.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10134>
2021-04-15 09:43:17 +00:00
Simon Ser 6e697b595f util/format: document block depth field
After the pixel block width and height, a third field is used to
store the pixel block depth. Document this field.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10134>
2021-04-15 09:43:17 +00:00
Simon Ser b26a546b2f radeon/vcn: handle tiled buffers when decoding
Set the swizzle mode when decoding.

Add a safe-guard to make sure the provided surface isn't DCC, because
we don't handle this situation.

Signed-off-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10134>
2021-04-15 09:43:17 +00:00