summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuijing Dong <ruijing.dong@amd.com>2022-12-08 16:10:14 -0500
committerEric Engestrom <eric@engestrom.ch>2022-12-14 20:47:01 +0000
commit6922882d8ff0b75d99a1458e2951e0b72ee3001a (patch)
treec846713db2e8d383048d9eaa31e9c5e4d9eb3719
parente17740493fe2becd3cdf1f834a5f28f835eff0dc (diff)
downloadmesa-6922882d8ff0b75d99a1458e2951e0b72ee3001a.tar.gz
frontends/va: fix gst videotestsrc h264 enc fail issue.
problem: when doing "gst-launch-1.0 -v videotestsrc num-buffer=10 ! vaapih264enc ! fakeink" The command will fail due to gst will fetch the first available supported format in the list, it becomes P010_LE due to the commit in [0b02db3007] frontends/va: fixed av1 decoding 10bit ffmpeg output YUV issue fix: move the P010_LE code block to the end of the function, the sequence of the supported formats restored to its original. cc: mesa-stable 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/20242> (cherry picked from commit a73e86e0a5eb58e2f25f7b7419a78c122cc5ab1a)
-rw-r--r--.pick_status.json2
-rw-r--r--src/gallium/frontends/va/surface.c27
2 files changed, 15 insertions, 14 deletions
diff --git a/.pick_status.json b/.pick_status.json
index f175404a9f8..2cb6b52a1c8 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1849,7 +1849,7 @@
"description": "frontends/va: fix gst videotestsrc h264 enc fail issue.",
"nominated": true,
"nomination_type": 0,
- "resolution": 0,
+ "resolution": 1,
"main_sha": null,
"because_sha": null
},
diff --git a/src/gallium/frontends/va/surface.c b/src/gallium/frontends/va/surface.c
index b2c745acdd2..94a219485fe 100644
--- a/src/gallium/frontends/va/surface.c
+++ b/src/gallium/frontends/va/surface.c
@@ -495,42 +495,43 @@ vlVaQuerySurfaceAttributes(VADriverContextP ctx, VAConfigID config_id,
attribs[i].value.value.i = VA_FOURCC_NV12;
i++;
}
- if (config->rt_format & VA_RT_FORMAT_YUV420_10 ||
- (config->rt_format & VA_RT_FORMAT_YUV420 &&
- config->entrypoint == PIPE_VIDEO_ENTRYPOINT_ENCODE)) {
+
+ if (config->rt_format & VA_RT_FORMAT_YUV400) {
attribs[i].type = VASurfaceAttribPixelFormat;
attribs[i].value.type = VAGenericValueTypeInteger;
attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE;
- attribs[i].value.value.i = VA_FOURCC_P010;
+ attribs[i].value.value.i = VA_FOURCC_Y800;
i++;
+ }
+
+ if (config->rt_format & VA_RT_FORMAT_YUV422) {
attribs[i].type = VASurfaceAttribPixelFormat;
attribs[i].value.type = VAGenericValueTypeInteger;
attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE;
- attribs[i].value.value.i = VA_FOURCC_P016;
+ attribs[i].value.value.i = VA_FOURCC_YUY2;
i++;
}
- if (config->rt_format & VA_RT_FORMAT_YUV400) {
+ if (config->rt_format & VA_RT_FORMAT_YUV444) {
attribs[i].type = VASurfaceAttribPixelFormat;
attribs[i].value.type = VAGenericValueTypeInteger;
attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE;
- attribs[i].value.value.i = VA_FOURCC_Y800;
+ attribs[i].value.value.i = VA_FOURCC_444P;
i++;
}
- if (config->rt_format & VA_RT_FORMAT_YUV422) {
+ if (config->rt_format & VA_RT_FORMAT_YUV420_10 ||
+ (config->rt_format & VA_RT_FORMAT_YUV420 &&
+ config->entrypoint == PIPE_VIDEO_ENTRYPOINT_ENCODE)) {
attribs[i].type = VASurfaceAttribPixelFormat;
attribs[i].value.type = VAGenericValueTypeInteger;
attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE;
- attribs[i].value.value.i = VA_FOURCC_YUY2;
+ attribs[i].value.value.i = VA_FOURCC_P010;
i++;
- }
-
- if (config->rt_format & VA_RT_FORMAT_YUV444) {
attribs[i].type = VASurfaceAttribPixelFormat;
attribs[i].value.type = VAGenericValueTypeInteger;
attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE;
- attribs[i].value.value.i = VA_FOURCC_444P;
+ attribs[i].value.value.i = VA_FOURCC_P016;
i++;
}