platform/upstream/mesa.git
3 years agoaux/draw: pass the full draw params through to draw_instances()
Mike Blumenkrantz [Thu, 25 Mar 2021 19:04:43 +0000 (15:04 -0400)]
aux/draw: pass the full draw params through to draw_instances()

multidraw depth 1: loop in draw_instances()

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9844>

3 years agoaux/draw: rewrite PRIM_RESTART_LOOP macro as a function
Mike Blumenkrantz [Thu, 25 Mar 2021 18:58:22 +0000 (14:58 -0400)]
aux/draw: rewrite PRIM_RESTART_LOOP macro as a function

this was a bit too intense to work with

no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9844>

3 years agoaux/draw: stop copying draw params unnecessarily
Mike Blumenkrantz [Thu, 25 Mar 2021 18:17:50 +0000 (14:17 -0400)]
aux/draw: stop copying draw params unnecessarily

resolve_draw_info() is only for drawing from streamout, so this check
can be moved forward to avoid overwriting draw params when not necessary

no functional changes at this time

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9844>

3 years agopanfrost: Use the blend shader cache attached to the device
Boris Brezillon [Tue, 23 Mar 2021 11:20:35 +0000 (12:20 +0100)]
panfrost: Use the blend shader cache attached to the device

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9831>

3 years agopanfrost: Move the blend shader cache at the device level
Boris Brezillon [Tue, 23 Mar 2021 11:17:03 +0000 (12:17 +0100)]
panfrost: Move the blend shader cache at the device level

So we can re-use it in the Vulkan driver.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9831>

3 years agobroadcom/compiler: flag TMU reads with a read dependency on last TMU config
Iago Toral Quiroga [Thu, 25 Mar 2021 13:43:20 +0000 (14:43 +0100)]
broadcom/compiler: flag TMU reads with a read dependency on last TMU config

We were using a write dependency to ensure ordering since LDTMUs sequences
are ordered, but by using a write dependency with TMU config we were also
preserving ordering with TMU config writes that are not a sequence
terminator, which is not required and reduces scheduling flexibility.
Instead, use a write dependency to ensure strict ordering of TMU reads,
but only a read depdency with TMU config.

With this change we also need to update CS barriers to also have a write
dependency with TMU reads to ensure that we don't move TMU reads around
CS barriers.

total instructions in shared programs: 13602500 -> 13597851 (-0.03%)
instructions in affected programs: 2681428 -> 2676779 (-0.17%)
helped: 6567
HURT: 4960
Instructions are helped.

total max-temps in shared programs: 2317927 -> 2317914 (<.01%)
max-temps in affected programs: 13861 -> 13848 (-0.09%)
helped: 355
HURT: 300
Inconclusive result (value mean confidence interval includes 0).

total sfu-stalls in shared programs: 32074 -> 32247 (0.54%)
sfu-stalls in affected programs: 848 -> 1021 (20.40%)
helped: 160
HURT: 327
Inconclusive result (%-change mean confidence interval includes 0).

total inst-and-stalls in shared programs: 13634574 -> 13630098 (-0.03%)
inst-and-stalls in affected programs: 2703041 -> 2698565 (-0.17%)
helped: 6558
HURT: 5020
Inst-and-stalls are helped.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9856>

3 years agobroadcom/compiler: flag TMU read dependencies against last TMU config
Iago Toral Quiroga [Thu, 25 Mar 2021 10:36:03 +0000 (11:36 +0100)]
broadcom/compiler: flag TMU read dependencies against last TMU config

Instead of last TMU write. According to the documentation, the entries
in the output FIFO are pushed with the *final* input write for the
lookup, which is the one terminating the sequence. We flag these
with last_tmu_config.

This will allow us to move all TMU register writes for a lookup except
the last one ahead of the LDTMUs for the previous lookup, possibly
allowing us to pair up these writes the wrtmuc instructions for the
same lookup, turning code like this:

nop                  ; nop               ; wrtmuc (tex[0].p0 | 0x3)
nop                  ; nop               ; wrtmuc (tex[2].p1 | 0x1)
nop                  ; nop               ; ldunif (ubo[2]+0xe0)
fadd  r4, rf33, rf51 ; mov  unifa, r5    ; ldunif (ubo[2]+0x110)
fmax  rf34, 0, r4    ; nop
nop                  ; mov  tmut, rf11
nop                  ; mov  tmus, rf0

into:

nop                  ; mov  tmut, rf11   ; wrtmuc (tex[0].p0 | 0x3)
nop                  ; nop               ; wrtmuc (tex[2].p1 | 0x1)
nop                  ; nop               ; ldunif (ubo[2]+0xe0)
fadd  r4, rf33, rf51 ; mov  unifa, r5    ; ldunif (ubo[2]+0x110)
fmax  rf34, 0, r4    ; nop
nop                  ; mov  tmus, rf0

total instructions in shared programs: 13648140 -> 13602500 (-0.33%)
instructions in affected programs: 3497402 -> 3451762 (-1.30%)
helped: 12044
HURT: 3484
Instructions are helped.

total max-temps in shared programs: 2318687 -> 2317927 (-0.03%)
max-temps in affected programs: 17234 -> 16474 (-4.41%)
helped: 615
HURT: 198
Max-temps are helped.

total sfu-stalls in shared programs: 32354 -> 32074 (-0.87%)
sfu-stalls in affected programs: 1462 -> 1182 (-19.15%)
helped: 461
HURT: 188
Sfu-stalls are helped.

total inst-and-stalls in shared programs: 13680494 -> 13634574 (-0.34%)
inst-and-stalls in affected programs: 3514405 -> 3468485 (-1.31%)
helped: 12062
HURT: 3486
Inst-and-stalls are helped.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9856>

3 years agolavapipe: refactor indexed draw dispatch to handle multidraws
Mike Blumenkrantz [Thu, 25 Mar 2021 17:54:01 +0000 (13:54 -0400)]
lavapipe: refactor indexed draw dispatch to handle multidraws

each indexed direct draw cmd now contains n draws (though right now n=1)

indexed draws now also have a flag used to avoid recalculating start index if
a cmdbuf is submitted multiple times

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9843>

3 years agolavapipe: refactor base draw dispatch to handle multidraws
Mike Blumenkrantz [Thu, 25 Mar 2021 17:54:01 +0000 (13:54 -0400)]
lavapipe: refactor base draw dispatch to handle multidraws

each direct draw cmd now contains n draws (though right now n=1)

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9843>

3 years agozink: ci updates
Mike Blumenkrantz [Wed, 24 Mar 2021 19:24:26 +0000 (15:24 -0400)]
zink: ci updates

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9811>

3 years agozink: remove explicit fencing for query results
Mike Blumenkrantz [Fri, 12 Mar 2021 14:00:16 +0000 (09:00 -0500)]
zink: remove explicit fencing for query results

now that the results are automatically being copied to internal buffers,
mapping the buffers will handle any fencing that's required

the only caveat is that the query still needs to be flushed for a result
to be returned

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9811>

3 years agozink: reorder availability handling for (user) qbos
Mike Blumenkrantz [Sun, 14 Mar 2021 23:39:24 +0000 (19:39 -0400)]
zink: reorder availability handling for (user) qbos

if the shortcut method without a staging buffer fails, falling back
to the staging buffer is more sane than silently failing

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9811>

3 years agozink: don't use PARTIAL bit for query results with time queries
Mike Blumenkrantz [Sun, 14 Mar 2021 23:28:52 +0000 (19:28 -0400)]
zink: don't use PARTIAL bit for query results with time queries

this is illegal

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9811>

3 years agozink: bump pools up to 5k queries each
Mike Blumenkrantz [Wed, 24 Mar 2021 19:34:43 +0000 (15:34 -0400)]
zink: bump pools up to 5k queries each

50 is very small and triggers constant stalls; this should probably be
tuned more at some point in the future since even this value is small in
some scenarios

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9811>

3 years agozink: rewrite query internals
Mike Blumenkrantz [Fri, 18 Dec 2020 17:52:05 +0000 (12:52 -0500)]
zink: rewrite query internals

this adds internal qbos to each query which record the results of queries incrementally,
meaning that any time we want the result of a query we just have to read the
buffer back

in particular this opens up some possibilities for further optimization, specifically with
actual qbos where we can now pass the internal qbo off to a compute shader to
mimic the check_query_results() handling and avoid having to actually sync or
do a cpu read

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9811>

3 years agozink: remove special casing for occlusion qbos
Mike Blumenkrantz [Fri, 18 Dec 2020 23:07:00 +0000 (18:07 -0500)]
zink: remove special casing for occlusion qbos

this seems fine now

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9811>

3 years agozink: manually handle more bool query types for copying
Mike Blumenkrantz [Fri, 18 Dec 2020 23:05:23 +0000 (18:05 -0500)]
zink: manually handle more bool query types for copying

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9811>

3 years agozink: remove flush from query buffer copy
Mike Blumenkrantz [Fri, 18 Dec 2020 19:12:22 +0000 (14:12 -0500)]
zink: remove flush from query buffer copy

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9811>

3 years agozink: create result buffers for all query streams
Mike Blumenkrantz [Fri, 18 Dec 2020 17:44:11 +0000 (12:44 -0500)]
zink: create result buffers for all query streams

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9811>

3 years agozink: clean up query creation failure paths
Mike Blumenkrantz [Fri, 18 Dec 2020 17:40:21 +0000 (12:40 -0500)]
zink: clean up query creation failure paths

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9811>

3 years agozink: rework border color handling
Mike Blumenkrantz [Mon, 28 Dec 2020 20:08:46 +0000 (15:08 -0500)]
zink: rework border color handling

we should be matching the format type here to the underlying surface type
for int/float

also we can avoid using a custom border color if the color can be reduced to
a non-custom color

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9793>

3 years agozink: ralloc shader cache and keys
Mike Blumenkrantz [Mon, 14 Dec 2020 19:26:05 +0000 (14:26 -0500)]
zink: ralloc shader cache and keys

hash table keys (keybox) are allocated, so we can avoid leaking them by
allocating everything on a single ralloc context

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9794>

3 years agozink: flatten out buffer creation usage flags codepath
Mike Blumenkrantz [Mon, 4 Jan 2021 16:55:16 +0000 (11:55 -0500)]
zink: flatten out buffer creation usage flags codepath

GL doesn't know what it's doing, so we just need all the flags all the time

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9788>

3 years agozink: toggle between linear/optimal tiling during image creation
Mike Blumenkrantz [Thu, 4 Feb 2021 13:11:13 +0000 (08:11 -0500)]
zink: toggle between linear/optimal tiling during image creation

if we would be creating an unusable image, don't

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9788>

3 years agozink: check image format props before creating image
Mike Blumenkrantz [Wed, 3 Feb 2021 20:34:58 +0000 (15:34 -0500)]
zink: check image format props before creating image

ensure that these attrs are viable before failing silently later on

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9788>

3 years agozink: add color output bit and/or use linear tiling for sampled images
Mike Blumenkrantz [Wed, 3 Feb 2021 20:32:52 +0000 (15:32 -0500)]
zink: add color output bit and/or use linear tiling for sampled images

these need to have some way to get data onto them

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9788>

3 years agozink: incrementally add image usage flags based on device caps
Mike Blumenkrantz [Wed, 3 Feb 2021 20:32:17 +0000 (15:32 -0500)]
zink: incrementally add image usage flags based on device caps

these should be provided, but if not...

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9788>

3 years agozink: create separate vk image/buffer objects for shader image use
Mike Blumenkrantz [Sat, 12 Dec 2020 06:45:29 +0000 (01:45 -0500)]
zink: create separate vk image/buffer objects for shader image use

the STORAGE_TEXEL and STORAGE_IMAGE bits can't be accurately applied due
to opengl allowing all resources to be used everywhere, so instead we can
create a separate object on demand which is used only by shaders and gets
extra barriers inferred along with the base object to avoid desync whenever
it is used

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9788>

3 years agozink: break out barrier struct initializing into helper funcs
Mike Blumenkrantz [Mon, 30 Nov 2020 17:36:24 +0000 (12:36 -0500)]
zink: break out barrier struct initializing into helper funcs

make this and the no-op handling reusable for future extension

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9788>

3 years agozink: reorder barrier util functions to set up barrier struct before batch
Mike Blumenkrantz [Mon, 30 Nov 2020 17:27:24 +0000 (12:27 -0500)]
zink: reorder barrier util functions to set up barrier struct before batch

no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9788>

3 years agozink: make descriptor state invalidate public
Mike Blumenkrantz [Thu, 24 Dec 2020 01:15:22 +0000 (20:15 -0500)]
zink: make descriptor state invalidate public

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9788>

3 years agozink: break out image/buffer create info structs into helper funcs
Mike Blumenkrantz [Sat, 12 Dec 2020 05:40:19 +0000 (00:40 -0500)]
zink: break out image/buffer create info structs into helper funcs

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9788>

3 years agozink: fix format support detection for storage texel buffers and shader images
Mike Blumenkrantz [Thu, 10 Dec 2020 21:49:13 +0000 (16:49 -0500)]
zink: fix format support detection for storage texel buffers and shader images

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9788>

3 years agozink: reset all fences when waiting on batch state
Mike Blumenkrantz [Fri, 27 Nov 2020 14:47:10 +0000 (09:47 -0500)]
zink: reset all fences when waiting on batch state

at this point we know all the states are available, so we can shortcut
future state-finding

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9787>

3 years agozink: stall when we start getting a lot of uncompleted batches
Mike Blumenkrantz [Fri, 27 Nov 2020 14:37:24 +0000 (09:37 -0500)]
zink: stall when we start getting a lot of uncompleted batches

temporary oom handling, though it's unrealistic for this to be hit

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9787>

3 years agozink: use correct surface ref function for context destroy
Mike Blumenkrantz [Mon, 29 Mar 2021 01:27:44 +0000 (21:27 -0400)]
zink: use correct surface ref function for context destroy

the regular surface reference function can never be used in the driver
if it is possible that a surface may be destroyed, as this may reference
a previously-destroyed context

Fixes: 92a5ea13fcd ("zink: implement a global framebuffer cache")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9787>

3 years agozink: only do shader updates when relevant stages are dirty
Mike Blumenkrantz [Wed, 16 Dec 2020 17:02:51 +0000 (12:02 -0500)]
zink: only do shader updates when relevant stages are dirty

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9792>

3 years agolavapipe: fix array texture region copies
Mike Blumenkrantz [Mon, 22 Mar 2021 19:45:37 +0000 (15:45 -0400)]
lavapipe: fix array texture region copies

these need to use different struct members for copying array textures

the buffer2image variants are already doing the right thing

Fixes: b38879f8c5f ("vallium: initial import of the vulkan frontend")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9761>

3 years agozink: also fix image buffer layer copying
Mike Blumenkrantz [Mon, 22 Mar 2021 19:34:18 +0000 (15:34 -0400)]
zink: also fix image buffer layer copying

this differs based on image type

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9759>

3 years agozink: fix handling for image types in resource_copy_region hook
Mike Blumenkrantz [Mon, 22 Mar 2021 19:16:06 +0000 (15:16 -0400)]
zink: fix handling for image types in resource_copy_region hook

different image types are supposed to use different members of this struct
to indicate layer copies, and this can't necessarily be inferred by checking
array_size

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9759>

3 years agolavapipe: remove lvp_descriptor_update_template::descriptor_set_layout
Mike Blumenkrantz [Fri, 26 Mar 2021 18:04:16 +0000 (14:04 -0400)]
lavapipe: remove lvp_descriptor_update_template::descriptor_set_layout

this wasn't used and caused crashes when running with validation enabled
due to violating spec:

This parameter is ignored if templateType is not VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9861>

3 years agolavapipe: ignore templateType when descriptor template isn't for push descriptors
Mike Blumenkrantz [Fri, 26 Mar 2021 12:09:26 +0000 (08:09 -0400)]
lavapipe: ignore templateType when descriptor template isn't for push descriptors

spec compliance requires this and validation may crash without it

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9853>

3 years agor600/sfn: make allocate_temp_register private to valuepool
Gert Wollny [Sat, 27 Mar 2021 16:42:04 +0000 (17:42 +0100)]
r600/sfn: make allocate_temp_register private to valuepool

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9874>

3 years agor600/sfn: use get_temp_vec4 directly when fetching
Gert Wollny [Sat, 27 Mar 2021 16:41:34 +0000 (17:41 +0100)]
r600/sfn: use get_temp_vec4 directly when fetching

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9874>

3 years agor600/sfn: clean up value pool interface usage in emit_stream
Gert Wollny [Sat, 27 Mar 2021 16:41:02 +0000 (17:41 +0100)]
r600/sfn: clean up value pool interface usage in emit_stream

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9874>

3 years agor600/sfn: clean up multi-sample texture load
Gert Wollny [Sat, 27 Mar 2021 16:40:28 +0000 (17:40 +0100)]
r600/sfn: clean up multi-sample texture load

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9874>

3 years agor600/sfn: remove find_msb lowering in driver
Gert Wollny [Sat, 27 Mar 2021 16:15:03 +0000 (17:15 +0100)]
r600/sfn: remove find_msb lowering in driver

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9874>

3 years agor600/sfn: force dual source blend output handling in some cases
Gert Wollny [Mon, 22 Mar 2021 07:18:52 +0000 (08:18 +0100)]
r600/sfn: force dual source blend output handling in some cases

If an output has a dual source index > 0 then we need to emit both
outputs, even if the number of outputs is larger than the number
of active outputs.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9874>

3 years agor600/sfn: remove old deref code
Gert Wollny [Sun, 21 Mar 2021 22:43:23 +0000 (23:43 +0100)]
r600/sfn: remove old deref code

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9874>

3 years agor600/sfn: lowered FS output IO
Gert Wollny [Sun, 21 Mar 2021 21:45:06 +0000 (22:45 +0100)]
r600/sfn: lowered FS output IO

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9874>

3 years agor600/sfn: lower VS IO and drop old deref code
Gert Wollny [Sun, 21 Mar 2021 19:48:19 +0000 (20:48 +0100)]
r600/sfn: lower VS IO and drop old deref code

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9874>

3 years agor600/sfn: drop the local register mep
Gert Wollny [Sun, 21 Mar 2021 18:50:02 +0000 (19:50 +0100)]
r600/sfn: drop the local register mep

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9874>

3 years agor600/sfn: switch assembler creation to use visitor
Gert Wollny [Sun, 21 Mar 2021 17:50:36 +0000 (18:50 +0100)]
r600/sfn: switch assembler creation to use visitor

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9874>

3 years agor600/sfn: fix some formatting
Gert Wollny [Mon, 15 Mar 2021 08:22:38 +0000 (09:22 +0100)]
r600/sfn: fix some formatting

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9874>

3 years agor600/sfn: remove extra parameter from alu assemebly emission
Gert Wollny [Sun, 14 Mar 2021 16:05:24 +0000 (17:05 +0100)]
r600/sfn: remove extra parameter from alu assemebly emission

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9874>

3 years agor600/sfn: Add skelton for visitor pattern
Gert Wollny [Tue, 2 Feb 2021 12:45:50 +0000 (13:45 +0100)]
r600/sfn: Add skelton for visitor pattern

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9874>

3 years agor600/sfn: Make some value pool functions private
Gert Wollny [Sun, 21 Mar 2021 16:48:12 +0000 (17:48 +0100)]
r600/sfn: Make some value pool functions private

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9874>

3 years agoutil/primconvert: Handle indirect and multi-draw
Rob Clark [Sun, 21 Mar 2021 18:08:14 +0000 (11:08 -0700)]
util/primconvert: Handle indirect and multi-draw

Indirect handling was completely missing.  And even though we have to
emulate multi-draw, this pushes it out of the fast/hot path in the
driver's draw_vbo()

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

3 years agofreedreno: Don't handle multi-draw in indirect case
Rob Clark [Sun, 21 Mar 2021 17:37:40 +0000 (10:37 -0700)]
freedreno: Don't handle multi-draw in indirect case

num_draws is only applicable to direct draws, so we can simplify things
a bit.

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

3 years agovirgl: Use util_draw_multi() helper
Rob Clark [Sun, 21 Mar 2021 17:14:10 +0000 (10:14 -0700)]
virgl: Use util_draw_multi() helper

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

3 years agov3d: Use util_draw_multi() helper
Rob Clark [Sun, 21 Mar 2021 17:13:04 +0000 (10:13 -0700)]
v3d: Use util_draw_multi() helper

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9742>

3 years agovc4: Use util_draw_multi() helper
Rob Clark [Sun, 21 Mar 2021 17:12:01 +0000 (10:12 -0700)]
vc4: Use util_draw_multi() helper

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9742>

3 years agotegra: Use util_draw_multi() helper
Rob Clark [Sun, 21 Mar 2021 17:09:57 +0000 (10:09 -0700)]
tegra: Use util_draw_multi() helper

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

3 years agosvga: Use util_draw_multi() helper
Rob Clark [Sun, 21 Mar 2021 17:08:59 +0000 (10:08 -0700)]
svga: Use util_draw_multi() helper

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9742>

3 years agosoftpipe: Use util_draw_multi() helper
Rob Clark [Sun, 21 Mar 2021 17:08:00 +0000 (10:08 -0700)]
softpipe: Use util_draw_multi() helper

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

3 years agor600: Use util_draw_multi() helper
Rob Clark [Sun, 21 Mar 2021 17:05:57 +0000 (10:05 -0700)]
r600: Use util_draw_multi() helper

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

3 years agor300: Use util_draw_multi() helper
Rob Clark [Sun, 21 Mar 2021 17:04:07 +0000 (10:04 -0700)]
r300: Use util_draw_multi() helper

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

3 years agonouveau: Use util_draw_multi() helper
Rob Clark [Sun, 21 Mar 2021 17:01:43 +0000 (10:01 -0700)]
nouveau: Use util_draw_multi() helper

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9742>

3 years agollvmpipe: Use util_draw_multi() helper
Rob Clark [Sun, 21 Mar 2021 16:59:16 +0000 (09:59 -0700)]
llvmpipe: Use util_draw_multi() helper

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

3 years agolima: Use util_draw_multi() helper
Rob Clark [Sun, 21 Mar 2021 16:58:29 +0000 (09:58 -0700)]
lima: Use util_draw_multi() helper

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9742>

3 years agoiris: Use util_draw_multi() helper
Rob Clark [Sun, 21 Mar 2021 16:57:17 +0000 (09:57 -0700)]
iris: Use util_draw_multi() helper

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9742>

3 years agoi915: Use util_draw_multi() helper
Rob Clark [Sun, 21 Mar 2021 16:52:48 +0000 (09:52 -0700)]
i915: Use util_draw_multi() helper

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

3 years agoetnaviv: Use util_draw_multi() helper
Rob Clark [Sun, 21 Mar 2021 16:51:14 +0000 (09:51 -0700)]
etnaviv: Use util_draw_multi() helper

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9742>

3 years agod3d12: Use util_draw_multi() helper
Rob Clark [Sun, 21 Mar 2021 16:49:08 +0000 (09:49 -0700)]
d3d12: Use util_draw_multi() helper

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9742>

3 years agofreedreno/a6xx: Fix obsolete comment
Rob Clark [Sat, 27 Mar 2021 16:24:00 +0000 (09:24 -0700)]
freedreno/a6xx: Fix obsolete comment

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

3 years agofreedreno/a6xx: Fix indirect+patches draws
Rob Clark [Fri, 26 Mar 2021 20:49:49 +0000 (13:49 -0700)]
freedreno/a6xx: Fix indirect+patches draws

Without TC, we'd get draw->count==0.. which is obviously not correct.
With TC we get random garbage for draw->count.  Which turns into
exciting things like trying to allocate multi-gigabyte buffers for
tess param/factor buffers.

But we can just tell the CP to split up large tess draws, and put an
upper bound on the tess param/factor buffer sizes.

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

3 years agoci: Disable panfrost t760
Rob Clark [Sat, 27 Mar 2021 18:17:40 +0000 (11:17 -0700)]
ci: Disable panfrost t760

The runners appear to be down at the moment.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9872>

3 years agointel/common: disable batch decoder on Android platform
Tapani Pälli [Fri, 26 Mar 2021 09:20:03 +0000 (11:20 +0200)]
intel/common: disable batch decoder on Android platform

when building with Meson. It requires libexpat that is not available
on Android and we want to avoid it.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9848>

3 years agor600: Handle negate of second operator in TGSI_OPCODE_UADD
Gert Wollny [Sat, 13 Mar 2021 11:06:33 +0000 (12:06 +0100)]
r600: Handle negate of second operator in TGSI_OPCODE_UADD

nir_to_tgsi lowers nir_op_isub to UADD and the negate source mod
on the second operator. Since r600 doesn't support source mods
for integers but support SUB_INT we switch the opcode and clear the
negate flag.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9579>

3 years agozink: remove no-longer-needed clipdist1 patching
Erik Faye-Lund [Fri, 26 Mar 2021 15:34:48 +0000 (16:34 +0100)]
zink: remove no-longer-needed clipdist1 patching

Since the last round of enhanced layout packing, it seems like this code
is no longer needed. This allows us to use the HANDLE_EMIT_BUILTIN()
macro, which simplifies things further.

It would have been incorrect anyway, because it's the only code that
uses the location directly as an index. All other locations multiplies
it by four first.

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

3 years agoandroid: amd/addrlib: define endianess to build
Mauro Rossi [Sat, 27 Mar 2021 00:50:16 +0000 (01:50 +0100)]
android: amd/addrlib: define endianess to build

Fixes the following building error:

In file included from external/mesa/src/amd/addrlib/src/gfx9/gfx9addrlib.cpp:36:
external/mesa/src/amd/addrlib/src/chip/gfx9/gfx9_gb_reg.h:43:2: error: "BIGENDIAN_CPU or LITTLEENDIAN_CPU must be defined"
 ^

NOTE: Android ABI specifies Little Endian for arm and x86 targets

Fixes: 3616e02ef3ee ("amd/addrlib: define endianess differently")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9869>

3 years agozink: ci updates
Mike Blumenkrantz [Fri, 26 Mar 2021 11:20:28 +0000 (07:20 -0400)]
zink: ci updates

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9852>

3 years agolavapipe: stop tracking draw start/count on rendering state
Mike Blumenkrantz [Fri, 26 Mar 2021 11:16:47 +0000 (07:16 -0400)]
lavapipe: stop tracking draw start/count on rendering state

this is garbage data for indirect draws and irrelevant for the rest

Fixes: 448e60314ae ("lavapipe: add transform feedback support")
Fixes: 1cd455b17b7 ("gallium: extend draw_vbo to support multi draws")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9852>

3 years agofreedreno/a6xx: Use the frontend userclip lowering.
Eric Anholt [Thu, 25 Feb 2021 00:06:05 +0000 (16:06 -0800)]
freedreno/a6xx: Use the frontend userclip lowering.

This ends up being way more piglit-conformant than our backend lowering.

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

3 years agonir: Update clip_distance_array_size in clip lowering.
Eric Anholt [Wed, 24 Mar 2021 21:04:52 +0000 (14:04 -0700)]
nir: Update clip_distance_array_size in clip lowering.

If we've added the array, then we should update the info.  This is the
value that gallium drivers setting !PIPE_CAP_CLIP_PLANES have to use in
place of rasterizer->clip_planes_enabled.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9815>

3 years agointel/nullhw: fix build
Lionel Landwerlin [Fri, 26 Mar 2021 08:54:49 +0000 (10:54 +0200)]
intel/nullhw: fix build

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

3 years agogitlab-ci: fix vulkan build layer enabling
Lionel Landwerlin [Fri, 26 Mar 2021 14:50:08 +0000 (16:50 +0200)]
gitlab-ci: fix vulkan build layer enabling

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 54fe5b0482df0f ("meson: switch vulkan layer to list of choices")
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9858>

3 years agoradv: Enable DCC for image stores on GFX10.
Bas Nieuwenhuizen [Fri, 18 Sep 2020 12:22:59 +0000 (14:22 +0200)]
radv: Enable DCC for image stores on GFX10.

Since image stores can now compress and we can't track image stores
this also stops using predication for DCC decompression.

In GFX10 this was benchmarked to be faster. For GFX10.3 the microbenchmarks
are not as possible though I haven't tested any games, so this is not enabled
there yet.

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

3 years agoradv: Use 8x8 meta compute workgroups.
Bas Nieuwenhuizen [Mon, 5 Oct 2020 02:31:36 +0000 (04:31 +0200)]
radv: Use 8x8 meta compute workgroups.

For 16x16 we get 4 16x4 waves, which is bad for DCC image stores.
The workgroup size doesn't really matter for speed, the important
part is the number of waves, which should stay constant here.
(Though some optimization would be nice, but out of scope for this
patch)

The compute DCC compress shader still uses 16x16 due to functional
requirements (and we're sure it won't write with DCC compression ...)

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

3 years agov3dv: define a default attribute values with float type
Alejandro Piñeiro [Thu, 25 Mar 2021 12:30:55 +0000 (13:30 +0100)]
v3dv: define a default attribute values with float type

We are providing a BO with the default attribute values for the
GL_SHADER_STATE_RECORD, that contains 16 vec4. Such default value for
each vec4 is (0, 0, 0, 1). As the attribute format could be int or
float, the "1" value needs to take into account the attribute format.

But in the practice, the most common case is all floats. So we create
one default attribute values BO assuming that all attributes will be
floats, and we store it at v3dv_device and only create a new one if a
int format type is defined. That allows to reduce the amount of BOs
needed.

Note that we could still try to reduce the amount of BOs used by the
pipelines if we create a bigger BO, and we just play with the
offsets. But as mentioned, that's not the usual, and would add an
extra complexity,so it is not a priority right now.

This makes the following test passing when disabling the pipeline
cache support:
dEQP-VK.api.object_management.max_concurrent.graphics_pipeline

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9845>

3 years agoaco/isel: Add documentation for (u)int64->f16 conversion
Tony Wasserka [Fri, 12 Mar 2021 10:13:51 +0000 (11:13 +0100)]
aco/isel: Add documentation for (u)int64->f16 conversion

The upper 32 bits are truncated before converting, which still produces
correct results since they never meaningfully contribute to the result.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9597>

3 years agoaco/isel: Fix large inputs being truncated in int32->f16 conversions
Tony Wasserka [Tue, 16 Mar 2021 09:52:39 +0000 (10:52 +0100)]
aco/isel: Fix large inputs being truncated in int32->f16 conversions

The previous code produced incorrect results for inputs outside the
range [INT16_MIN, INT16_MAX].

A problematic case is e.g. i2f16 32768, which previously would be
converted to -32768.0 instead of returning the exactly representable
floating point result.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9597>

3 years agoaco/isel: Add documentation and asserts for convert_int
Tony Wasserka [Fri, 12 Mar 2021 10:25:06 +0000 (11:25 +0100)]
aco/isel: Add documentation and asserts for convert_int

This function has evolved to be a generic helper function used throughout
the file, so having those assumptions written down explicitly and document
unsupported edge cases should help prevent incorrect use.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9597>

3 years agoaco/isel: Don't request sign extension when truncating signed integers
Tony Wasserka [Mon, 22 Mar 2021 16:10:05 +0000 (17:10 +0100)]
aco/isel: Don't request sign extension when truncating signed integers

This doesn't change semantics but allows us to reject this potentially
ambiguous configuration in convert_int in a later change.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9597>

3 years agoaco/isel: Fix i64/u64->float32 conversion for large inputs
Tony Wasserka [Mon, 15 Mar 2021 11:26:51 +0000 (12:26 +0100)]
aco/isel: Fix i64/u64->float32 conversion for large inputs

Previously, inputs such as 0x100000000 would have their upper 32-bits
ignored despite being representable by 32-bit floats.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9597>

3 years agoaco/isel: Don't emit unsupported i16<->f16 conversion opcodes on GFX6/7
Tony Wasserka [Wed, 10 Mar 2021 11:07:43 +0000 (12:07 +0100)]
aco/isel: Don't emit unsupported i16<->f16 conversion opcodes on GFX6/7

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: b86305bb573 ("nir/algebraic: collapse conversion opcodes (many patterns)")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4357
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9597>

3 years agozink: tighten emitted image spir-v caps
Erik Faye-Lund [Fri, 26 Mar 2021 13:22:01 +0000 (14:22 +0100)]
zink: tighten emitted image spir-v caps

We might only need to emit a read or write cap for a given image. This
could provide the Vulkan driver with the chance to optimize things
slightly.

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

3 years agoradv: report that degenerated triangles are not culled
Samuel Pitoiset [Tue, 16 Mar 2021 09:27:05 +0000 (10:27 +0100)]
radv: report that degenerated triangles are not culled

I don't think the hw culls these primitives and NGG culling isn't
yet a thing. This also matches PAL.

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

3 years agoRevert "egl: Don't add hardware device if there is no render node v2."
Simon Ser [Thu, 18 Mar 2021 20:47:05 +0000 (21:47 +0100)]
Revert "egl: Don't add hardware device if there is no render node v2."

This reverts commit 5743a36b2b32a91eaf82c8d109932fe4fea01233.

Now that _eglAddDevice is always called with the correct software
hint, no need to bail out if the device doesn't have a render node.
On split render/display SoCs, the DRM device won't have a render
node, yet rendering is hardware-accelerated (via kmsro).

Signed-off-by: Simon Ser <contact@emersion.fr>
Fixes: 5743a36b2b32 ("egl: Don't add hardware device if there is no render node v2.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4178
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9697>

3 years agoegl: only take render nodes into account when listing DRM devices
Simon Ser [Thu, 25 Mar 2021 17:42:06 +0000 (18:42 +0100)]
egl: only take render nodes into account when listing DRM devices

We don't want to expose an EGL device for a display-only DRM devices
(like VKMS). For these DRM devices we have a separate software-rendering
device (the first in the list, always present).

There is a similar check in _eglAddDRMDevice, however it will be
removed in a future commit to allow split render/display devices
to be properly added. We can't figure out whether we're on a split
render/display system before loading the driver.

Signed-off-by: Simon Ser <contact@emersion.fr>
Fixes: 5743a36b2b32 ("egl: Don't add hardware device if there is no render node v2.")
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9697>