From: Leo Liu Date: Fri, 8 Feb 2019 13:56:53 +0000 (-0500) Subject: st/va: fix the incorrect max profiles report X-Git-Tag: upstream/19.3.0~9889 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=21cdb828a3f4d1e2f140fc7c81a4bc305b2f6b04;p=platform%2Fupstream%2Fmesa.git st/va: fix the incorrect max profiles report Add "PIPE_VIDEO_PROFILE_MAX" to enum, so it will make sure here will be correct when adding more profiles in the future. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109107 Signed-off-by: Leo Liu Reviewed-by: Boyuan Zhang Cc: 19.0 --- diff --git a/src/gallium/include/pipe/p_video_enums.h b/src/gallium/include/pipe/p_video_enums.h index b5b8b06..adbe785 100644 --- a/src/gallium/include/pipe/p_video_enums.h +++ b/src/gallium/include/pipe/p_video_enums.h @@ -70,7 +70,8 @@ enum pipe_video_profile PIPE_VIDEO_PROFILE_HEVC_MAIN_444, PIPE_VIDEO_PROFILE_JPEG_BASELINE, PIPE_VIDEO_PROFILE_VP9_PROFILE0, - PIPE_VIDEO_PROFILE_VP9_PROFILE2 + PIPE_VIDEO_PROFILE_VP9_PROFILE2, + PIPE_VIDEO_PROFILE_MAX }; /* Video caps, can be different for each codec/profile */ diff --git a/src/gallium/state_trackers/va/context.c b/src/gallium/state_trackers/va/context.c index 14e904e..47a5e7b 100644 --- a/src/gallium/state_trackers/va/context.c +++ b/src/gallium/state_trackers/va/context.c @@ -175,7 +175,7 @@ VA_DRIVER_INIT_FUNC(VADriverContextP ctx) ctx->version_minor = 1; *ctx->vtable = vtable; *ctx->vtable_vpp = vtable_vpp; - ctx->max_profiles = PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH - PIPE_VIDEO_PROFILE_UNKNOWN; + ctx->max_profiles = PIPE_VIDEO_PROFILE_MAX - PIPE_VIDEO_PROFILE_UNKNOWN - 1; ctx->max_entrypoints = 2; ctx->max_attributes = 1; ctx->max_image_formats = VL_VA_MAX_IMAGE_FORMATS;