OSDN Git Service

change va max_entrypoints
authorChandu Babu N <mailto:chandu@amd.com>
Sat, 17 Jun 2017 11:49:13 +0000 (11:49 +0000)
committerAndres Gomez <agomez@igalia.com>
Wed, 28 Jun 2017 17:15:04 +0000 (20:15 +0300)
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>
(cherry picked from commit 1d4cbcdf285730d8e692e10c44cb5dc7e683efc1)

src/gallium/state_trackers/va/config.c
src/gallium/state_trackers/va/context.c

index 05f97a0..68b9230 100644 (file)
@@ -101,6 +101,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 cc4011e..27bc8bf 100644 (file)
@@ -169,7 +169,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;