platform/upstream/mesa.git
3 years agopanfrost/ci: Disable GLES2 jobs when we run GLES3
Alyssa Rosenzweig [Fri, 21 May 2021 14:45:49 +0000 (10:45 -0400)]
panfrost/ci: Disable GLES2 jobs when we run GLES3

I've been meaning to make this change for a while, but I've been holding
out in case dEQP-GLES2 on T860/Bifrost catches a driver issue missed by
dEQP-GLES3 and also missed by T720's dEQP-GLES2 job. Given that hasn't
happened (indeed, dEQP-GLES3 is an effective super set of dEQP-GLES2),
let's save the cycles and skip the redundant jobs.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10923>

3 years agolima: implement alpha test
Vasily Khoruzhick [Wed, 19 May 2021 05:26:57 +0000 (22:26 -0700)]
lima: implement alpha test

As [1] suggests, 3 lower bits in rsw->multi_sample is alpha test
compare func and bits 16-23 are reference value - uint8,
0.0 is 0, 0.5 is 0x80, 1.0 is 0xff.

Just as on Panfrost, enabled alpha test needs early-Z and pixel kill
to be disabled.

[1] http://web.archive.org/web/20171026123213/http://limadriver.org/Render_State/

Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10879>

3 years agoac: ac_gpu_info::has_vgt_flush_ngg_legacy_bug
Samuel Pitoiset [Fri, 21 May 2021 06:50:24 +0000 (08:50 +0200)]
ac: ac_gpu_info::has_vgt_flush_ngg_legacy_bug

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10911>

3 years agopanfrost: Rename G52 product ID 0x7402 as G52r1
Ezequiel Garcia [Fri, 21 May 2021 13:08:20 +0000 (10:08 -0300)]
panfrost: Rename G52 product ID 0x7402 as G52r1

As pointed out by Robin Murphy, the new product ID belongs
to IP revision "G52r1".

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10921>

3 years agogallium: remove structure u_resource
Marek Olšák [Wed, 5 May 2021 20:21:56 +0000 (16:21 -0400)]
gallium: remove structure u_resource

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10659>

3 years agogallium: remove empty structure u_resource_vtbl
Marek Olšák [Wed, 5 May 2021 20:14:34 +0000 (16:14 -0400)]
gallium: remove empty structure u_resource_vtbl

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10659>

3 years agogallium: remove u_resource_vtbl::transfer_(un)map
Marek Olšák [Wed, 5 May 2021 20:06:28 +0000 (16:06 -0400)]
gallium: remove u_resource_vtbl::transfer_(un)map

This removes the call indirection.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10659>

3 years agogallium: split transfer_(un)map into buffer_(un)map and texture_(un)map
Marek Olšák [Wed, 5 May 2021 19:27:46 +0000 (15:27 -0400)]
gallium: split transfer_(un)map into buffer_(un)map and texture_(un)map

The u_resource_vtbl indirection is going to be removed.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10659>

3 years agogallium: remove u_resource_vtbl::resource_destroy
Marek Olšák [Wed, 5 May 2021 18:25:20 +0000 (14:25 -0400)]
gallium: remove u_resource_vtbl::resource_destroy

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10659>

3 years agor600: stop using u_resource_vtbl::resource_destroy
Marek Olšák [Wed, 5 May 2021 18:07:18 +0000 (14:07 -0400)]
r600: stop using u_resource_vtbl::resource_destroy

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10659>

3 years agosvga: stop using u_resource_vtbl::resource_destroy
Marek Olšák [Wed, 5 May 2021 18:07:18 +0000 (14:07 -0400)]
svga: stop using u_resource_vtbl::resource_destroy

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10659>

3 years agovirgl: stop using u_resource_vtbl::resource_destroy
Marek Olšák [Wed, 5 May 2021 18:07:18 +0000 (14:07 -0400)]
virgl: stop using u_resource_vtbl::resource_destroy

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10659>

3 years agoi915g: stop using u_resource_vtbl::resource_destroy
Marek Olšák [Wed, 5 May 2021 18:07:18 +0000 (14:07 -0400)]
i915g: stop using u_resource_vtbl::resource_destroy

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10659>

3 years agonouveau: stop using u_resource_vtbl::resource_destroy
Marek Olšák [Wed, 5 May 2021 17:39:20 +0000 (13:39 -0400)]
nouveau: stop using u_resource_vtbl::resource_destroy

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10659>

3 years agor300: stop using u_resource_vtbl::resource_destroy
Marek Olšák [Wed, 5 May 2021 17:27:53 +0000 (13:27 -0400)]
r300: stop using u_resource_vtbl::resource_destroy

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10659>

3 years agoradeonsi: stop using u_resource_vtbl::resource_destroy
Marek Olšák [Wed, 5 May 2021 17:11:27 +0000 (13:11 -0400)]
radeonsi: stop using u_resource_vtbl::resource_destroy

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10659>

3 years agogallium: remove transfer_flush_region from u_resource_vtbl
Marek Olšák [Wed, 5 May 2021 16:55:29 +0000 (12:55 -0400)]
gallium: remove transfer_flush_region from u_resource_vtbl

It's only used by buffers and only zink uses it privately for textures too.
This is part of removing u_resource_vtbl.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10659>

3 years agogallium: remove resource_get_handle from u_resource_vtbl
Marek Olšák [Wed, 5 May 2021 15:37:30 +0000 (11:37 -0400)]
gallium: remove resource_get_handle from u_resource_vtbl

This is the initial step towards removing u_resource_vtbl.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10659>

3 years agogallium: remove unused u_default_transfer_unmap
Marek Olšák [Wed, 5 May 2021 16:14:04 +0000 (12:14 -0400)]
gallium: remove unused u_default_transfer_unmap

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10659>

3 years agozink: don't set u_resource_vtbl
Marek Olšák [Wed, 5 May 2021 17:15:45 +0000 (13:15 -0400)]
zink: don't set u_resource_vtbl

nothing uses it

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10659>

3 years agoci: more freedreno flakes
Mike Blumenkrantz [Fri, 21 May 2021 12:01:19 +0000 (08:01 -0400)]
ci: more freedreno flakes

Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10919>

3 years agofreedreno: Implement TC resource_busy
Rob Clark [Thu, 15 Apr 2021 20:22:23 +0000 (13:22 -0700)]
freedreno: Implement TC resource_busy

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10883>

3 years agofreedreno: Rename internal resource_busy
Rob Clark [Thu, 15 Apr 2021 20:16:30 +0000 (13:16 -0700)]
freedreno: Rename internal resource_busy

So I can re-use the name fd_resource_busy.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10883>

3 years agovc4: initialize array
Juan A. Suarez Romero [Fri, 21 May 2021 10:36:23 +0000 (12:36 +0200)]
vc4: initialize array

This fixes a (rather false) error about accessing an array that it is
uninitialized.

Fixes: 7bc39c8418e ("vc4: Add a dump-the-surface-contents routine.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4816
Cc: mesa-stable
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10918>

3 years agopanfrost: Add PAN_MESA_DEBUG=dirty option
Alyssa Rosenzweig [Wed, 19 May 2021 19:07:38 +0000 (15:07 -0400)]
panfrost: Add PAN_MESA_DEBUG=dirty option

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10888>

3 years agopanfrost: Dirty track fragment images
Alyssa Rosenzweig [Wed, 19 May 2021 18:40:08 +0000 (14:40 -0400)]
panfrost: Dirty track fragment images

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10888>

3 years agopanfrost: Dirty track viewport descriptor
Alyssa Rosenzweig [Wed, 19 May 2021 18:17:48 +0000 (14:17 -0400)]
panfrost: Dirty track viewport descriptor

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10888>

3 years agopanfrost: Dirty track textures/samplers
Alyssa Rosenzweig [Wed, 19 May 2021 18:04:23 +0000 (14:04 -0400)]
panfrost: Dirty track textures/samplers

draws/second on drawoverhead test 4 is improved by 160% (not a typo)

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10888>

3 years agopanfrost: Dirty track RSDs
Alyssa Rosenzweig [Wed, 19 May 2021 17:27:38 +0000 (13:27 -0400)]
panfrost: Dirty track RSDs

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10888>

3 years agopanfrost: Dirty all state when batch is set
Alyssa Rosenzweig [Wed, 19 May 2021 18:27:08 +0000 (14:27 -0400)]
panfrost: Dirty all state when batch is set

State uploads are bound to the batch, so if the batch changes, we
invalidate all state. Theoretically this isn't totally optimal but in
practice it should be good enough.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10888>

3 years agopanfrost: Add the usual clean/dirty helpers
Alyssa Rosenzweig [Wed, 19 May 2021 17:26:45 +0000 (13:26 -0400)]
panfrost: Add the usual clean/dirty helpers

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10888>

3 years agopanfrost: Define dirty tracking flags
Alyssa Rosenzweig [Tue, 18 May 2021 23:25:38 +0000 (19:25 -0400)]
panfrost: Define dirty tracking flags

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10888>

3 years agofrontends/va/picture:Fix wrong reallocation even surface is protected
SureshGuttula [Mon, 17 May 2021 08:52:48 +0000 (14:22 +0530)]
frontends/va/picture:Fix wrong reallocation even surface is protected

This patch will avoid reallocation,if surface is already protected.
Fixing the comparision logic of boolean value(true \ flase) with
PIPE_BIND_PROTECTED.

Fixes: 81be8b3c2f2 ("va/picture: make sure destination buffer is protected if needed")

Signed-off-by: SureshGuttula <suresh.guttula@amd.corp-partner.google.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10916>

3 years agoutil/prim_restart: fix util_translate_prim_restart_ib
Mike Blumenkrantz [Tue, 18 May 2021 23:55:01 +0000 (19:55 -0400)]
util/prim_restart: fix util_translate_prim_restart_ib

this was broken for the indirect case if the indirect draw count or
firstIndex was nonzero and also would rewrite the index buffer onto the
wrong offset of the dst buffer

Fixes: 0c85d6c523f ("gallium/util: factor out primitive-restart rewriting logic")
Fixes: 330d0607ed6 ("gallium: remove pipe_index_buffer and set_index_buffer")

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10909>

3 years agodri: don't call modifier interfaces when modifiers_count is 0
Lucas Stach [Thu, 20 May 2021 16:07:12 +0000 (18:07 +0200)]
dri: don't call modifier interfaces when modifiers_count is 0

The wayland EGL platform sets the modifier count to 0 in some cases
to signal that modifiers should not be used, even if a list of modifiers
is present. The loader_dri_create_image helper didn't handle this case
properly and called the modifierful driver interface with a 0 modifier
count, leading to the obvious outcome of the driver being unable to
allocate an image.

Fixes: cb9ae4273d68 ("dri: add loader_dri_create_image helper")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10903>

3 years agonir/lower_io_to_vector: fix per vertex io handling for arrays
Timothy Arceri [Fri, 14 May 2021 05:31:16 +0000 (15:31 +1000)]
nir/lower_io_to_vector: fix per vertex io handling for arrays

The pass was processing the per vertex index from the wrong end
of the array deref chain.

Fixes: bcd14756eec8 ("nir/lower_io_to_vector: add flat mode")

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10798>

3 years agoiris: Silence warnings about implicit enum type conversions
Ian Romanick [Mon, 12 Apr 2021 19:04:31 +0000 (12:04 -0700)]
iris: Silence warnings about implicit enum type conversions

src/gallium/drivers/iris/iris_state.c: In function ‘iris_create_blend_state’:
src/gallium/drivers/iris/iris_state.c:1284:41: warning: implicit conversion from ‘enum pipe_blendfactor’ to ‘enum GFX125_3D_Color_Buffer_Blend_Factor’ [-Wenum-conversion]
 1284 |          be.SourceBlendFactor           = src_rgb;
      |                                         ^
src/gallium/drivers/iris/iris_state.c:1285:41: warning: implicit conversion from ‘enum pipe_blendfactor’ to ‘enum GFX125_3D_Color_Buffer_Blend_Factor’ [-Wenum-conversion]
 1285 |          be.SourceAlphaBlendFactor      = src_alpha;
      |                                         ^
src/gallium/drivers/iris/iris_state.c:1286:41: warning: implicit conversion from ‘enum pipe_blendfactor’ to ‘enum GFX125_3D_Color_Buffer_Blend_Factor’ [-Wenum-conversion]
 1286 |          be.DestinationBlendFactor      = dst_rgb;
      |                                         ^
src/gallium/drivers/iris/iris_state.c:1287:41: warning: implicit conversion from ‘enum pipe_blendfactor’ to ‘enum GFX125_3D_Color_Buffer_Blend_Factor’ [-Wenum-conversion]
 1287 |          be.DestinationAlphaBlendFactor = dst_alpha;
      |                                         ^
src/gallium/drivers/iris/iris_state.c:1308:28: warning: implicit conversion from ‘enum pipe_blendfactor’ to ‘enum GFX125_3D_Color_Buffer_Blend_Factor’ [-Wenum-conversion]
 1308 |       pb.SourceBlendFactor =
      |                            ^
src/gallium/drivers/iris/iris_state.c:1310:33: warning: implicit conversion from ‘enum pipe_blendfactor’ to ‘enum GFX125_3D_Color_Buffer_Blend_Factor’ [-Wenum-conversion]
 1310 |       pb.SourceAlphaBlendFactor =
      |                                 ^
src/gallium/drivers/iris/iris_state.c:1312:33: warning: implicit conversion from ‘enum pipe_blendfactor’ to ‘enum GFX125_3D_Color_Buffer_Blend_Factor’ [-Wenum-conversion]
 1312 |       pb.DestinationBlendFactor =
      |                                 ^
src/gallium/drivers/iris/iris_state.c:1314:38: warning: implicit conversion from ‘enum pipe_blendfactor’ to ‘enum GFX125_3D_Color_Buffer_Blend_Factor’ [-Wenum-conversion]
 1314 |       pb.DestinationAlphaBlendFactor =
      |                                      ^

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

3 years agoiris: Return correct enum names from fmt_swizzle
Ian Romanick [Mon, 12 Apr 2021 18:45:51 +0000 (11:45 -0700)]
iris: Return correct enum names from fmt_swizzle

SCS_ONE and ISL_CHANNEL_SELECT_ONE (and SCS_ZERO and
ISL_CHANNEL_SELECT_ZERO) have the same values, so this doesn't matter in
practice.  However, some compiler warning options will cause warnings to
be generated.

src/gallium/drivers/iris/iris_state.c: In function ‘fmt_swizzle’:
src/gallium/drivers/iris/iris_state.c:2177:32: warning: implicit conversion from ‘enum GFX125_ShaderChannelSelect’ to ‘enum isl_channel_select’ [-Wenum-conversion]
 2177 |    case PIPE_SWIZZLE_1: return SCS_ONE;
      |                                ^~~~~~~
src/gallium/drivers/iris/iris_state.c:2178:32: warning: implicit conversion from ‘enum GFX125_ShaderChannelSelect’ to ‘enum isl_channel_select’ [-Wenum-conversion]
 2178 |    case PIPE_SWIZZLE_0: return SCS_ZERO;
      |                                ^~~~~~~~

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

3 years agogallium/dri: Allow use of R8G8_R8B8 for YUYV and G8R8_B8R8 for UYVY
Ian Romanick [Sat, 13 Mar 2021 07:03:49 +0000 (23:03 -0800)]
gallium/dri: Allow use of R8G8_R8B8 for YUYV and G8R8_B8R8 for UYVY

v2: Add missing FALLTHROUGH. Caught by CI.

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

3 years agonir/lower_tex: Add support for lowering YUYV formats
Ian Romanick [Sat, 13 Mar 2021 07:07:09 +0000 (23:07 -0800)]
nir/lower_tex: Add support for lowering YUYV formats

v2: Rebase on bc438c91d9b ("nir/lower_tex: ignore texture_index if
tex_instr has deref src")

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

3 years agomesa: Add R8G8_R8B8 and G8R8_B8R8 formats
Ian Romanick [Sat, 13 Mar 2021 07:01:15 +0000 (23:01 -0800)]
mesa: Add R8G8_R8B8 and G8R8_B8R8 formats

These aren't real formats.  They cannot be used with
RenderbufferObjects, Textures, or anything else visible through the GL
API.  The only purpose is to support YUYV textures imported through
EGL_image_external.  There is hardware that can sample from this
subsampled format, but the hardware does not do the colorspace
conversion automatically.

v2: Treat these formats as compressed.  This is a lie, but it seems to
be a less egregious lie than what I was doing before.  It also passes
'ninja test'.

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

3 years agointel/isl: Add mappings for PIPE_FORMAT_R8G8_R8B8_UNORM and PIPE_FORMAT_G8R8_B8R8_UNORM
Ian Romanick [Sat, 13 Mar 2021 02:31:39 +0000 (18:31 -0800)]
intel/isl: Add mappings for PIPE_FORMAT_R8G8_R8B8_UNORM and PIPE_FORMAT_G8R8_B8R8_UNORM

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

3 years agogallium/dri: Add Y21x formats
Ian Romanick [Fri, 12 Mar 2021 20:45:58 +0000 (12:45 -0800)]
gallium/dri: Add Y21x formats

v2: Add all the Y21x tests to the A530 expected fail list.  All of the
YUV image import tests fail on this platform, and nobody has been able
to investigate why.

v3: Update the comment describing the zeroed bits in Y212.  Suggested by
Emma.

v4: Add all Y21x test to the rpi3 expected fail list.

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

3 years agoegl/dri2: Add Y21x formats
Ian Romanick [Fri, 12 Mar 2021 20:41:10 +0000 (12:41 -0800)]
egl/dri2: Add Y21x formats

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

3 years agoutil/format: Add Y21x formats
Ian Romanick [Fri, 12 Mar 2021 20:40:05 +0000 (12:40 -0800)]
util/format: Add Y21x formats

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

3 years agogallium/dri: Add Y41x formats
Ian Romanick [Thu, 11 Mar 2021 04:55:08 +0000 (20:55 -0800)]
gallium/dri: Add Y41x formats

v2: Don't leak __DRI_IMAGE_FOURCC_RGBA16161616 to applications.

v3: Fix typo in __DRI_IMAGE_FOURCC_RGBA16161616 table entry.

v4: Add the Y412 and Y416 tests to the A530 expected fail list.  Many
YUV image import tests fail on this platform, and nobody has been able
to investigate why.

v5: Update the comment describing the zeroed bits in Y412.  Suggested by
Emma.

v6: Add all Y41x test to the rpi3 expected fail list.

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

3 years agoegl/dri2: Add Y41x formats
Ian Romanick [Thu, 11 Mar 2021 04:54:30 +0000 (20:54 -0800)]
egl/dri2: Add Y41x formats

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

3 years agoutil/format: Add Y41x formats
Ian Romanick [Thu, 11 Mar 2021 04:53:46 +0000 (20:53 -0800)]
util/format: Add Y41x formats

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

3 years agonir/lower_tex: Add support for lowering Y41x formats
Ian Romanick [Thu, 11 Mar 2021 03:49:05 +0000 (19:49 -0800)]
nir/lower_tex: Add support for lowering Y41x formats

These are similar to AYUV, but the channel ordering is different... in
such a way that there's no RGBA format that will make the channels line
up right.

v2: Rebase on bc438c91d9b ("nir/lower_tex: ignore texture_index if
tex_instr has deref src")

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

3 years agomesa/st: Always call st_nir_lower_tex_src_plane if samplers were lowered
Ian Romanick [Fri, 14 May 2021 23:30:16 +0000 (16:30 -0700)]
mesa/st: Always call st_nir_lower_tex_src_plane if samplers were lowered

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

3 years agoegl/dri2: Rely on drm-uapi for DRM_FORMAT defines
Ian Romanick [Thu, 11 Mar 2021 04:46:50 +0000 (20:46 -0800)]
egl/dri2: Rely on drm-uapi for DRM_FORMAT defines

All of these formats, and ones that will be added later in this series,
are in the copy of drm_fourcc.h in drm-uapi.

Suggested-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9610>

3 years agodri: Fix typo before __DRI_IMAGE_COMPONENTS defines
Ian Romanick [Tue, 2 Mar 2021 00:21:10 +0000 (16:21 -0800)]
dri: Fix typo before __DRI_IMAGE_COMPONENTS defines

s/are may be/might be/

Also add a missing comma.

v2: Also s/its/it's/.  Suggested by Nanley.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9610>

3 years agoutil/format: Delete trailing whitespace
Ian Romanick [Mon, 1 Mar 2021 23:39:00 +0000 (15:39 -0800)]
util/format: Delete trailing whitespace

The angry red marks in Emacs were annoying me.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9610>

3 years agoiris: Don't advertise Y-tiled modifiers for scanout buffers on Gfx8
Kenneth Graunke [Thu, 20 May 2021 20:04:15 +0000 (13:04 -0700)]
iris: Don't advertise Y-tiled modifiers for scanout buffers on Gfx8

According to isl_gfx7.c:264, the display engine does not support Y
tiled buffers prior to Skylake.  But we exposed I915_FORMAT_MOD_Y_TILED
even when querying for a list of modifiers with PIPE_BIND_SCANOUT set,
which we can't support.  That led to crashes later when we tried to
create such an image, and isl rightly denied it.

Fixes crashes in wflinfo since c03e79d7831f, but the bug exists before
that and it's probably worth a stable backport even without that patch.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4815
Fixes: c03e79d7831 ("loader/dri: hook up createImageWithModifiers2")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10907>

3 years agoi965: Don't advertise Y-tiled modifiers for scanout buffers on Gfx8-
Kenneth Graunke [Thu, 20 May 2021 20:04:15 +0000 (13:04 -0700)]
i965: Don't advertise Y-tiled modifiers for scanout buffers on Gfx8-

According to isl_gfx7.c:264, the display engine does not support Y
tiled buffers prior to Skylake.  But we exposed I915_FORMAT_MOD_Y_TILED
even when querying for a list of modifiers with __DRI_IMAGE_USE_SCANOUT
set, which we can't support.  That led to crashes later when we tried
to create such an image, and isl rightly denied it.

This duplicates a bit of code from ISL, but the isl_gfx6_filter_tiling
function that we ought to use to filter things relies on surf_info,
which we don't have at this stage.  This is probably good enough.

Fixes crashes in wflinfo since c03e79d7831f, but the bug exists before
that and it's probably worth a stable backport even without that patch.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4815
Fixes: c03e79d7831 ("loader/dri: hook up createImageWithModifiers2")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10907>

3 years agoci: Add test which occasionally times out to lavapipe-vk skips
Andres Gomez [Thu, 20 May 2021 07:47:17 +0000 (10:47 +0300)]
ci: Add test which occasionally times out to lavapipe-vk skips

E.g:
  - https://gitlab.freedesktop.org/mesa/mesa/-/jobs/9881541
  - https://gitlab.freedesktop.org/mesa/mesa/-/jobs/9916369

Signed-off-by: Andres Gomez <agomez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10893>

3 years agoisl: Work around NVIDIA and AMD display pitch requirements
Kenneth Graunke [Thu, 20 May 2021 09:03:07 +0000 (02:03 -0700)]
isl: Work around NVIDIA and AMD display pitch requirements

In the case where we're rendering on the Intel GPU, but displaying
on an AMD and NVIDIA GPU, we need to follow their pitch requirements
for our linear scanout buffers.

Based on a patch by Lionel Landwerlin.

Closes: #4706
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10895>

3 years agoi915g: Fix undefined results for TGSI_OPCODE_KILL
Emma Anholt [Tue, 18 May 2021 19:27:34 +0000 (12:27 -0700)]
i915g: Fix undefined results for TGSI_OPCODE_KILL

The swizzle() requires a proper ureg with the 0/1 swizzle fields filled
in, or our ONE swizzles end up reading .x instead.  This meant that we
were killing based on the incoming value of R0.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10874>

3 years agoi915g: Fix writing of undefined depth value if not writing any outputs.
Emma Anholt [Tue, 18 May 2021 19:19:45 +0000 (12:19 -0700)]
i915g: Fix writing of undefined depth value if not writing any outputs.

This was showing up as flakes in CI on tests that didn't write any outputs
but did check the depth result.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10874>

3 years agoi915g: Stop advertising support for indirect addressing in the FS.
Eric Anholt [Wed, 12 Aug 2020 17:51:15 +0000 (10:51 -0700)]
i915g: Stop advertising support for indirect addressing in the FS.

This hardware can't do any form of indirect addressing.  The couple of new
Crashes are the backend falling over when faced with loops/ifs.

Fixes: 8a22064d316e ("i915g: Implement vertex textures.")
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10874>

3 years agoi915g: Add support for the .Absolute flag on TGSI srcs.
Emma Anholt [Tue, 18 May 2021 17:07:11 +0000 (10:07 -0700)]
i915g: Add support for the .Absolute flag on TGSI srcs.

We don't have a way to ask TGSI to not have .Absolute, so lower it in the
backend.

Cc: mesa-stable
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10874>

3 years agoi915g: Make the FS for compile failures write red instead of DIFFUSE.
Emma Anholt [Tue, 18 May 2021 20:56:50 +0000 (13:56 -0700)]
i915g: Make the FS for compile failures write red instead of DIFFUSE.

The DIFFUSE thing would write an undefined result if the shader that
failed to compile didn't read VARYING_SLOT_COL0, causing flakes in CI.
This does make 2 piglit tests that were expecting red spuriously pass.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10874>

3 years agoci/i915g: Introduce manual testing of i915g using anholt's runner.
Emma Anholt [Mon, 17 May 2021 22:06:34 +0000 (15:06 -0700)]
ci/i915g: Introduce manual testing of i915g using anholt's runner.

Now you can mash the button to see how badly i915g's broken these days.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10874>

3 years agoi915g: Fix dumping of the FS in batchbuffers.
Emma Anholt [Mon, 17 May 2021 20:54:10 +0000 (13:54 -0700)]
i915g: Fix dumping of the FS in batchbuffers.

We have to increment off of the packet header before disassembling (same
as i915c's copy of this code).

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10874>

3 years agoi915g: Switch batchbuffer dumping to mesa_logi().
Emma Anholt [Mon, 17 May 2021 20:24:16 +0000 (13:24 -0700)]
i915g: Switch batchbuffer dumping to mesa_logi().

This makes I915_DUMP_CMD=1 actually do something on non-DDEBUG builds.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10874>

3 years agoi915g: Disable 3D-pipeline clears.
Emma Anholt [Mon, 17 May 2021 18:33:26 +0000 (11:33 -0700)]
i915g: Disable 3D-pipeline clears.

The 3D-pipeline fast clears try to emit FS constants before an FS is
necessarily bound, causing segfaults in dEQP.  Plus it flushes the whole
batchbuffer so it'll probably be slower anyway.

Fixes: 6358e6371b31 ("i915g: implement hw clear")
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10874>

3 years agomesa/st: Only use 16-bit ints or floats in the NIR path.
Emma Anholt [Mon, 17 May 2021 19:08:35 +0000 (12:08 -0700)]
mesa/st: Only use 16-bit ints or floats in the NIR path.

For i915g or other drivers using the draw path, llvmpipe (reasonably)
reports int16 support.  However, if we try to link and translate an int16
shader using st_glsl_to_tgsi, it will throw assertion failures.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10874>

3 years agovulkan: Avoid stomping array padding in the MemoryProperties wrapper.
Emma Anholt [Mon, 10 May 2021 19:03:48 +0000 (12:03 -0700)]
vulkan: Avoid stomping array padding in the MemoryProperties wrapper.

The deqp test for it expects that the unused array elements are untouched,
so make sure they don't get replaced with random stack data.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10737>

3 years agovenus: vn_GetAndroidHardwareBufferPropertiesANDROID (part 2/2)
Yiwei Zhang [Mon, 17 May 2021 04:34:06 +0000 (04:34 +0000)]
venus: vn_GetAndroidHardwareBufferPropertiesANDROID (part 2/2)

Support VkAndroidHardwareBufferFormatPropertiesANDROID query.

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

3 years agovenus: vn_GetAndroidHardwareBufferPropertiesANDROID (part 1/2)
Yiwei Zhang [Sun, 16 May 2021 23:59:02 +0000 (23:59 +0000)]
venus: vn_GetAndroidHardwareBufferPropertiesANDROID (part 1/2)

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

3 years agovenus: add ahb image and buffer properties query support
Yiwei Zhang [Thu, 20 May 2021 06:05:09 +0000 (06:05 +0000)]
venus: add ahb image and buffer properties query support

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

3 years agovenus: add vn_android_get_ahb_usage helper function
Yiwei Zhang [Tue, 4 May 2021 23:18:22 +0000 (23:18 +0000)]
venus: add vn_android_get_ahb_usage helper function

See "AHardwareBuffer Usage Equivalence" in the spec.

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

3 years agovenus: add AHB format and VkFormat conversion helper functions
Yiwei Zhang [Wed, 5 May 2021 22:11:23 +0000 (22:11 +0000)]
venus: add AHB format and VkFormat conversion helper functions

See "AHardwareBuffer Format Equivalence" in the spec.

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

3 years agovenus: clean up vn_android api names
Yiwei Zhang [Fri, 14 May 2021 22:58:34 +0000 (22:58 +0000)]
venus: clean up vn_android api names

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

3 years agozink: fix provoking-vertex cap for quads
Erik Faye-Lund [Thu, 20 May 2021 16:32:20 +0000 (18:32 +0200)]
zink: fix provoking-vertex cap for quads

The way we've doing this currently preserves provoking vertex for quads,
so let's report that to the state-tracker.

This fixes a couple of piglits.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10905>

3 years agoir3: Use round-to-nearest-even for fquantize2f16
Connor Abbott [Wed, 19 May 2021 16:18:52 +0000 (18:18 +0200)]
ir3: Use round-to-nearest-even for fquantize2f16

We're supposed to map a floating-point value too large to be represented
as fp16 to infinity, however round-to-zero naturally rounds it down to
the largest representable fp16 number instead. The blob emits a bunch of
fixup code to work around this, but instead we can just do what all the
other drivers seem to do and use round-to-nearest-even instead.

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

3 years agopanfrost/ci: Add one more flake test for G72
Tomeu Vizoso [Thu, 20 May 2021 14:36:10 +0000 (16:36 +0200)]
panfrost/ci: Add one more flake test for G72

dEQP-GLES31.functional.texture.gather.offset_dynamic.implementation_offset.2d_array.rgba8.size_pot.repeat_mirrored_repeat

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10901>

3 years agoaco: remove condition operand from branch in invert block
Daniel Schürmann [Wed, 19 May 2021 13:42:10 +0000 (15:42 +0200)]
aco: remove condition operand from branch in invert block

As value numbering only handles logical blocks, this
could lead to invalid IR until insert_exec_mask().
No fossil-db changes.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10894>

3 years agoradv/cmd_buffer: Fix warning by initializing instance count.
Timur Kristóf [Thu, 20 May 2021 10:43:00 +0000 (12:43 +0200)]
radv/cmd_buffer: Fix warning by initializing instance count.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10806>

3 years agonine: Fix uninitialized warning in texture9.c
Timur Kristóf [Fri, 14 May 2021 15:04:04 +0000 (17:04 +0200)]
nine: Fix uninitialized warning in texture9.c

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10806>

3 years agogallivm: Fix a few uninitialized variable warnings.
Timur Kristóf [Fri, 14 May 2021 15:03:36 +0000 (17:03 +0200)]
gallivm: Fix a few uninitialized variable warnings.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10806>

3 years agoanv: Fix unused function warnings for memory range checks.
Timur Kristóf [Fri, 14 May 2021 14:35:29 +0000 (16:35 +0200)]
anv: Fix unused function warnings for memory range checks.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10806>

3 years agogallium/tessellator: Fix uninitialized variable warnings.
Timur Kristóf [Fri, 14 May 2021 14:31:13 +0000 (16:31 +0200)]
gallium/tessellator: Fix uninitialized variable warnings.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10806>

3 years agoaco/util: Initialize IDSet::bits_set to zero.
Timur Kristóf [Fri, 14 May 2021 13:57:47 +0000 (15:57 +0200)]
aco/util: Initialize IDSet::bits_set to zero.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10806>

3 years agoaco/insert_exec_mask: Fixed unused variable warning in release build.
Timur Kristóf [Fri, 14 May 2021 13:49:47 +0000 (15:49 +0200)]
aco/insert_exec_mask: Fixed unused variable warning in release build.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10806>

3 years agoaux/trace: add missing return value to trace output
Matti Hamalainen [Thu, 13 May 2021 15:53:41 +0000 (18:53 +0300)]
aux/trace: add missing return value to trace output

trace_screen_resource_bind_backing() was missing printing of
the boolean return value. Add it.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10900>

3 years agoradv: Fix compatible image handle type for dmabufs.
Georg Lehmann [Wed, 19 May 2021 21:12:28 +0000 (23:12 +0200)]
radv: Fix compatible image handle type for dmabufs.

Reviewed-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Fixes: 6c83e3ea98b7 ("radv: Add format modifier format queries.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10891>

3 years agoradv: fix heap indices when computing the budget
Samuel Pitoiset [Tue, 18 May 2021 07:14:57 +0000 (07:14 +0000)]
radv: fix heap indices when computing the budget

RADV_HEAP_* is the heap type, not the index.

Fixes dEQP-VK.info.device_memory_budget.

Fixes: 08d162f0b57 ("radv: expose 2/3rd of total memory as VRAM and 1/3rd as GTT on APUs")
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/10852>

3 years agoRevert "radv: Do not access set layout during vkCmdBindDescriptorSets."
Samuel Pitoiset [Mon, 17 May 2021 12:49:24 +0000 (14:49 +0200)]
Revert "radv: Do not access set layout during vkCmdBindDescriptorSets."

This was a temporary workaround for a Baldur's Gate 3 bug which
should now be fixed.

This reverts commit eb104e949ee4b7e0813d14f11a4a952bae48fe80.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3701
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/10839>

3 years agoaco: fix derivatives/intrinsics with SGPR sources
Samuel Pitoiset [Mon, 17 May 2021 13:21:13 +0000 (15:21 +0200)]
aco: fix derivatives/intrinsics with SGPR sources

ds_swizzle_b32 requires a VGPR and DPP can't encode SGPR sources.

Fixes
dEQP-VK.graphicsfuzz.cov-derivative-uniform-vector-global-loop-count.

Cc: 21.1 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10840>

3 years agoaux/trace: trace pipe_screen::resource_create_with_modifiers
Mike Blumenkrantz [Wed, 14 Apr 2021 14:43:46 +0000 (10:43 -0400)]
aux/trace: trace pipe_screen::resource_create_with_modifiers

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10361>

3 years agopanfrost: Streamline varying linking code
Alyssa Rosenzweig [Fri, 7 May 2021 17:24:48 +0000 (13:24 -0400)]
panfrost: Streamline varying linking code

Refactor all the linking code with the following objectives:

* Remove linking magic (especially around XFB)
* Cleaner code (obviously)
* Less stage coupling (in case someone ever implements geom/tess)
* Decouple ATTRIBUTE from ATTRIBUTE_BUFFER to enable optimizations

The main hack remaining is doing precision linking here to workaround
linking previously used.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10778>

3 years agoglsl: Fix packing of matrices for XFB
Alyssa Rosenzweig [Fri, 7 May 2021 23:01:06 +0000 (19:01 -0400)]
glsl: Fix packing of matrices for XFB

The CAP for packed transform feedback concerns packing of unrelated
variables into the same varying slot. (On Mali, transform feedback is
implemented on a per-slot basis, so different variables need different
slots to be written to different buffers.) However, this requirement is
tangential to the packing of arrays, matrices, and structures inherent
to GLSL. These array-like values need to be packed /within/ their slot,
even though drivers using the CAP (just Panfrost) cannot pack
independent values in the slot. Transform feedback of individual
elements is not independent, after all.

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10778>

3 years agoglsl: Fix subscripted arrays with no XFB packing
Alyssa Rosenzweig [Thu, 27 Aug 2020 12:21:40 +0000 (08:21 -0400)]
glsl: Fix subscripted arrays with no XFB packing

We need to duplicate the subscripted members even if they happen to be
aligned, since the other elements may be passed into the consumer
shader. Fixes on Panfrost:

dEQP-GLES3.functional.transform_feedback.array_element.interleaved.lines.highp_float

Note: the test did pass on main previously due to an elaborate set of
driver hacks. I don't believe the old behaviour was correct regardless.

Only Panfrost is affected by this change and the next, as every other
driver sets PIPE_CAP_PACKED_STREAM_OUTPUT.

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10778>

3 years agoasahi: Set PACKED_STREAM_OUTPUT
Alyssa Rosenzweig [Tue, 18 May 2021 17:53:52 +0000 (13:53 -0400)]
asahi: Set PACKED_STREAM_OUTPUT

Lazy copypaste from Panfrost. We don't support XFB yet at all, but when
we do, it will almost certainly be the way every other driver in Mesa
does.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10778>

3 years agoaux/trace: pipe_screen::get_dmabuf_modifier_planes
Mike Blumenkrantz [Wed, 21 Apr 2021 18:08:02 +0000 (14:08 -0400)]
aux/trace: pipe_screen::get_dmabuf_modifier_planes

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10387>

3 years agoaux/trace: propagate pipe_screen::transfer_helper pointer
Mike Blumenkrantz [Wed, 21 Apr 2021 18:05:39 +0000 (14:05 -0400)]
aux/trace: propagate pipe_screen::transfer_helper pointer

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10387>

3 years agoaux/trace: pipe_context::is_dmabuf_modifier_supported
Mike Blumenkrantz [Wed, 21 Apr 2021 17:58:35 +0000 (13:58 -0400)]
aux/trace: pipe_context::is_dmabuf_modifier_supported

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10387>

3 years agoaux/trace: pipe_screen::query_dmabuf_modifiers
Mike Blumenkrantz [Wed, 21 Apr 2021 17:45:53 +0000 (13:45 -0400)]
aux/trace: pipe_screen::query_dmabuf_modifiers

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10387>

3 years agoaux/trace: support pipe_screen::query_memory_info
Mike Blumenkrantz [Wed, 21 Apr 2021 17:36:26 +0000 (13:36 -0400)]
aux/trace: support pipe_screen::query_memory_info

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10387>