Commit Graph

64412 Commits

Author SHA1 Message Date
Mike Blumenkrantz
3d38c9597f zink: hook up KHR_partial_update
this just requires clamping the renderArea to the passed damage rect,
which is composed by merging all the passed rects into a single large
region

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27867>
2024-02-29 03:26:14 +00:00
Mike Blumenkrantz
e0131cd371 zink: use VK_KHR_incremental_present to propagate damage rects
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27867>
2024-02-29 03:26:14 +00:00
Mike Blumenkrantz
4fe88170ce zink: hook up VK_KHR_incremental_present
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27867>
2024-02-29 03:26:14 +00:00
Mike Blumenkrantz
738fbddca8 zink: use a slab allocator for zink_kopper_present_info
this improves perf slightly at extremely high fps

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27867>
2024-02-29 03:26:14 +00:00
Mike Blumenkrantz
cdd1ce140d zink: make zink_kopper_present_info public
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27867>
2024-02-29 03:26:14 +00:00
José Roberto de Souza
283d8ca98a iris: Force lmem cpu accessible for bos with clear-color
KMD needs to be able to read and write the clear-color from CPU.
i915 can workaround it but Xe KMD will reject page flips with
clear-color bos that can be read from CPU.

So here it make sure that bos with the clear color information
are placed in a lmem portion that is CPU-visible, that is important in
PCIe small bar systems.
And as CCS in discrete GPUs are only supported in lmem this bo can't
become a IRIS_HEAP_DEVICE_LOCAL_PREFERRED(lmem + smem).

So here the IRIS_HEAP_DEVICE_LOCAL_CPU_VISIBLE_SMALL_BAR heap is selected.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26700>
2024-02-29 02:20:43 +00:00
José Roberto de Souza
8a9168584c iris: Add IRIS_HEAP_DEVICE_LOCAL_CPU_VISIBLE_SMALL_BAR heap type
This is intented to be used in cases where BOs can only be placed in
lmem but needs to accesible from CPU side.

Actual usage will be added in the next patch, here just adding the
heap type and all the handling.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26700>
2024-02-29 02:20:43 +00:00
Mike Blumenkrantz
f55ed175eb zink: fix stencil-only blitting with stencil fallback
these shouldn't do extra depth blits

fixes (nvidia):
dEQP-GLES3.functional.fbo.blit.depth_stencil.depth24_stencil8_stencil_only,Fail
dEQP-GLES3.functional.fbo.blit.depth_stencil.depth32f_stencil8_stencil_only,Fail
spec@arb_framebuffer_object@arb_framebuffer_object-depth-stencil-blit stencil gl_depth24_stencil8,Fail

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27859>
2024-02-29 01:53:38 +00:00
Mike Blumenkrantz
2a8c6cf7ac kopper: set drawable buffer age
this fixes buffer age reporting with lavapipe

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27703>
2024-02-29 01:15:23 +00:00
Mike Blumenkrantz
ad8794884c egl/kopper: plumb through SwapBuffersWithDamage
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27703>
2024-02-29 01:15:23 +00:00
Mike Blumenkrantz
0c82a67ea6 drisw: pass all frontend swapbuffer damage rects through
this is really stupid because EGLRect is int[4] but pipe_box is not,
requiring conversion from one to the other

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27703>
2024-02-29 01:15:23 +00:00
Mike Blumenkrantz
cda627eb48 drisw/winsys: loop over all the boxes in display()
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27703>
2024-02-29 01:15:23 +00:00
Mike Blumenkrantz
389e83c4fe drisw/xlib: loop over all the boxes in display() hook
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27703>
2024-02-29 01:15:23 +00:00
Mike Blumenkrantz
fd6f7e3f16 drisw: plumb through a swapBuffersWithDamage interface
currently the same as regular swap

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27703>
2024-02-29 01:15:23 +00:00
Mike Blumenkrantz
3aea0e31a4 winsys/sw: propagate nboxes to displaytarget_display()
only a single box region is used

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27703>
2024-02-29 01:15:22 +00:00
Mike Blumenkrantz
3cca761934 gallium: add a nboxes param to flush_frontbuffer
this allows conveying damage regions through the sw presentation interface

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27703>
2024-02-29 01:15:22 +00:00
Mike Blumenkrantz
2b1d12b104 zink: force max buffer alignment on return ptrs for mapped staging buffers
this guarantees the alignment matches what the API expects

fixes KHR-GL4*.map_buffer_alignment.functional on nvk

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27827>
2024-02-28 20:37:22 +00:00
Mike Blumenkrantz
f7d6a75d6b zink: delete unused buffer map conditional
this is now handled in the block above

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27827>
2024-02-28 20:37:22 +00:00
Mike Blumenkrantz
80456abff7 zink: fix unsynchronized read-mapping of device-local buffers
these can use the copy context to enable readback on systems without BAR

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27827>
2024-02-28 20:37:22 +00:00
Mike Blumenkrantz
91f99f82ab zink: null out bo usage when allocating from slab
avoids weird cases with stale usage

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27827>
2024-02-28 20:37:22 +00:00
Mike Blumenkrantz
689a80704a zink: emit SpvCapabilityImageMSArray for ms arrayed storage images
required by spec

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27827>
2024-02-28 20:37:22 +00:00
Mike Blumenkrantz
701ee4be91 zink: apply all storage memory masks to control barriers if no modes are specified
fixes VUID-StandaloneSpirv-OpControlBarrier-04650 errors

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27827>
2024-02-28 20:37:22 +00:00
Pierre-Eric Pelloux-Prayer
224ff11617 egl/wayland: use __DRI_IMAGE_PRIME_LINEAR_BUFFER in get_back_bo
Some drivers (radeonsi, iris) relies on this hint to detect DRI_PRIME
blits and implement a special path (eg: SDMA copy for radeonsi).

Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27719>
2024-02-28 12:47:54 +00:00
Collabora's Gfx CI Team
4e219a22e2 Uprev Piglit to 2a1c49a81cd9a6bf5d0c3a9b87225be94771ca96
e9316bcd12...2a1c49a81c

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27375>
2024-02-28 10:22:38 +00:00
Caio Oliveira
3ef6fa3767 intel/brw: Remove Gfx8- fields from *_prog_data structs
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27691>
2024-02-28 05:45:39 +00:00
Caio Oliveira
aff961f423 intel/brw: Remove Gfx8- fields from *_prog_key structs
Those are not used or relevant anymore.  Also update Iris accordingly.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27691>
2024-02-28 05:45:39 +00:00
Mike Blumenkrantz
0c95d39309 zink: add nvk baseline
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27843>
2024-02-27 21:50:47 -05:00
Mike Blumenkrantz
9ffb7e0179 zink: update nv blob baseline
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27843>
2024-02-27 21:50:47 -05:00
Thong Thai
0586a3fb22 frontends/va/postproc: do not use efc if image is to be translated
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10658

Signed-off-by: Thong Thai <thong.thai@amd.com>
Tested-by: Andrej Benz <hello@benz.dev>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27802>
2024-02-27 22:56:04 +00:00
David Rosca
82ff9204ab frontends/va: Only set VP9 segmentation fields when segmentation is enabled
Workaround for ffmpeg setting segmentation_update_map to 1 with
segmentation_enabled == 0.

Fixes decoding sample from https://github.com/mpv-player/mpv/issues/13533

Cc: mesa-stable

Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27816>
2024-02-27 20:54:48 +00:00
Ruijing Dong
eb74aa8515 frontends/va: get av1 encoding ref frame infos for L0.
Reference frame list is formed by each of the provided
recon_frame, while the assumption here is to use the API
provided by VAAPI interface, when a frame is marked as
"long term reference" by

av1->picture_flags.bits.long_term_reference

Its recon_frame will be kept in DPB marked by its
recon_frame as signature. When a future input requests
refering to it, it can go this way:

1. set av1->ref_frame_ctrl_l0.field.search_idx2 to indicate
   which ref_frame_idx slot will be used.
   x = av1->ref_frame_ctrl_l0.field.search_idx2;
2. n = av1->ref_frame_idx[x-1];
   av1->reference_frames[n] as the signature to compare with.
   if av1->reference_frames[n] is pointing to the
   same video buffer (signature) as the one marked as
   "long term reference". Then the new input is refering to
   it only.
3. in SVC case, long terms are used for temproal_id 0 only,
   because using long term means potentially scene change
   could happen.
4. the "long term reference" recon_frame should be kept,
   instead of being reused until it is no longer needed to
   avoid signature duplication.

Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27771>
2024-02-27 20:20:46 +00:00
Ruijing Dong
4b92fa9e10 radeonsi/vcn: vcn4 av1 long term ref support
Add vcn4 av1 long term reference support.

So that frames can be controlled from application
side to refer to the identified reference, which
usually could provide better coding efficiency in
the case of scene chagne back and forth, just it
needs to identify and mark these frames before
using them.

We assume 2 long term reference frames should be
good in a key frame period, and these long term
references can be overwritten by marking new ones.

Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27771>
2024-02-27 20:20:46 +00:00
Ruijing Dong
5663221bdb radeonsi/vcn: data structure av1 enc long term reference.
Here it borrowed the term "long term reference" to represent
the customized reference frame rather than the default ones used.

To enable that, it needs application to leverage VAAPI existing
interface to mark a frame as "long term reference", and then
it will be preserved in the DPB for later usage. This preserved
frame later could be refered to by having its signature used in
the ref_frame_idx[] list, and the index can be indicated by
RefFrameCtrl index2, which has not been used for other purpose.

Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27771>
2024-02-27 20:20:45 +00:00
Daniel Stone
68eaf820e1 st/dri: Use pipe_format from config directly
The driver already stores the pipe_format within the mode, so we can
just reuse that rather than trying to re-derive it back from a hardcoded
set of masks.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
ee04cc5d2b egl/wayland: Eliminate double loop for configs
We used to loop like this:

foreach (config_supported_by_driver) {
   foreach (config_wl_knows_about) {
      dri2_add_config(wl_config.rgba_masks, wl_config.rgba_shifts)) {
         if (wl_config.rgba_masks != driver_config.rgba_masks ||
	     wl_config.rgba_shifts != driver_config.rgba_shifts) {
            return NULL; /* driver config != wl config */
         }
      }
   }
}

This is a pretty painful way to discover the relationship between the
different sets of configs, especially as we can just look up our Wayland
visual entry directly.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
57c3343c2d dri/kopper: Flatten pipe_format/DRIImage/FourCC conversion
No need to go through DRI_IMAGE_FORMAT_* tokens; we can just directly
convert from pipe_format to FourCC.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
3c46252570 dri/kopper: Reorder format tables
Just make it more obvious that they're identical.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
d60415bad5 dri/kopper: Add translations for sRGB formats
There was DRI_IMAGE_FORMAT -> FourCC format translation, but this was
unreachable as we only ever called image_format_to_fourcc() on the
result of get_dri_format().

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
ca0f94c805 dri/kopper: Move format -> FourCC translation up a level
There's no reason to use DRIImage formats here, given that it's only
ever used to immediately convert to a FourCC.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
a8cb490193 st/dri: Reuse stored texture format
When we create a texture, we allocate a pipe_resource for it with a
given format. When we export the texture to an EGLImage, we go look
up what the GL format was and try to re-derive the pipe_format back
again.

Instead of doing that, just immediately reuse the pipe_format for the
image's format.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
858ad38f8b st/dri: Reuse stored renderbuffer format
When we create a renderbuffer, we allocate a pipe_resource for it with a
given format. When we export the renderbuffer to an EGLImage, we go look
up what the GL format was and try to re-derive the pipe_format back
again.

Instead of doing that, just immediately reuse the pipe_format for the
image's format.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
216d4613c3 st/dri: Store pipe_format in gl_config
When the DRI frontend generates configs to pass to the APIs, store the
pipe_format in the internal gl_config structure. Doing this allows us to
nuke a few places where we try to retcon our way back from the config to
a pipe_format.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
ad0edea53a st/dri: Check format properties from format helpers
When populating DRI configs, driconf allows us to exclude
10bpc/RGBA/float configs. Rather than having a hardcoded set of formats
which satisfy those properties, just check the actual format
definitions.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
4025845137 st/dri: Use pipe_format for Z/S modes
Rather than just passing down the depth/stencil bits, pass the
pipe_format for the depth/stencil modes down to driCreateConfigs so we
retain the explicit information as long as possible.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
69d64812e2 st/dri: Rework depth/stencil format selection
When we're building configs, be a bit more explicit about which format
we're using, as a prelude to passing the formats down explicitly to
driCreateConfigs.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
4816cdd204 st/dri: Add transient HAS_ZS() helper
Just saves a load of redundant typing.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
e018c91384 st/dri: Completely remove mesa_format from config setup
We don't need to have mesa_format here at all, we can just work entirely
on pipe_format.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
4515bcf5af st/dri: Remove format tables from driCreateConfigs
Just get all the information we need from u_format, rather than keeping
it in hand-written tables.

If you have bisected any kind of failure to this commit, please build
the previous commit in debug mode (so that assertions are enabled) and
check if there are any runtime failures. If so, there is a difference
between the u_format descriptions and the handwritten descriptions that
this commit deletes.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
d3ed00f38a util: Add util_format_get_component_shift
Similar to util_format_get_component_bits, get the bit offset for a
particular channel in a given format.

Use this to calculate the shift/mask sets for formats when creating DRI
configs, as a prelude to ripping out and replacing the hardcoded table.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
b3d419ad24 st/dri2: Use u_format to get config format information
Now that we have both the pipe_format and the mesa_format available to
us, prefer the former so we don't need to map between the two worlds.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:02 +00:00