[Mesa-stable] [PATCH] st/va: also honors interlaced preference when providing a video format
Zhang, Boyuan
Boyuan.Zhang at amd.com
Thu Sep 8 20:49:42 UTC 2016
Hi Leo, Christian and Julien,
I tested the patch with Vaapi Encoding and Transcoding, it seems working fine. We are using "VAAPI_DISABLE_INTERLACE" env, so interlaced is always disabled.
Regards,
Boyuan
-----Original Message-----
From: Liu, Leo
Sent: September-08-16 9:50 AM
To: Koenig, Christian; Julien Isorce; mesa-dev at lists.freedesktop.org
Cc: mesa-stable at lists.freedesktop.org; Zhang, Boyuan; Julien Isorce
Subject: Re: [PATCH] st/va: also honors interlaced preference when providing a video format
On 09/08/2016 03:50 AM, Christian König wrote:
> Am 08.09.2016 um 09:34 schrieb Julien Isorce:
>> This fixes a crash when using the prefered video format with
>> vaapisink on Nvidia hardwares.
>> Also caught by the following assert:
>> nouveau_vp3_video.c:91: Assertion `templat->interlaced' failed.
>>
>> TEST= gst-launch-1.0 videotestsrc ! video/x-raw, format=NV12 !
>> vaapisink
>>
>> Signed-off-by: Julien Isorce <j.isorce at samsung.com>
>> Tested-by: Víctor Manuel Jáquez Leal <vjaquez at igalia.com>
>
> Reviewed-by: Christian König <christian.koenig at amd.com>.
>
> But somebody should double check if that doesn't break transcoding for
> AMD GPUs.
>
> We had some problems with that in the past.
VA-API encode use "VAAPI_DISABLE_INTERLACE" env for making sure not interlaced, but better to double check.
Boyuan, can you test on this patch?
Regards,
Leo
>
> Regards,
> Christian.
>
>> ---
>> src/gallium/state_trackers/va/surface.c | 36
>> +++++++++++++++++----------------
>> 1 file changed, 19 insertions(+), 17 deletions(-)
>>
>> diff --git a/src/gallium/state_trackers/va/surface.c
>> b/src/gallium/state_trackers/va/surface.c
>> index 3ee1cdd..00df69d 100644
>> --- a/src/gallium/state_trackers/va/surface.c
>> +++ b/src/gallium/state_trackers/va/surface.c
>> @@ -632,24 +632,26 @@ vlVaCreateSurfaces2(VADriverContextP ctx,
>> unsigned int format,
>> memset(&templat, 0, sizeof(templat));
>> + templat.buffer_format = pscreen->get_video_param(
>> + pscreen,
>> + PIPE_VIDEO_PROFILE_UNKNOWN,
>> + PIPE_VIDEO_ENTRYPOINT_BITSTREAM,
>> + PIPE_VIDEO_CAP_PREFERED_FORMAT
>> + );
>> + templat.interlaced = pscreen->get_video_param(
>> + pscreen,
>> + PIPE_VIDEO_PROFILE_UNKNOWN,
>> + PIPE_VIDEO_ENTRYPOINT_BITSTREAM,
>> + PIPE_VIDEO_CAP_PREFERS_INTERLACED
>> + );
>> +
>> if (expected_fourcc) {
>> - templat.buffer_format = VaFourccToPipeFormat(expected_fourcc);
>> - templat.interlaced = 0;
>> - } else {
>> - templat.buffer_format = pscreen->get_video_param
>> - (
>> - pscreen,
>> - PIPE_VIDEO_PROFILE_UNKNOWN,
>> - PIPE_VIDEO_ENTRYPOINT_BITSTREAM,
>> - PIPE_VIDEO_CAP_PREFERED_FORMAT
>> - );
>> - templat.interlaced = pscreen->get_video_param
>> - (
>> - pscreen,
>> - PIPE_VIDEO_PROFILE_UNKNOWN,
>> - PIPE_VIDEO_ENTRYPOINT_BITSTREAM,
>> - PIPE_VIDEO_CAP_PREFERS_INTERLACED
>> - );
>> + enum pipe_format expected_format =
>> VaFourccToPipeFormat(expected_fourcc);
>> +
>> + if (expected_format != templat.buffer_format || memory_attibute)
>> + templat.interlaced = 0;
>> +
>> + templat.buffer_format = expected_format;
>> }
>> templat.chroma_format = ChromaToPipe(format);
>
>
More information about the mesa-stable
mailing list