st/va: add entrypoint check for HEVC
authorBoyuan Zhang <boyuan.zhang@amd.com>
Thu, 25 Jan 2018 19:21:13 +0000 (14:21 -0500)
committerLeo Liu <leo.liu@amd.com>
Mon, 5 Feb 2018 14:16:18 +0000 (09:16 -0500)
Add entrypoint check for HEVC to differentiate decode and encode jobs.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
src/gallium/state_trackers/va/context.c

index f03b326..f567f54 100644 (file)
@@ -263,16 +263,18 @@ vlVaCreateContext(VADriverContextP ctx, VAConfigID config_id, int picture_width,
 
      case PIPE_VIDEO_FORMAT_HEVC:
          context->templat.max_references = num_render_targets;
-         context->desc.h265.pps = CALLOC_STRUCT(pipe_h265_pps);
-         if (!context->desc.h265.pps) {
-            FREE(context);
-            return VA_STATUS_ERROR_ALLOCATION_FAILED;
-         }
-         context->desc.h265.pps->sps = CALLOC_STRUCT(pipe_h265_sps);
-         if (!context->desc.h265.pps->sps) {
-            FREE(context->desc.h265.pps);
-            FREE(context);
-            return VA_STATUS_ERROR_ALLOCATION_FAILED;
+         if (config->entrypoint != PIPE_VIDEO_ENTRYPOINT_ENCODE) {
+            context->desc.h265.pps = CALLOC_STRUCT(pipe_h265_pps);
+            if (!context->desc.h265.pps) {
+               FREE(context);
+               return VA_STATUS_ERROR_ALLOCATION_FAILED;
+            }
+            context->desc.h265.pps->sps = CALLOC_STRUCT(pipe_h265_sps);
+            if (!context->desc.h265.pps->sps) {
+               FREE(context->desc.h265.pps);
+               FREE(context);
+               return VA_STATUS_ERROR_ALLOCATION_FAILED;
+            }
          }
          break;