st/va: fix the incorrect max profiles report
authorLeo Liu <leo.liu@amd.com>
Fri, 8 Feb 2019 13:56:53 +0000 (08:56 -0500)
committerLeo Liu <leo.liu@amd.com>
Mon, 11 Feb 2019 19:44:16 +0000 (14:44 -0500)
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 <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Cc: 19.0 <mesa-stable@lists.freedesktop.org>
src/gallium/include/pipe/p_video_enums.h
src/gallium/state_trackers/va/context.c

index b5b8b0622858e962fcd0bbab6cb44bb9a739b221..adbe7858d0f337820043a62bb5c5737bb331de69 100644 (file)
@@ -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 */
index 14e904ee49028cc4e68d80db447d035795d63db7..47a5e7be23081f896cbdc4fa9afec7503ef3c374 100644 (file)
@@ -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;