change va max_entrypoints
authorChandu Babu N <mailto:chandu@amd.com>
Sat, 17 Jun 2017 11:49:13 +0000 (11:49 +0000)
committerChristian König <christian.koenig@amd.com>
Thu, 22 Jun 2017 10:10:57 +0000 (12:10 +0200)
As encode support is added along with decode, increase max_entrypoints to two.
vaMaxNumEntrypoints was returning incorrect value and causing
memory corruption before this commit

v2: assert when max_entrypoints needs to be bigger

CC: mesa-stable@lists.freedesktop.org
Reviewed-by: Christian König <christian.koenig@amd.com>
src/gallium/state_trackers/va/config.c
src/gallium/state_trackers/va/context.c

index c5d69bdc974dc30c854bdbf1884c36970579f30d..7d3bd648d97eee408e40f8e8a747c36489ce7504 100644 (file)
@@ -102,6 +102,8 @@ vlVaQueryConfigEntrypoints(VADriverContextP ctx, VAProfile profile,
    if (num_entrypoints == 0)
       return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
 
+   assert(*num_entrypoints <= ctx->max_entrypoints);
+
    return VA_STATUS_SUCCESS;
 }
 
index 6e7a58da68788173ea128f08c63347e416602971..186f5066bd06162bcf52f68e6f494958a51c7445 100644 (file)
@@ -167,7 +167,7 @@ VA_DRIVER_INIT_FUNC(VADriverContextP ctx)
    *ctx->vtable = vtable;
    *ctx->vtable_vpp = vtable_vpp;
    ctx->max_profiles = PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH - PIPE_VIDEO_PROFILE_UNKNOWN;
-   ctx->max_entrypoints = 1;
+   ctx->max_entrypoints = 2;
    ctx->max_attributes = 1;
    ctx->max_image_formats = VL_VA_MAX_IMAGE_FORMATS;
    ctx->max_subpic_formats = 1;