4
0
mirror of https://github.com/revyos-package/mesa.git synced 2026-04-28 09:13:36 +00:00

radeonsi/vcn: Allocate session buffer in VRAM

It's never mapped so there's no reason for PIPE_USAGE_STAGING.
Improves encoding performance on dGPUs.

Tested with 7900XTX (before 1900fps => after 2100fps):

  ffmpeg -hide_banner -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 \
  -f lavfi -i testsrc=size=640x640,format=nv12 -vf hwupload -c:v av1_vaapi \
  -f null -

Cc: mesa-stable
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28945>
(cherry picked from commit cc0df497f0d4579301dc853587aef7ca8aa679ea)
This commit is contained in:
David Rosca
2024-04-16 19:23:36 +02:00
committed by Eric Engestrom
parent 9ea069be85
commit db932b6456
2 changed files with 2 additions and 2 deletions

View File

@@ -384,7 +384,7 @@
"description": "radeonsi/vcn: Allocate session buffer in VRAM",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View File

@@ -1118,7 +1118,7 @@ static void radeon_enc_begin_frame(struct pipe_video_codec *encoder,
enc->si = CALLOC_STRUCT(rvid_buffer);
if (!enc->si ||
!enc->stream_handle ||
!si_vid_create_buffer(enc->screen, enc->si, 128 * 1024, PIPE_USAGE_STAGING)) {
!si_vid_create_buffer(enc->screen, enc->si, 128 * 1024, PIPE_USAGE_DEFAULT)) {
RVID_ERR("Can't create session buffer.\n");
goto error;
}