Commit Graph

130954 Commits

Author SHA1 Message Date
Pierre Moreau 7507ce1db4 clover: rename platform/device apis using strings
Just add as_string to these to faciliate the non-string ones.

(extracted by airlied from pmoreau patch).

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7520>
2020-11-11 06:07:54 +10:00
Karol Herbst 20a3ec2d77 clover/queue: Flush automatically if applications do not flush themselves
With the image_read_write OpenCL CTS we can get a stack overflow handling
all the events as the application itself never flushes.

We need to address this in two ways:
1. flush the queue once an abritary amoung of events piled up.
2. Drop event deps once they get a fence assigned.

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/7460>
2020-11-10 19:28:26 +00:00
Rob Clark e8a1aa9e94 mesa/bufferobj: Fix valgrind complaints
==328537== Mutex reinitialization: mutex 0x1281afb0, recursion count 0, owner 0.
==328537==    at 0x486FD34: pthread_mutex_init_intercept (drd_pthread_intercepts.c:826)
==328537==    by 0x486FD34: pthread_mutex_init (drd_pthread_intercepts.c:835)
==328537==    by 0x117DA107: mtx_init (threads_posix.h:207)
==328537==    by 0x117DA2BB: simple_mtx_init (simple_mtx.h:132)
==328537==    by 0x117DB86B: _mesa_init_buffer_objects (bufferobj.c:878)
==328537==    by 0x117E8C6F: init_attrib_groups (context.c:840)
==328537==    by 0x117E942F: _mesa_initialize_context (context.c:1225)
==328537==    by 0x1173C323: st_create_context (st_context.c:1019)
==328537==    by 0x11720A9F: st_api_create_context (st_manager.c:930)
==328537==    by 0x1170E2CF: dri_create_context (dri_context.c:163)
==328537==    by 0x11FB9DC3: driCreateContextAttribs (dri_util.c:480)
==328537==    by 0x8E9D3DF: dri3_create_context_attribs (dri3_glx.c:316)
==328537==    by 0x8E9D49B: dri3_create_context (dri3_glx.c:347)
==328537== mutex 0x1281afb0 was first observed at:
==328537==    at 0x486FD34: pthread_mutex_init_intercept (drd_pthread_intercepts.c:826)
==328537==    by 0x486FD34: pthread_mutex_init (drd_pthread_intercepts.c:835)
==328537==    by 0x117DA107: mtx_init (threads_posix.h:207)
==328537==    by 0x117DA2BB: simple_mtx_init (simple_mtx.h:132)
==328537==    by 0x117DB86B: _mesa_init_buffer_objects (bufferobj.c:878)
==328537==    by 0x117E8C6F: init_attrib_groups (context.c:840)
==328537==    by 0x117E942F: _mesa_initialize_context (context.c:1225)
==328537==    by 0x1173C323: st_create_context (st_context.c:1019)
==328537==    by 0x11720A9F: st_api_create_context (st_manager.c:930)
==328537==    by 0x1170E2CF: dri_create_context (dri_context.c:163)
==328537==    by 0x11FB9DC3: driCreateContextAttribs (dri_util.c:480)
==328537==    by 0x8E9D3DF: dri3_create_context_attribs (dri3_glx.c:316)
==328537==    by 0x8E9D49B: dri3_create_context (dri3_glx.c:347)

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7517>
2020-11-10 18:57:55 +00:00
Rob Clark f5ea96b584 mesa/fbo: Fix valgrind complaints
Just statically initialize the dummy/incomplete framebuffer/renderbuffer
to avoid re-intializing their mutex.

==328537== Mutex reinitialization: mutex 0x1281bd28, recursion count 0, owner 0.
==328537==    at 0x486FD34: pthread_mutex_init_intercept (drd_pthread_intercepts.c:826)
==328537==    by 0x486FD34: pthread_mutex_init (drd_pthread_intercepts.c:835)
==328537==    by 0x118F9727: mtx_init (threads_posix.h:207)
==328537==    by 0x118F983B: simple_mtx_init (simple_mtx.h:132)
==328537==    by 0x118FA087: _mesa_init_fbobjects (fbobject.c:93)
==328537==    by 0x117E8CB7: init_attrib_groups (context.c:849)
==328537==    by 0x117E942F: _mesa_initialize_context (context.c:1225)
==328537==    by 0x1173C323: st_create_context (st_context.c:1019)
==328537==    by 0x11720A9F: st_api_create_context (st_manager.c:930)
==328537==    by 0x1170E2CF: dri_create_context (dri_context.c:163)
==328537==    by 0x11FB9DC3: driCreateContextAttribs (dri_util.c:480)
==328537==    by 0x8E9D3DF: dri3_create_context_attribs (dri3_glx.c:316)
==328537==    by 0x8E9D49B: dri3_create_context (dri3_glx.c:347)
==328537== mutex 0x1281bd28 was first observed at:
==328537==    at 0x486FD34: pthread_mutex_init_intercept (drd_pthread_intercepts.c:826)
==328537==    by 0x486FD34: pthread_mutex_init (drd_pthread_intercepts.c:835)
==328537==    by 0x118F9727: mtx_init (threads_posix.h:207)
==328537==    by 0x118F983B: simple_mtx_init (simple_mtx.h:132)
==328537==    by 0x118FA087: _mesa_init_fbobjects (fbobject.c:93)
==328537==    by 0x117E8CB7: init_attrib_groups (context.c:849)
==328537==    by 0x117E942F: _mesa_initialize_context (context.c:1225)
==328537==    by 0x1173C323: st_create_context (st_context.c:1019)
==328537==    by 0x11720A9F: st_api_create_context (st_manager.c:930)
==328537==    by 0x1170E2CF: dri_create_context (dri_context.c:163)
==328537==    by 0x11FB9DC3: driCreateContextAttribs (dri_util.c:480)
==328537==    by 0x8E9D3DF: dri3_create_context_attribs (dri3_glx.c:316)
==328537==    by 0x8E9D49B: dri3_create_context (dri3_glx.c:347)

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7517>
2020-11-10 18:57:55 +00:00
Mike Blumenkrantz 9cef302aa0 util/threaded_context: use driver's ubo alignment for constant buffer uploads
this is another case where the hardcoded value was specific to radeon drivers

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7475>
2020-11-10 18:28:35 +00:00
Rob Clark cb034ae44f freedreno: Protect gmem_cache ralloc allocations
Since the ralloc context for cache_key allocation is shared between all
the contexts hanging off a screen, we need to allocate the key under the
screen->lock.

Fixes: 91f9bb99c5 ("freedreno: add gmem state cache")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7342>
2020-11-10 17:58:45 +00:00
Rob Clark 13d509c7e6 freedreno/drm: Rework APPEND() macro
In particular I wanted the nr_foo increment to be after assignment..
mostly just to track down a potential race.  (This wasn't it, but I
like this color for the bikeshed better.)

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7342>
2020-11-10 17:58:44 +00:00
Rob Clark 2625ba064c freedreno/batch: Cleanup submit immediately after flush
No reason to keep these around if the batch is not immediately unref'd.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7342>
2020-11-10 17:58:44 +00:00
Rob Clark 06b918153d freedreno/drm: Drop growable submit_bos table
Since we are not tracking reloc flags per submit, we can just construct
this table at flush time, rather than using a second growable table that
is in sync with msm_submit->bos.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7342>
2020-11-10 17:58:44 +00:00
Rob Clark 02298ed1fc freedreno: Add submit lock
Add a lock to synchronize batch flush (which can be triggered from a
different ctx) with cmdstream emit.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7342>
2020-11-10 17:58:44 +00:00
Rob Clark 290f827928 freedreno: Make fd_context_batch() return a reference
This protects better against another context triggering a batch flush
and unref while the first context is doing resource tracking.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7342>
2020-11-10 17:58:44 +00:00
Rob Clark 20a813b0eb freedreno/batch: Move fd_batch_get_prologue()
To keep fd_batch_flush() and it's internal helper batch_flush()
together.  Also update an obsolete comment.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7342>
2020-11-10 17:58:44 +00:00
Rob Clark b2f4bf0105 freedreno/drm: Make ring refcnt atomic again
In general, rings are not shared across contexts/threads.  But this
can happen with texture stateobjs, which can be invalidated by other
contexts.

And while we're here, lets convert the rest of freedreno/drm to
u_atomic

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7342>
2020-11-10 17:58:44 +00:00
Rob Clark b1b8e0f8d1 freedreno: Use ctx seqno in batch cache key
It is smaller than a pointer, and doesn't run into problems of context
destroy/create cycle ending up with the same address.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7342>
2020-11-10 17:58:44 +00:00
Rob Clark 1783a156c8 freedreno/a6xx: Texture cache locking
Originally the tex cache was never touched from other contexts, but
rebind_resource() changed that.  Add some locking to protect tex cache
against multi-threaded access.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7342>
2020-11-10 17:58:44 +00:00
Rob Clark 51665dee8c freedreno: batch-cache locking
Move the locking slightly to protect hashtable lookups as well.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7342>
2020-11-10 17:58:44 +00:00
Rob Clark 3f88abd621 freedreno: Fix spurious flush
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7342>
2020-11-10 17:58:44 +00:00
Rob Clark 156d7e45f7 freedreno: Convert to mesa_log*()
debug_printf() isn't terribly great in multi-threaded situations.. but
since we now have a simple util/log.h, which even plays nicely with
logcat on android, lets use that instead.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7342>
2020-11-10 17:58:44 +00:00
Rob Clark a8b9860a97 freedreno: debug cleanup
Fix an extra \n and remove a useless trace (I guess after 7yrs it is no
longer actually TODO)

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7342>
2020-11-10 17:58:44 +00:00
Rob Clark 78b3f58c99 freedreno/drm: Convert to simple_mtx
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7342>
2020-11-10 17:58:44 +00:00
Rob Clark 57a2a5db81 freedreno: Drop fd_context_lock() and friends
These were actually just wrappers for the screen->lock, left over from
moving things around a long time ago.  Lets drop them to make things
more explicit (that we are locking the screen, not the context).

Involves a bit of shuffling things around to untangle header deps, but
no functional change.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7342>
2020-11-10 17:58:44 +00:00
Marek Olšák 0d007349f9 st/mesa: fix use-after-free when updating shader info in st_link_nir
Fixes: 549ae5f8 "st/mesa: make sure prog->info is up to date for NIR (v2)"

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3756
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3685

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7516>
2020-11-10 12:22:43 -05:00
Erik Faye-Lund 6f3716d677 d3d12: avoid searching twice for bos
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7477>
2020-11-10 15:37:07 +00:00
Erik Faye-Lund bd5f928506 d3d12: ensure all compoents of clip-distances are written
This fixes a regression that happened after rebasing on master, where we
end up not writing all components of the clip-distance array, which the
DXIL validation code in the D3D12 runtime treats as an error.

To ensure we don't end up overwriting a previous wrire, enable
nir_shader_compiler_options::lower_all_io_to_temps as well.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7477>
2020-11-10 15:37:07 +00:00
Erik Faye-Lund 2ea15cd661 d3d12: introduce d3d12 gallium driver
This driver will allow running OpenGL and OpenCL on top of Gallium
for any hardware supporting Microsoft's Direct3D 12 on Windows 10.

This is the combination of a lot of commits from our development branch,
containing code from several authors.

Co-authored-by: Bill Kristiansen <billkris@microsoft.com>
Co-authored-by: Gert Wollny <gert.wollny@collabora.com>
Co-authored-by: Jesse Natalie <jenatali@microsoft.com>
Co-authored-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7477>
2020-11-10 15:37:07 +00:00
BillKristiansen 3f31cf64e4 microsoft: add resource state manager utility code
The code originates from this repository:
https://github.com/microsoft/D3D12TranslationLayer

It will be used in the next commit.

Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7477>
2020-11-10 15:37:07 +00:00
Erik Faye-Lund b9c61379ab microsoft/compiler: translate nir to dxil
Here's the code to emit DXIL code from NIR. It's big and bulky as-is,
and it needs to be split up a bit.

This is the combination of a lot of commits from our development branch,
containing code by several authors.

Co-authored-by: Bill Kristiansen <billkris@microsoft.com>
Co-authored-by: Boris Brezillon <boris.brezillon@collabora.com>
Co-authored-by: Daniel Stone <daniels@collabora.com>
Co-authored-by: Gert Wollny <gert.wollny@collabora.com>
Co-authored-by: Jesse Natalie <jenatali@microsoft.com>
Co-authored-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7477>
2020-11-10 15:37:07 +00:00
Erik Faye-Lund dd5fe2f3de microsoft/compiler: add dxil-util code
This is support-code to emit the DirectX Intermediate Language, which is
a dialect of LLVM 3.7 bitcode. Because modern versions of LLVM doesn't
support emitting bitcode for older versions, and we can't rely on an old
LLVM version because we need the OpenCL support from Clang later on, we
instead implement our own LLVM bitcode encoder as part of this work.

See the official DXIL documentation for more details on DXIL:
https://github.com/Microsoft/DirectXShaderCompiler/blob/master/docs/DXIL.rst

The reason this comes as a separate library, is because we're also using
this code as the basis for an OpenCL C compiler, which will follow as a
separate merge-request later.

This is the combination of more than 230 commits from our development
branch, including the work from several authors.

Co-authored-by: Bill Kristiansen <billkris@microsoft.com>
Co-authored-by: Boris Brezillon <boris.brezillon@collabora.com>
Co-authored-by: Daniel Stone <daniels@collabora.com>
Co-authored-by: Gert Wollny <gert.wollny@collabora.com>
Co-authored-by: Jesse Natalie <jenatali@microsoft.com>
Co-authored-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7477>
2020-11-10 15:37:07 +00:00
Erik Faye-Lund 10dfd3cfb4 compiler: add SYSTEM_BIT_FRONT_FACE
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7477>
2020-11-10 15:37:07 +00:00
Louis-Francis Ratté-Boulianne 07d189c416 gallium: Wrap some header files into "extern C"
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7477>
2020-11-10 15:37:07 +00:00
Gert Wollny 449c4baf50 nir/print: print GS extra info
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7477>
2020-11-10 15:37:07 +00:00
Gert Wollny e60df9fe16 util/format_zs: Add C++ include handling
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7477>
2020-11-10 15:37:07 +00:00
Louis-Francis Ratté-Boulianne 51f4a4bee1 gallium/util: Wrap suballoc.h into extern C
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7477>
2020-11-10 15:37:07 +00:00
Erik Faye-Lund f4ff66d75f util/slab: allow usage from c++ code
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7477>
2020-11-10 15:37:07 +00:00
Louis-Francis Ratté-Boulianne c88e314a2d gallium/nir: Wrap tgsi_to_nir header in extern C
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7477>
2020-11-10 15:37:07 +00:00
Erik Faye-Lund 7a1346b26a softpipe: correct signature of get_compiler_options
This gets rid of a harmless but annoying compiler warning on MSVC.

Fixes: 73bafb5ee3 ("gallium: s/unsigned/enum pipe_shader_type/ for get_compiler_options()")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7524>
2020-11-10 15:27:12 +00:00
Boris Brezillon f23574af2c panfrost: Fix ->reads_frag_coord assignment
Let's assign ->reads_frag_coord only once to handle the sysval case
(used on Bifrost) correctly.

Fixes: f1de952b69 ("panfrost: Use shader_info harder")
Cc: 20.3 <mesa-stable>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7527>
2020-11-10 14:34:24 +00:00
Boris Brezillon 35ae9408f2 panfrost: Fix Bifrost blend descriptor emission
Format conversion only works if the num_comps field is set to 4,
probably because the tile buffer always store those 4 components
internally.

Fixes: edd98aac3f ("panfrost: Add support for native wallpapering on Bifrost")
Fixes: 8389976b7c ("panfrost: XML-ify the blend descriptors")
Cc: 20.3 <mesa-stable>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7527>
2020-11-10 14:34:24 +00:00
Alyssa Rosenzweig 7737ca7539 pan/bi: Model writemasks correctly
We don't handle partial write masks in the backend yet, so for now we
can't pretend we do, else we'll have RA bugs. Fixes

dEQP-GLES2.functional.fragment_ops.blend.rgb_func_alpha_func.src.constant_color_dst_alpha

Fixes: b2c6cf2b6d ("pan/bi: Eliminate writemasks in the IR")
Cc: 20.3 <mesa-stable>
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reported-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Tested-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7527>
2020-11-10 14:34:24 +00:00
Lionel Landwerlin e3893ee204 intel/dump_gpu: add support for MMAP_OFFSET ioctl
Our driver started using this method to mmap the BOs and we need to
hook it to track the dirtiness of the BO.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Tested-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7528>
2020-11-10 13:25:11 +00:00
Icecream95 44f2de5286 panfrost: Fix AFBC blits of resources with faked RGTC
Because u_transfer_helper changes resources back from the real format
to the emulated format after creation, we need to fix the format enum
for resources with fake compression when doing blits to/from AFBC.

Fixes: acb8dcfebd ("panfrost: Choose AFBC when available")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7400>
2020-11-10 11:38:35 +00:00
Duncan Hopkins 752f6d8065 zink: setup version dependent VkPhysicalDeviceVulkan*Features and VkPhysicalDeviceVulkan*Properties.
Adds template support to zink_device_info.py for setting up the VkPhysicalDeviceVulkan* version Features and Properties structures.
When the next Vulkan version with newer structure is released a single like should only need to be added.
Note, the 11 structures where not added until Vk 1.2, so that is not a typo.
This code does not stop the use of clonflicting extensions or other VkPhysicalDevice*Features structures with VkPhysicalDeviceVulkan*Features structures when calling vkCreateDevice()

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7496>
2020-11-10 11:21:30 +00:00
Icecream95 19b181f0f5 rbug: Handle non-TGSI shaders
NIR shaders aren't yet transferred over the wire, but at least they
don't cause a crash.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7495>
2020-11-10 11:03:54 +00:00
Icecream95 44875361c8 rbug: Forward get_compiler_options to pipe driver
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7495>
2020-11-10 11:03:54 +00:00
Samuel Pitoiset ec347ee9bc aco: fix combining add/sub to b2i if a new dest needs to be allocated
The uses vector needs to be expanded to avoid out of bounds access
and to make sure the number of uses is initialized to 0.

This fixes combining more v_and(a, v_subbrev_co_u32).

fossilds-db (Vega10):
Totals from 4574 (3.28% of 139517) affected shaders:
SGPRs: 291625 -> 292217 (+0.20%); split: -0.01%, +0.21%
VGPRs: 276368 -> 276188 (-0.07%); split: -0.07%, +0.01%
SpillSGPRs: 455 -> 533 (+17.14%)
SpillVGPRs: 76 -> 78 (+2.63%)
CodeSize: 23327500 -> 23304152 (-0.10%); split: -0.17%, +0.07%
MaxWaves: 22044 -> 22066 (+0.10%)
Instrs: 4583064 -> 4576301 (-0.15%); split: -0.15%, +0.01%
Cycles: 47925276 -> 47871968 (-0.11%); split: -0.13%, +0.01%
VMEM: 1599363 -> 1597473 (-0.12%); split: +0.08%, -0.19%
SMEM: 331461 -> 331126 (-0.10%); split: +0.08%, -0.18%
VClause: 80639 -> 80696 (+0.07%); split: -0.02%, +0.09%
SClause: 155992 -> 155993 (+0.00%); split: -0.02%, +0.02%
Copies: 333482 -> 333318 (-0.05%); split: -0.12%, +0.07%
Branches: 70967 -> 70968 (+0.00%)
PreSGPRs: 187078 -> 187711 (+0.34%); split: -0.01%, +0.35%
PreVGPRs: 244918 -> 244785 (-0.05%)

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7513>
2020-11-10 10:25:00 +01:00
Vinson Lee 7004548bdf turnip: Remove pipeline NULL check.
pipeline cannot be NULL since pipeline->layout->num_sets was just
checked.

Fix defect reported by Coverity Scan.

Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking pipeline suggests that it may be
null, but it has already been dereferenced on all paths leading to
the check.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7521>
2020-11-09 18:02:21 -08:00
Vinson Lee f8844d5c72 swr: Initialize FetchJit member mpFetchInfo in constructor.
Fix defect reported by Coverity Scan.

Uninitialized pointer field (UNINIT_CTOR)
uninit_member: Non-static class member mpFetchInfo is not
initialized in this constructor nor in any functions that it
calls.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jan Zielinski <jan.zielinski@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7359>
2020-11-09 17:02:50 -08:00
Dylan Baker a8467191c3 Reset new features for 21.0 development cycle 2020-11-09 16:21:18 -08:00
Dylan Baker a706bac098
Bump version for 21.0 devel 2020-11-09 16:20:45 -08:00
Anuj Phogat 3c4e43e72b intel: Pointer to SCISSOR_RECT array should be 64B aligned
v2: Apply the workaround to all gen hardawre

Ref: GEN:BUG:1409725701
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7463>
2020-11-09 21:29:04 +00:00