[Libva] [PATCH Intel-driver 4/9] Remove URB_SIZE()

Gwenole Beauchesne gb.devel at gmail.com
Mon Apr 21 09:30:45 PDT 2014


2014-04-18 18:21 GMT+02:00 Xiang, Haihao <haihao.xiang at intel.com>:
> From: "Xiang, Haihao" <haihao.xiang at intel.com>
>
> Instead directly use the value stored in intel_device_info
>
> Signed-off-by: Xiang, Haihao <haihao.xiang at intel.com>
> ---
>  src/i965_avc_hw_scoreboard.c | 4 ++--
>  src/i965_avc_ildb.c          | 4 ++--
>  src/i965_defines.h           | 6 ------
>  src/i965_media.c             | 2 +-
>  src/i965_media_h264.c        | 2 +-
>  src/i965_media_mpeg2.c       | 2 +-
>  src/i965_post_processing.c   | 4 ++--
>  7 files changed, 9 insertions(+), 15 deletions(-)
>
> diff --git a/src/i965_avc_hw_scoreboard.c b/src/i965_avc_hw_scoreboard.c
> index b17ea83..f866599 100644
> --- a/src/i965_avc_hw_scoreboard.c
> +++ b/src/i965_avc_hw_scoreboard.c
> @@ -217,7 +217,7 @@ i965_avc_hw_scoreboard_urb_layout(VADriverContextP ctx, struct i965_h264_context
>      unsigned int vfe_fence, cs_fence;
>
>      vfe_fence = avc_hw_scoreboard_context->urb.cs_start;
> -    cs_fence = URB_SIZE((&i965->intel));
> +    cs_fence = i965->intel.device_info->urb_size;

Or you could redefine URB_SIZE() to intel->device_info->urb_size, thus
having to patch a single place only.

>
>      BEGIN_BATCH(batch, 3);
>      OUT_BATCH(batch, CMD_URB_FENCE | UF0_VFE_REALLOC | UF0_CS_REALLOC | 1);
> @@ -429,7 +429,7 @@ i965_avc_hw_scoreboard_decode_init(VADriverContextP ctx, void *h264_context)
>          avc_hw_scoreboard_context->urb.cs_start = avc_hw_scoreboard_context->urb.vfe_start +
>              avc_hw_scoreboard_context->urb.num_vfe_entries * avc_hw_scoreboard_context->urb.size_vfe_entry;
>          assert(avc_hw_scoreboard_context->urb.cs_start +
> -               avc_hw_scoreboard_context->urb.num_cs_entries * avc_hw_scoreboard_context->urb.size_cs_entry <= URB_SIZE((&i965->intel)));
> +               avc_hw_scoreboard_context->urb.num_cs_entries * avc_hw_scoreboard_context->urb.size_cs_entry <= i965->intel.device_info->urb_size);
>      }
>  }
>
> diff --git a/src/i965_avc_ildb.c b/src/i965_avc_ildb.c
> index 8b93c51..e0cc743 100644
> --- a/src/i965_avc_ildb.c
> +++ b/src/i965_avc_ildb.c
> @@ -410,7 +410,7 @@ i965_avc_ildb_urb_layout(VADriverContextP ctx, struct i965_h264_context *i965_h2
>      unsigned int vfe_fence, cs_fence;
>
>      vfe_fence = avc_ildb_context->urb.cs_start;
> -    cs_fence = URB_SIZE((&i965->intel));
> +    cs_fence = i965->intel.device_info->urb_size;
>
>      BEGIN_BATCH(batch, 3);
>      OUT_BATCH(batch, CMD_URB_FENCE | UF0_VFE_REALLOC | UF0_CS_REALLOC | 1);
> @@ -597,7 +597,7 @@ i965_avc_ildb_decode_init(VADriverContextP ctx, void *h264_context)
>      avc_ildb_context->urb.cs_start = avc_ildb_context->urb.vfe_start +
>          avc_ildb_context->urb.num_vfe_entries * avc_ildb_context->urb.size_vfe_entry;
>      assert(avc_ildb_context->urb.cs_start +
> -           avc_ildb_context->urb.num_cs_entries * avc_ildb_context->urb.size_cs_entry <= URB_SIZE((&i965->intel)));
> +           avc_ildb_context->urb.num_cs_entries * avc_ildb_context->urb.size_cs_entry <= i965->intel.device_info->urb_size);
>
>      for (i = 0; i < NUM_AVC_ILDB_SURFACES; i++) {
>          dri_bo_unreference(avc_ildb_context->surface[i].s_bo);
> diff --git a/src/i965_defines.h b/src/i965_defines.h
> index 5b4a076..f010ca2 100755
> --- a/src/i965_defines.h
> +++ b/src/i965_defines.h
> @@ -821,10 +821,4 @@
>  #define SUBSAMPLE_YUV411        5
>  #define SUBSAMPLE_RGBX          6
>
> -#define URB_SIZE(intel)         (IS_GEN7(intel->device_id) ? 4096 :     \
> -                                 IS_GEN8(intel->device_id) ? 4096 :     \
> -                                 IS_GEN6(intel->device_id) ? 1024 :     \
> -                                 IS_IRONLAKE(intel->device_id) ? 1024 : \
> -                                 IS_G4X(intel->device_id) ? 384 : 256)
> -
>  #endif /* _I965_DEFINES_H_ */
> diff --git a/src/i965_media.c b/src/i965_media.c
> index e6f1c16..5654109 100644
> --- a/src/i965_media.c
> +++ b/src/i965_media.c
> @@ -60,7 +60,7 @@ i965_media_urb_layout(VADriverContextP ctx, struct i965_media_context *media_con
>      unsigned int vfe_fence, cs_fence;
>
>      vfe_fence = media_context->urb.cs_start;
> -    cs_fence = URB_SIZE((&i965->intel));
> +    cs_fence = i965->intel.device_info->urb_size;
>
>      BEGIN_BATCH(batch, 3);
>      OUT_BATCH(batch, CMD_URB_FENCE | UF0_VFE_REALLOC | UF0_CS_REALLOC | 1);
> diff --git a/src/i965_media_h264.c b/src/i965_media_h264.c
> index f6c8c11..abfecef 100644
> --- a/src/i965_media_h264.c
> +++ b/src/i965_media_h264.c
> @@ -901,7 +901,7 @@ i965_media_h264_dec_context_init(VADriverContextP ctx, struct i965_media_context
>      media_context->urb.cs_start = media_context->urb.vfe_start +
>          media_context->urb.num_vfe_entries * media_context->urb.size_vfe_entry;
>      assert(media_context->urb.cs_start +
> -           media_context->urb.num_cs_entries * media_context->urb.size_cs_entry <= URB_SIZE((&i965->intel)));
> +           media_context->urb.num_cs_entries * media_context->urb.size_cs_entry <= i965->intel.device_info->urb_size);
>
>      /* hook functions */
>      media_context->media_states_setup = i965_media_h264_states_setup;
> diff --git a/src/i965_media_mpeg2.c b/src/i965_media_mpeg2.c
> index 76a7035..a5c757f 100644
> --- a/src/i965_media_mpeg2.c
> +++ b/src/i965_media_mpeg2.c
> @@ -1013,7 +1013,7 @@ i965_media_mpeg2_dec_context_init(VADriverContextP ctx, struct i965_media_contex
>      media_context->urb.cs_start = media_context->urb.vfe_start +
>          media_context->urb.num_vfe_entries * media_context->urb.size_vfe_entry;
>      assert(media_context->urb.cs_start +
> -           media_context->urb.num_cs_entries * media_context->urb.size_cs_entry <= URB_SIZE((&i965->intel)));
> +           media_context->urb.num_cs_entries * media_context->urb.size_cs_entry <= i965->intel.device_info->urb_size);
>
>      /* hook functions */
>      media_context->media_states_setup = i965_media_mpeg2_states_setup;
> diff --git a/src/i965_post_processing.c b/src/i965_post_processing.c
> index 2eafa7e..69fe061 100755
> --- a/src/i965_post_processing.c
> +++ b/src/i965_post_processing.c
> @@ -5372,7 +5372,7 @@ i965_post_processing_context_init(VADriverContextP ctx,
>      };
>
>      if (IS_IRONLAKE(i965->intel.device_id)) {
> -       pp_context->urb.size = URB_SIZE((&i965->intel));
> +       pp_context->urb.size = i965->intel.device_info->urb_size;
>         pp_context->urb.num_vfe_entries = 32;
>         pp_context->urb.size_vfe_entry = 1;     /* in 512 bits unit */
>         pp_context->urb.num_cs_entries = 1;
> @@ -5381,7 +5381,7 @@ i965_post_processing_context_init(VADriverContextP ctx,
>         pp_context->urb.cs_start = pp_context->urb.vfe_start +
>              pp_context->urb.num_vfe_entries * pp_context->urb.size_vfe_entry;
>         assert(pp_context->urb.cs_start +
> -           pp_context->urb.num_cs_entries * pp_context->urb.size_cs_entry <= URB_SIZE((&i965->intel)));
> +           pp_context->urb.num_cs_entries * pp_context->urb.size_cs_entry <= i965->intel.device_info->urb_size);
>          pp_context->intel_post_processing = ironlake_post_processing;
>      } else {
>         pp_context->vfe_gpu_state.max_num_threads = 60;
> --
> 1.8.3.2
>
> _______________________________________________
> Libva mailing list
> Libva at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/libva


More information about the Libva mailing list