Rob Clark
2ea4a59ab7
loader: Add better support for virtgpu nctx driver loading
...
In the case of virtio_gpu, if the drm native context capset is
supported, we should try loading the native driver before falling back
to virgl.
Previously this was done with hacks in pipe_virtio_gpu_create_screen(),
but this also requires virgl's driconf to be the superset of virgl and
all the nctx drivers.
Instead add an optional loader callback to probe for nctx support. This
is called with the drm capset, if the host supports the drm context
type, to allow driver specific code to determine if the specific GPU is
supported, so we can cleanly fall back to virgl if it does not (for ex,
an old VM guest with a newer host, where mesa in the guest does not
support the new GPU, but mesa in the host does).
TODO: How to handle the dynamic loader case?
Signed-off-by: Rob Clark <robdclark@chromium.org >
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28777 >
2024-05-23 20:02:03 +00:00
David Rosca
9837dab4bd
frontends/va: Store slice types for H264 decode
...
Cc: mesa-stable
Reviewed-by: Leo Liu <leo.liu@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29055 >
2024-05-16 15:05:08 +00:00
Mike Blumenkrantz
2efa1ae0d5
dri: rename 'implicit' param from earlier series
...
I accidentally merged the wrong version of this, and this was supposed
to be the correct and more informative name
Acked-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29066 >
2024-05-07 15:19:23 +00:00
Chia-I Wu
893797eb32
gallium: add pipe_picture_desc::flush_flags
...
It specifies the flush flags for pipe_video_codec::end_frame.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28771 >
2024-04-26 00:45:04 +00:00
Mike Blumenkrantz
b53a402edc
pipe-loader: plumb a flag for implicit driver load through screen creation
...
Acked-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28139 >
2024-04-22 23:25:58 +00:00
Marek Olšák
e5f133ccc4
util: import pipe_box and its helpers
...
We'll use them. There are also new helpers that we'll use.
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28733 >
2024-04-22 01:42:52 +00:00
Mike Blumenkrantz
2e5d49b3dd
gallium: delete PIPE_CAP_NIR_COMPACT_ARRAYS
...
this is now nir_shader_compiler_options::compact_arrays
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28601 >
2024-04-12 18:43:48 +00:00
Hannes Mann
4f4c9ff68a
gallium/pipe: Add contiguous planes per-surface attribute
...
Attribute is set when textures are created by compatible drivers, but
not when importing from DMA-BUF.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26165 >
2024-04-11 20:14:15 +00:00
Mike Blumenkrantz
bfd8c12406
winsys: add more stride members to winsys_handle
...
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27805 >
2024-04-05 16:05:21 +00:00
Mike Blumenkrantz
3727457884
winsys: add WINSYS_HANDLE_TYPE_UNBACKED
...
for use with lavapipe imports
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27805 >
2024-04-05 16:05:21 +00:00
Lucas Fryzek
7e5c5d313b
gallium: Add dmabuf arg to memory fd allocation API
...
Modify the memory fd allocation API to provide an argument to specify
if the allocating fd should be a dmabuf.
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27805 >
2024-04-05 16:05:20 +00:00
Mike Blumenkrantz
23206844eb
sw_winsys: add displaytarget_create_mapped
...
this is for creating displaytargets from already-imported fds
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27805 >
2024-04-05 16:05:20 +00:00
Mike Blumenkrantz
24453579ad
gallium: rework PIPE_CAP_POINT_SIZE_FIXED
...
this adds modes to the cap which allow drivers to opt out of the
frontend injecting gl_PointSize=1.0 into shaders while still getting
the uniform value uploaded
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28162 >
2024-04-04 11:26:17 +00:00
Ruijing Dong
7525d2242b
radeonsi/vcn: add enc surface alignment caps
...
set [64x16] as the alignment for hevc
encoding surface.
Cc: mesa-stable
Reviewed-By: Sil Vilerino <sivileri@microsoft.com >
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/28280 >
2024-03-25 14:38:46 +00:00
Marek Olšák
651191801a
gallium: increase the size of pipe_box y, height fields to allow bigger textures
...
and reorder the fields to pack them better
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Acked-by: Karol Herbst <kherbst@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27953 >
2024-03-21 03:33:39 +00:00
Qiang Yu
6b1fd20780
radeonsi: split RADEON_USAGE_NEEDS_IMPLICIT_SYNC into CB and DB flags
...
it will be required in the future
Signed-off-by: Qiang Yu <yuq825@gmail.com >
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27943 >
2024-03-11 23:36:55 +00:00
Sil Vilerino
bf6a415841
frontend/va: Support media only post proc without compositor using shaders or surfaces
...
Reviewed-by: Thong Thai <thong.thai@amd.com >
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27997 >
2024-03-06 23:06:59 +00:00
David Rosca
8c9445896f
frontends/va: Separate QP for I/P/B frames
...
For H264/HEVC this needs to calculate init_qp + slice_qp_delta.
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27558 >
2024-02-29 16:12:13 +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
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
Antonio Gomes
12f1a4c311
gallium: Add new PIPE_CAP_CL_GL_SHARING
...
We have a situation where some drivers have all the required features,
but they are not working with gl_sharing, so we end up advertising it
wrongly. Add this cap to ensure this driver was tested to work with
cl_khr_gl_sharing.
Reviewed-by: Karol Herbst <kherbst@redhat.com >
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26071 >
2024-02-23 13:29:00 +00:00
Timothy Arceri
1098afd7fb
gallium: add PIPE_CAP_FP16 for AMD_gpu_shader_half_float
...
Acked-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18540 >
2024-02-12 13:23:14 +00:00
Marek Olšák
47c1f389ed
gallium: remove take_ownership from set_vertex_buffers, assume it's true
...
This removes the take_ownership parameter and defines the behavior as if
take_ownership was always true, which is the fast path. This way, we don't
have to have 2 codepaths in set_vertex_buffers of every driver.
The old behavior is optionally available through util_set_vertex_buffers.
It also documents a new constraint that count in set_vertex_buffers must be
equal to the number of vertex buffers referenced by vertex elements or 0.
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27492 >
2024-02-07 09:19:42 +00:00
Marek Olšák
f0b31858e1
gallium: always set vertex elements before setting vertex buffers
...
Drivers can use this constraint to merge vertex elements and vertex
buffers in set_vertex_buffers instead of in draw_vbo.
Suggested by: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8142
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27492 >
2024-02-07 09:19:41 +00:00
Sil Vilerino
9710fca612
frontends/va, d3d12: Fix PIPE_VIDEO_SLICE_MODE_MAX_SLICE_SICE -> PIPE_VIDEO_SLICE_MODE_MAX_SLICE_SIZE typo
...
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27342 >
2024-01-29 20:19:42 +00:00
Marek Olšák
386822c1b0
gallium: rename PIPE_.._PIN_THREADS_TO_L3_CACHE -> .._UPDATE_THREAD_SCHEDULING
...
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27247 >
2024-01-29 19:40:46 +00:00
Marek Olšák
d230434ae3
mesa,gallium: move the thread scheduler to src/util
...
The only change in behavior is that setting the affinity mask is skipped
when it has no effect, which happens when the app thread hasn't been moved
under a different L3 cache by the kernel (the sched_state variable tracks
that). This improves performance because setting the affinity mask incurs
measurable CPU overhead even if it has no effect.
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27247 >
2024-01-29 19:40:46 +00:00
Tomeu Vizoso
af199e0ff0
teflon: Initial commit
...
Teflon is a Gallium frontend that TensorFlow Lite can load to delegate
the execution of operations in a neural network model.
See docs for more.
Acked-by: Christian Gmeiner <cgmeiner@igalia.com >
Acked-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25714 >
2024-01-24 10:02:10 +00:00
Marek Olšák
a94319d29b
winsys/amdgpu: don't clear buffer list elements after IB submission
...
amdgpu_winsys_bo_reference(dst, NULL) sets *dst to NULL, but we never read
*dst again because we set num_buffers to 0. So don't touch the buffer list
elements and only decrement the BO refcount. It makes a difference when you
have 10k BOs.
The CS thread overhead in VP2020/Catia1: 9.23% -> 8.74%
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27060 >
2024-01-15 23:21:25 +00:00
Marek Olšák
eb20ef9277
gallium: remove unbind_trailing_count from set_vertex_buffers
...
It should implicitly unbind all bound buffers after "count".
This also slightly simplies u_vbuf.
This is a cleanup suggested by:
https://gitlab.freedesktop.org/mesa/mesa/-/issues/8142
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io > (asahi & panfrost)
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26309 >
2024-01-14 21:55:19 +00:00
Marek Olšák
6d7a76595d
winsys/amdgpu: remove dependency_flags parameter from cs_add_fence_dependency
...
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26643 >
2024-01-06 20:55:30 +00:00
Marek Olšák
6d913a2bcc
r300,r600,radeonsi: switch to pb_buffer_lean
...
to remove pb_buffer::vtbl from all buffer structures
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26643 >
2024-01-06 20:55:30 +00:00
Marek Olšák
39c1311766
gallium/pb_buffer: define pb_buffer_lean without vtbl, inherit it by pb_buffer
...
amdgpu doesn't need vtbl.
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26643 >
2024-01-06 20:55:30 +00:00
Marek Olšák
49bf2545fe
winsys/amdgpu: add amdgpu_bo_real_reusable slab for the backing buffer
...
Add contents of amdgpu_bo_slab into it. This will allow removing the "real"
pointer from amdgpu_bo_slab_entry because "(char*)entry.slab" is now
pointing next to it.
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26643 >
2024-01-06 20:55:30 +00:00
Marek Olšák
643f390de5
radeon_winsys: add struct radeon_winsys* parameter into fence_reference
...
Since the radeon winsys implements fences as buffers, we need radeon_winsys*
to destroy them. This will enable the removal of pb_cache_entry::mgr.
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26643 >
2024-01-06 20:55:30 +00:00
Marek Olšák
523a4f71f2
winsys/amdgpu: stop using pb_buffer::vtbl
...
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26643 >
2024-01-06 20:55:29 +00:00
Ruijing Dong
6c758000fb
frontends/va: remove some TODOs in hevc encoding
...
Remove some TODOs in va hevc encoding sps parsing.
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/26770 >
2024-01-03 19:23:08 +00:00
Pierre-Eric Pelloux-Prayer
a2cfd4186f
radeonsi/winsys: add cs_get_ip_type function
...
Will be used in the next commit.
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26774 >
2023-12-20 12:23:27 +00:00
Ruijing Dong
d6da63071e
frontends/va: add ROI feature
...
ROI (region of interest) feature implementation
in va.
It does not support ROI priority, and supports
qp delta, and the maximum number of supported
region is defined as 32, the region sequence implies
the priority, the lower the sequence number, the higher
the region priority, when region overlapping happened,
the higher priority region overwrites the lower
priority one.
And specifically for AV1, the adjust step will be
rounded by 5 when rate control is used, for example,
if qp_delta (q index) is 6, it will use 5, if
qp_delta is 8, it will use 10.
For AVC/HEVC (RC/CQP) and AV1 CQP mode, the
qp_delta granularity is 1.
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com >
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26659 >
2023-12-15 14:06:34 +00:00
Sathishkumar S
cd8ccba814
frontends/va: use va interface for jpeg partial decode
...
add support to check jpeg crop decode cap and to set the crop
rectangle. the interface is avialble on libva 1.21.0 and higher.
v2: (Ruijing)
enclose the entire case block within VA_CHECK_VERSION
if attr unsupported set the return value to VA_ATTRIB_NOT_SUPPORTED
Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com >
Reviewed-by: Leo Liu <leo.liu@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26588 >
2023-12-13 14:18:05 +00:00
Alyssa Rosenzweig
f217d267d3
gallium: add PIPE_IMAGE_ACCESS_DRIVER_INTERNAL
...
for e.g. driver internal blits that can use special paths wrt comporession.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Acked-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26613 >
2023-12-12 19:44:41 -04:00
Yogesh Mohan Marimuthu
a9064837f8
winsys/radeon: remove unused gpu_address variable from struct radeon_cmdbuf
...
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26612 >
2023-12-12 06:14:23 +00:00
Marek Olšák
9ab59574ef
gallium: add typedef pipe_draw_func matching the draw_vbo signature and use it
...
We've copied the signature too many times already. This will also be used
more.
It intentionally deviates from the name by not including the "_vbo" part.
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26619 >
2023-12-10 06:20:14 +00:00
Sil Vilerino
0c1ff82bc8
frontend/va: Add h264 encode ip_period param
...
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com >
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com >
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456 >
2023-12-06 03:58:53 +00:00
Sil Vilerino
413b466aea
pipe: Add PIPE_H264_MAX_REFERENCES
...
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com >
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456 >
2023-12-06 03:58:53 +00:00
Sil Vilerino
92b73aeb16
pipe: Add PIPE_VIDEO_CAP_ENC_H264_SUPPORTS_CABAC_ENCODE
...
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com >
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456 >
2023-12-06 03:58:53 +00:00
Sil Vilerino
c954830132
pipe: Add PIPE_VIDEO_FEEDBACK_METADATA_TYPE_AVERAGE_FRAME_QP
...
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com >
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456 >
2023-12-06 03:58:53 +00:00
Sil Vilerino
3f07c8c321
pipe: Add p_video_codec.get_encode_headers for out of band VPS, SPS, PPS
...
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com >
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456 >
2023-12-06 03:58:53 +00:00
Sil Vilerino
34d45cf7ed
pipe: Add fence_get_win32_handle to get HANDLE from pipe_fence_handle
...
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456 >
2023-12-06 03:58:52 +00:00