[Mesa-dev] [PATCH 7/8] drivers/radeonsi:create uvd hevc enc entry

Boyuan Zhang boyzhang at amd.com
Mon Feb 5 20:25:07 UTC 2018



On 2018-02-05 12:16 PM, James Zhu wrote:
> Add UVD hevc encode pipe video codec creation entry
>
> Signed-off-by: James Zhu <James.Zhu at amd.com>
> ---
>   src/gallium/drivers/radeonsi/si_uvd.c | 13 +++++++++----
>   1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/src/gallium/drivers/radeonsi/si_uvd.c b/src/gallium/drivers/radeonsi/si_uvd.c
> index 64f2f8e..fa43a96 100644
> --- a/src/gallium/drivers/radeonsi/si_uvd.c
> +++ b/src/gallium/drivers/radeonsi/si_uvd.c
> @@ -31,7 +31,8 @@
>   #include "radeon/radeon_vce.h"
>   #include "radeon/radeon_vcn_dec.h"
>   #include "radeon/radeon_vcn_enc.h"
> -
> +#include "radeon/radeon_uvd_enc.h"
> +#include "util/u_video.h"
Could you add back the blank line please?
>   /**
>    * creates an video buffer with an UVD compatible memory layout
>    */
> @@ -146,9 +147,13 @@ struct pipe_video_codec *si_uvd_create_decoder(struct pipe_context *context,
>   	struct si_context *ctx = (struct si_context *)context;
>   	bool vcn = (ctx->b.family == CHIP_RAVEN) ? true : false;
>   
> -	if (templ->entrypoint == PIPE_VIDEO_ENTRYPOINT_ENCODE)
> -		return (vcn) ? radeon_create_encoder(context, templ, ctx->b.ws, si_vce_get_buffer) :
> -               si_vce_create_encoder(context, templ, ctx->b.ws, si_vce_get_buffer);
> +	if (templ->entrypoint == PIPE_VIDEO_ENTRYPOINT_ENCODE) {
> +		if (u_reduce_video_profile(templ->profile) == PIPE_VIDEO_FORMAT_HEVC) {
> +			return (vcn) ? radeon_create_encoder(context, templ, ctx->b.ws, si_vce_get_buffer) :
> +							radeon_uvd_create_encoder(context, templ, ctx->b.ws, si_vce_get_buffer);
> +		} else
> +			return si_vce_create_encoder(context, templ, ctx->b.ws, si_vce_get_buffer);
> +	}
It seems that this change will break the original logic for vcn h.264 
encode case, please fix it.

Thanks,
Boyuan

>   
>   	return (vcn) ? 	radeon_create_decoder(context, templ) :
>   		si_common_uvd_create_decoder(context, templ, si_uvd_set_dtb);



More information about the mesa-dev mailing list