Mesa (master): frontends/va/context: don't set max_references with num_render_targets

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jan 22 14:11:20 UTC 2021


Module: Mesa
Branch: master
Commit: 925d701014c2ba084061eae131f4b5c75e595f29
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=925d701014c2ba084061eae131f4b5c75e595f29

Author: Víctor Manuel Jáquez Leal <vjaquez at igalia.com>
Date:   Sun Dec  6 14:56:58 2020 +0100

frontends/va/context: don't set max_references with num_render_targets

For HEVC and VP9 template's max_references are tied to the number of
surfaces associated with context. Later, the decoder is created if
max_references is different to zero.

But vaCreateContext() doesn't really need an array of VASurfaceIDs (see
https://lists.01.org/pipermail/intel-vaapi-media/2017-July/000052.html and
https://github.com/intel/libva/issues/251).

This patch removes the validation of the max_references at decoder
creation and also remove the assignation of num_render_targets to
max_references.

Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez at igalia.com>
Reviewed-by: Leo Liu <leo.liu at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7949>

---

 src/gallium/frontends/va/context.c | 2 --
 src/gallium/frontends/va/picture.c | 4 ----
 2 files changed, 6 deletions(-)

diff --git a/src/gallium/frontends/va/context.c b/src/gallium/frontends/va/context.c
index 0c596f3f811..ca2fcde38bd 100644
--- a/src/gallium/frontends/va/context.c
+++ b/src/gallium/frontends/va/context.c
@@ -271,7 +271,6 @@ vlVaCreateContext(VADriverContextP ctx, VAConfigID config_id, int picture_width,
          break;
 
      case PIPE_VIDEO_FORMAT_HEVC:
-         context->templat.max_references = num_render_targets;
          if (config->entrypoint != PIPE_VIDEO_ENTRYPOINT_ENCODE) {
             context->desc.h265.pps = CALLOC_STRUCT(pipe_h265_pps);
             if (!context->desc.h265.pps) {
@@ -288,7 +287,6 @@ vlVaCreateContext(VADriverContextP ctx, VAConfigID config_id, int picture_width,
          break;
 
       case PIPE_VIDEO_FORMAT_VP9:
-         context->templat.max_references = num_render_targets;
          break;
 
       default:
diff --git a/src/gallium/frontends/va/picture.c b/src/gallium/frontends/va/picture.c
index b4706665d3b..bcfb79e75f2 100644
--- a/src/gallium/frontends/va/picture.c
+++ b/src/gallium/frontends/va/picture.c
@@ -151,10 +151,6 @@ handlePictureParameterBuffer(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *
       if (!context->target)
          return VA_STATUS_ERROR_INVALID_CONTEXT;
 
-      if (context->templat.max_references == 0 &&
-         format != PIPE_VIDEO_FORMAT_JPEG)
-         return VA_STATUS_ERROR_INVALID_BUFFER;
-
       if (format == PIPE_VIDEO_FORMAT_MPEG4_AVC)
          context->templat.level = u_get_h264_level(context->templat.width,
             context->templat.height, &context->templat.max_references);



More information about the mesa-commit mailing list