[1/2] st/va: fix the incorrect max profiles report

Submitted by Zhang, Boyuan on Feb. 8, 2019, 7:50 p.m.

Details

Message ID CY4PR12MB1159181B63ED6CBCED81F3CC87690@CY4PR12MB1159.namprd12.prod.outlook.com
State New
Headers show
Series "Series without cover letter" ( rev: 3 2 ) in Mesa

Not browsing as part of any series.

Commit Message

Zhang, Boyuan Feb. 8, 2019, 7:50 p.m.
This patch is 
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>


-----Original Message-----
From: mesa-dev <mesa-dev-bounces@lists.freedesktop.org> On Behalf Of Liu, Leo

Sent: February 8, 2019 10:11 AM
To: mesa-dev@lists.freedesktop.org
Cc: 19 . 0 <mesa-stable@lists.freedesktop.org>
Subject: [Mesa-dev] [PATCH 1/2] 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 <leo.liu@amd.com>

Cc: 19.0 <mesa-stable@lists.freedesktop.org>
---
 src/gallium/include/pipe/p_video_enums.h | 3 ++-  src/gallium/state_trackers/va/context.c  | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

--
2.17.1

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Patch hide | download patch | download mbox

diff --git a/src/gallium/include/pipe/p_video_enums.h b/src/gallium/include/pipe/p_video_enums.h
index b5b8b062285..adbe7858d0f 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 14e904ee490..47a5e7be230 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;