Commit Graph

137984 Commits

Author SHA1 Message Date
Kenneth Graunke 09072a0803 iris: Fix and refactor check for clear color being fully zero
I missed updating this code to check res->aux.clear_color_unknown when
I added it a while back.  While we're here, also refactor this code into
a helper function - I'll want to use it in another place shortly.

Fixes: e83da2d8e3 ("iris: Don't try to CPU read imported clear color BOs")

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14687>
2022-01-24 23:27:25 +00:00
Kenneth Graunke 053251f18c iris: Implement iris_blorp_exec() for the blitter engine
This splits iris_blorp_exec() into separate functions for executing on
the render command streamer and the blitter command streamer.  A future
patch could add a separate iris_blorp_exec_compute() path that skips a
bunch of render-specific work.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14687>
2022-01-24 23:27:25 +00:00
Kenneth Graunke e00985d5d4 iris: Set BLORP_BATCH_USE_{COMPUTE,BLITTER} flags for the target batch
This makes blits, copies, and (non-fast) clears set the appropriate
BLORP_BATCH_USE_{COMPUTE,BLITTER} flag if their batch is either
IRIS_BATCH_COMPUTE or IRIS_BATCH_BLITTER.  We ignore the other
operations for now as those don't support compute or blit yet.

Of course, there is no code to attempt to launch BLORP operations on
either the compute or blitter batches yet, but that will come in time.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14687>
2022-01-24 23:27:25 +00:00
Kenneth Graunke cc03726165 iris: Only have one blorp_batch_init/finish in iris_copy_region()
This is a little simpler, and gives us one place to change flags.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14687>
2022-01-24 23:27:25 +00:00
Kenneth Graunke a90a1f15a7 iris: Create an IRIS_BATCH_BLITTER for using the BLT command streamer
We removed all the hardware blitter support from i965 years ago because
the blitter was not worth using (limited functionality, bad performance,
extra synchronization, and worse).  However, on Tigerlake there are new
blitter commands that are actually fast and allow us to do proper
asynchronous copies while 3D is busy doing other work.

So, reintroduce the blitter.  We'll want to use it.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14687>
2022-01-24 23:27:25 +00:00
Kenneth Graunke 31eeb72e45 blorp: Add support for blorp_copy via XY_BLOCK_COPY_BLT
This introduces a new blorp_copy() path using the new XY_BLOCK_COPY_BLT
blitter command introduced on Tigerlake.  Unlike the blitter commands of
old, this one is actually fast and worth using.  Although it doesn't use
shaders like the rest of BLORP, we still can use some surface-munging
code from there, and BLORP also provides a nice place to put this which
is shared among the drivers.

To use the new path, set BLORP_BATCH_USE_BLITTER (much like Jordan's
recent BLORP_BATCH_USE_COMPUTE bit) and target the batch at the copy
engine.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14687>
2022-01-24 23:27:25 +00:00
Kenneth Graunke 4d4f57b15c isl: Add isl_dev->mocs.blitter_{src,dst} fields
These will be used for XY_BLOCK_COPY_BLT on XeHP.

Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14687>
2022-01-24 23:27:25 +00:00
Kenneth Graunke abd71630fc blorp: Add a blorp_address::local_hint flag
This will be used as a performance hint for XY_BLOCK_COPY_BLT to
indicate whether the source/destination surfaces are (likely) in
device-local memory or system memory.  We don't need to be precise
here - it's okay to set the fields to LOCAL even if a buffer has
been evicted out to system memory.

We should set this from Vulkan too, but I haven't yet.  There isn't
a convenient anv_bo field like there is in iris...

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14687>
2022-01-24 23:27:25 +00:00
Kenneth Graunke 5262475242 intel/dev: Add a has_flat_ccs flag
This should only be set on XeHP.  It implies that CCS works via based on
the virtual addresses involved and a flat memory carve-out, rather than
treating CCS like a surface, or using auxiliary maps.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14687>
2022-01-24 23:27:25 +00:00
Kenneth Graunke 3e0bffbad3 intel/genxml: Add XY_BLOCK_COPY_BLT Color Depth enum values
Requested by Jason.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14687>
2022-01-24 23:27:25 +00:00
Kenneth Graunke 79b199b333 intel: Allow copy engine class in intel_gem_create_context_engines()
I want to use I915_ENGINE_CLASS_COPY in iris.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14687>
2022-01-24 23:27:25 +00:00
Mike Blumenkrantz 08ffbc055b lavapipe: remove unused struct member
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14695>
2022-01-24 22:55:07 +00:00
Thomas H.P. Andersen 73232d000f anv: drop unused label
Added in 053d4c328f
Last usage removed in 0967584549

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14639>
2022-01-24 22:23:33 +00:00
Mike Blumenkrantz 3dcf275786 vulkan/wsi: add VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT for swapchain image caps
I need this, and drivers can do it, so add it

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14641>
2022-01-24 21:53:21 +00:00
Dave Airlie f6926efaad mesa/st: move st_fb_orientation into a mesa function
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14675>
2022-01-25 07:04:27 +10:00
Dave Airlie 840aabe752 mesa/st: move invalidate_on_gl_viewport to ctx
This is cleaner in the gl context now.

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14675>
2022-01-25 07:04:23 +10:00
Dave Airlie 0ba5def21a mesa/st: move manager colorbuffer interface to gl_context.
This just avoids some st_context in main.

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14675>
2022-01-25 07:04:19 +10:00
Dave Airlie 2f14e0d695 mesa/st: move renderbuffer format choosing wrapper into mesa.
This moves this and cleans up the results.

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14675>
2022-01-25 07:04:16 +10:00
Dave Airlie f74648f912 mesa/st: move last of renderbuffer functionality into mesa
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14675>
2022-01-25 07:04:12 +10:00
Dave Airlie 98df4f7a83 mesa/st: migrate blit code into mesa
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14675>
2022-01-25 07:04:09 +10:00
Dave Airlie 5f675630d9 mesa/st: fixup viewport drawable invalidation
This moves the code into more appropriate places

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14675>
2022-01-25 07:04:04 +10:00
Dave Airlie 018251908e mesa/st: move some fbo helpers around.
This inlines one, and moves the other to a more appropriate place

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14675>
2022-01-25 07:04:01 +10:00
Dave Airlie 9c7e79c4b7 mesa/st: move st_new_renderbuffer_fb to manager
This is st_manager code really.

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14675>
2022-01-25 07:03:57 +10:00
Dave Airlie b70b738bd1 mesa/st: move map/unmap renderbuffer code into mesa
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14675>
2022-01-25 07:03:55 +10:00
Dave Airlie 90e4e7cf74 mesa/st: move st renderbuffer code into mesa renderbuffer
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14675>
2022-01-25 07:03:49 +10:00
Dave Airlie f88fb21885 mesa/st: move DrawBufferAllocate into mesa.
Little bit of refactoring here.

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14675>
2022-01-25 07:03:45 +10:00
Dave Airlie 57dcaac31d mesa/st: move st_ReadBuffer functionality into mesa
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14675>
2022-01-25 07:03:42 +10:00
Dave Airlie e9b12fe20e mesa/st: move validate/discard framebuffer into mesa
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14675>
2022-01-25 07:03:39 +10:00
Dave Airlie caa7009cff mesa/st: move render/finish_render texture in to mesa.
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14675>
2022-01-25 07:03:36 +10:00
Dave Airlie 7645e24045 mesa/st: merge framebuffer objects from st to mesa
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14675>
2022-01-25 07:03:32 +10:00
Dave Airlie 21d4dd8c39 mesa/st: move some renderbuffer code into mesa
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14675>
2022-01-25 07:03:27 +10:00
Dave Airlie 527b6ca412 mesa/st: merge st_renderbuffer into gl_renderbuffer.
This touches lots of places

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14675>
2022-01-25 07:03:23 +10:00
Jesse Natalie 0b6caed85c mesa/st: Lower user clip planes for tess eval too
The logic in st_atom_shader.c leads me to believe this was supposed
to work, but was incomplete to actually finish it. This fixes
compatibility tess tests on d3d12.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14662>
2022-01-24 09:13:57 -08:00
Alyssa Rosenzweig c85df67f27 pan/decode: Fix missing newlines in error messages
Otherwise these error message lines end up truncated, which is a bit
annoying.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reported-by: Icecream95 <ixn@disroot.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14575>
2022-01-24 16:20:49 +00:00
Alyssa Rosenzweig 2bdfa4800d pan/bi: Pull BLEND precolouring out of per-dest loop
Indentation fail. This should happen once per instruction, not once per
destination. In theory, this is a minor performance win; in practice,
it's simply less wrong.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reported-by: Icecream95 <ixn@disroot.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14575>
2022-01-24 16:20:49 +00:00
Alyssa Rosenzweig 1e5bb54f59 panfrost: Only cull polygons
The spec says only polygons, not points/lines, should be culled when
culling is enabled. The hardware does not make this distinction, so we
have to.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reported-by: Icecream95 <ixn@disroot.org>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14575>
2022-01-24 16:20:49 +00:00
Alyssa Rosenzweig 3f1abda631 panfrost: Use u_reduced_prim for primitive checks
Use a Gallium helper that papers over the differences between primitive
types, as required by hardware operation.

[Cc'd to mesa-stable for use in the next commit.]

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14575>
2022-01-24 16:20:49 +00:00
Rob Clark 2dfebf3487 freedreno/a5xx: Fix clip_mask
The clip_mask needs to also take into account rast->clip_plane_enable

Fixes: 99838513ae ("freedreno/a5xx: Add support for clip distances and use them for userclip.")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14643>
2022-01-24 15:51:47 +00:00
Rob Clark d26cdfac2c freedreno/a6xx: Fix clip_mask
The clip_mask needs to also take into account rast->clip_plane_enable

Fixes: f2ae8d116a ("freedreno/a6xx: Implement user clip/cull distances")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14643>
2022-01-24 15:51:47 +00:00
Rob Clark 5e2bd30ea4 freedreno: Add FD_DIRTY_RASTERIZER_CLIP_PLANE_ENABLE
Add a dirty bit for clip_plane_enable changes.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14643>
2022-01-24 15:51:47 +00:00
Rob Clark c190356040 freedreno: Pass shader cache key instead of shader key
We are going to need to extend the cache key to add state that effects
the program stateobj, but not necessarily the shader itself (ie. so
ir3_shader_key wouldn't be the correct place to add it).

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14643>
2022-01-24 15:51:47 +00:00
Rob Clark 26d591a669 mesa/st: Lowered ucp should still mark rast state dirty
Lowered clip planes should respect the enabled/disabled GL_CLIP_PLANEn
(aka GL_CLIP_DISTANCEn), which means updating the rast state as well.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14643>
2022-01-24 15:51:47 +00:00
Alyssa Rosenzweig b4108e1d01 agx: Lower UBO loads to use per-element indexing
This lets us support indirect access to UBOs easily. The existing
constant special case disappears too, since the peephole optimizer can
inline the constant later. (note: this is too conservative since we can
go up to 16-bit immediates...)

Unfortunately, nir_opt_algebraic can't seem to optimize expressions like
"((a << 3) + 4) >> 2" to "(a << 1) + 1" which would be necessary for
reasonable perf out of this...

Fixes:

dEQP-GLES2.functional.shaders.indexing.uniform_array.float_dynamic_loop_read_fragment

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14581>
2022-01-24 14:25:18 +00:00
Iago Toral Quiroga a6aa35a091 v3dv: implement VK_KHR_driver_properties
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14680>
2022-01-24 13:56:39 +00:00
Bas Nieuwenhuizen 492dc06fbe radv: Remove VK_EXT_display_control support in favor of common impl.
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14365>
2022-01-24 12:57:35 +00:00
Bas Nieuwenhuizen 3443557364 anv: Remove VK_EXT_display_control support in favor of common impl.
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14365>
2022-01-24 12:57:35 +00:00
Bas Nieuwenhuizen ce95871a50 vulkan/wsi/display: Add common implementation of VK_EXT_display_control.
Based on the new vk_sync functions.

Copied the version from anv as that seemed more thorough by using the
temporary sync payload. However that does mean we have do use the vk_sync
functions instead of being able to layer it on top of the dispatch table.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14365>
2022-01-24 12:57:35 +00:00
Rohan Garg 63e91148b7 anv: Enable VK_VALVE_mutable_descriptor_type
This change introduces the anv_descriptor_size_for_mutable_type and
anv_descriptor_data_for_mutable_type helpers to compute the size and
data flags respectively for mutable descriptor types.

In order to make handling these types easier we now store a precomputed
descriptor stride for all types and use in the in appropriate places.

We also need to adjust the compiler to take into account this descriptor
stride. To that extent, we now pack the stride into the upper 16 bits
alongside the index and the dynamic offset index and use it later to
compute the correct offset.

Closes: #4250
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14633>
2022-01-24 12:24:53 +00:00
Jianxun Zhang e1376b59ef anv: refactor queue chain
Simplify the buffer chaining process with a single loop and
a helper function from Lionel Landwerlin's input.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Jianxun Zhang <jianxun.zhang@linux.intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14578>
2022-01-24 11:53:06 +00:00
Iago Toral Quiroga be11948a95 broadcom/simulator: handle DRM_V3D_PARAM_SUPPORTS_MULTISYNC_EXT
Without this the simulator wrapper will abort upon seeing this
query, rendering the driver unusable in that context.

Also, it seems the simulator environment doesn't quite work with
multisync at present, so do not enable it until we figure out what
the issue is.

Reviewed-by: Melissa Wen <mwen@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14678>
2022-01-24 11:34:00 +00:00