[Libva] [PATCH intel-driver 1/5] move HAS_* macros to header

Xiang, Haihao haihao.xiang at intel.com
Thu Sep 8 08:00:52 UTC 2016


LGTM, but some code is added to master, could you help to rebase your
patch against the last master branch?

Thanks
Haihao


> Move the HAS_* macros (i.e. HAS_JPEG_ENCODING, etc.) to
> the i965_drv_video.h header so that they can be used
> by testing.
> 
> This will allow tests to use the macros to determine
> if a particular test is supported on the current
> execution platform.
> 
> Signed-off-by: U. Artie Eoff <ullysses.a.eoff at intel.com>
> ---
>  src/i965_drv_video.c | 70 ------------------------------------------
> ----------
>  src/i965_drv_video.h | 70
> ++++++++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 70 insertions(+), 70 deletions(-)
> 
> diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c
> index 77b9f376ffa8..2bfb5f8507c7 100644
> --- a/src/i965_drv_video.c
> +++ b/src/i965_drv_video.c
> @@ -57,76 +57,6 @@
>  #define IMAGE_ID_OFFSET                 0x0a000000
>  #define SUBPIC_ID_OFFSET                0x10000000
>  
> -#define HAS_MPEG2_DECODING(ctx)  ((ctx)->codec_info-
> >has_mpeg2_decoding && \
> -                                  (ctx)->intel.has_bsd)
> -
> -#define HAS_MPEG2_ENCODING(ctx)  ((ctx)->codec_info-
> >has_mpeg2_encoding && \
> -                                  (ctx)->intel.has_bsd)
> -
> -#define HAS_H264_DECODING(ctx)  ((ctx)->codec_info-
> >has_h264_decoding && \
> -                                 (ctx)->intel.has_bsd)
> -
> -#define HAS_H264_ENCODING(ctx)  ((ctx)->codec_info-
> >has_h264_encoding && \
> -                                 (ctx)->intel.has_bsd)
> -
> -#define HAS_LP_H264_ENCODING(ctx)  ((ctx)->codec_info-
> >has_lp_h264_encoding && \
> -                                    (ctx)->intel.has_bsd)
> -
> -#define HAS_VC1_DECODING(ctx)   ((ctx)->codec_info->has_vc1_decoding 
> && \
> -                                 (ctx)->intel.has_bsd)
> -
> -#define HAS_JPEG_DECODING(ctx)  ((ctx)->codec_info-
> >has_jpeg_decoding && \
> -                                 (ctx)->intel.has_bsd)
> -                                                                  
> -#define HAS_JPEG_ENCODING(ctx)  ((ctx)->codec_info-
> >has_jpeg_encoding && \
> -                                 (ctx)->intel.has_bsd)      
> -
> -#define HAS_VPP(ctx)    ((ctx)->codec_info->has_vpp)
> -
> -#define HAS_ACCELERATED_GETIMAGE(ctx)   ((ctx)->codec_info-
> >has_accelerated_getimage)
> -
> -#define HAS_ACCELERATED_PUTIMAGE(ctx)   ((ctx)->codec_info-
> >has_accelerated_putimage)
> -
> -#define HAS_TILED_SURFACE(ctx) ((ctx)->codec_info-
> >has_tiled_surface)
> -
> -#define HAS_VP8_DECODING(ctx)   ((ctx)->codec_info->has_vp8_decoding 
> && \
> -                                 (ctx)->intel.has_bsd)
> -
> -#define HAS_VP8_ENCODING(ctx)   ((ctx)->codec_info->has_vp8_encoding 
> && \
> -                                 (ctx)->intel.has_bsd)
> -
> -#define HAS_H264_MVC_DECODING(ctx) \
> -    (HAS_H264_DECODING(ctx) && (ctx)->codec_info-
> >h264_mvc_dec_profiles)
> -
> -#define HAS_H264_MVC_DECODING_PROFILE(ctx,
> profile)                     \
> -    (HAS_H264_MVC_DECODING(ctx)
> &&                                      \
> -     ((ctx)->codec_info->h264_mvc_dec_profiles & (1U << profile)))
> -
> -#define HAS_H264_MVC_ENCODING(ctx)  ((ctx)->codec_info-
> >has_h264_mvc_encoding && \
> -                                     (ctx)->intel.has_bsd)
> -
> -#define HAS_HEVC_DECODING(ctx)          ((ctx)->codec_info-
> >has_hevc_decoding && \
> -                                         (ctx)->intel.has_bsd)
> -
> -#define HAS_HEVC_ENCODING(ctx)          ((ctx)->codec_info-
> >has_hevc_encoding && \
> -                                         (ctx)->intel.has_bsd)
> -
> -#define HAS_VP9_DECODING(ctx)          ((ctx)->codec_info-
> >has_vp9_decoding && \
> -                                         (ctx)->intel.has_bsd)
> -
> -#define HAS_VP9_DECODING_PROFILE(ctx, profile)                     \
> -    (HAS_VP9_DECODING(ctx) &&                                      \
> -     ((ctx)->codec_info->vp9_dec_profiles & (1U << (profile -
> VAProfileVP9Profile0))))
> -
> -#define HAS_HEVC10_DECODING(ctx)        ((ctx)->codec_info-
> >has_hevc10_decoding && \
> -                                         (ctx)->intel.has_bsd)
> -
> -#define HAS_VPP_P010(ctx)        ((ctx)->codec_info->has_vpp_p010 &&
> \
> -                                         (ctx)->intel.has_bsd)
> -
> -#define HAS_VP9_ENCODING(ctx)          ((ctx)->codec_info-
> >has_vp9_encoding && \
> -                                         (ctx)->intel.has_bsd)
> -
>  static int get_sampling_from_fourcc(unsigned int fourcc);
>  
>  /* Check whether we are rendering to X11 (VA/X11 or VA/GLX API) */
> diff --git a/src/i965_drv_video.h b/src/i965_drv_video.h
> index 9fe042f9e924..f7c61733d26e 100644
> --- a/src/i965_drv_video.h
> +++ b/src/i965_drv_video.h
> @@ -77,6 +77,76 @@
>  
>  #define ENCODER_LP_QUALITY_RANGE  8
>  
> +#define HAS_MPEG2_DECODING(ctx)  ((ctx)->codec_info-
> >has_mpeg2_decoding && \
> +                                  (ctx)->intel.has_bsd)
> +
> +#define HAS_MPEG2_ENCODING(ctx)  ((ctx)->codec_info-
> >has_mpeg2_encoding && \
> +                                  (ctx)->intel.has_bsd)
> +
> +#define HAS_H264_DECODING(ctx)  ((ctx)->codec_info-
> >has_h264_decoding && \
> +                                 (ctx)->intel.has_bsd)
> +
> +#define HAS_H264_ENCODING(ctx)  ((ctx)->codec_info-
> >has_h264_encoding && \
> +                                 (ctx)->intel.has_bsd)
> +
> +#define HAS_LP_H264_ENCODING(ctx)  ((ctx)->codec_info-
> >has_lp_h264_encoding && \
> +                                    (ctx)->intel.has_bsd)
> +
> +#define HAS_VC1_DECODING(ctx)   ((ctx)->codec_info->has_vc1_decoding 
> && \
> +                                 (ctx)->intel.has_bsd)
> +
> +#define HAS_JPEG_DECODING(ctx)  ((ctx)->codec_info-
> >has_jpeg_decoding && \
> +                                 (ctx)->intel.has_bsd)
> +
> +#define HAS_JPEG_ENCODING(ctx)  ((ctx)->codec_info-
> >has_jpeg_encoding && \
> +                                 (ctx)->intel.has_bsd)
> +
> +#define HAS_VPP(ctx)    ((ctx)->codec_info->has_vpp)
> +
> +#define HAS_ACCELERATED_GETIMAGE(ctx)   ((ctx)->codec_info-
> >has_accelerated_getimage)
> +
> +#define HAS_ACCELERATED_PUTIMAGE(ctx)   ((ctx)->codec_info-
> >has_accelerated_putimage)
> +
> +#define HAS_TILED_SURFACE(ctx) ((ctx)->codec_info-
> >has_tiled_surface)
> +
> +#define HAS_VP8_DECODING(ctx)   ((ctx)->codec_info->has_vp8_decoding 
> && \
> +                                 (ctx)->intel.has_bsd)
> +
> +#define HAS_VP8_ENCODING(ctx)   ((ctx)->codec_info->has_vp8_encoding 
> && \
> +                                 (ctx)->intel.has_bsd)
> +
> +#define HAS_H264_MVC_DECODING(ctx) \
> +    (HAS_H264_DECODING(ctx) && (ctx)->codec_info-
> >h264_mvc_dec_profiles)
> +
> +#define HAS_H264_MVC_DECODING_PROFILE(ctx,
> profile)                     \
> +    (HAS_H264_MVC_DECODING(ctx)
> &&                                      \
> +     ((ctx)->codec_info->h264_mvc_dec_profiles & (1U << profile)))
> +
> +#define HAS_H264_MVC_ENCODING(ctx)  ((ctx)->codec_info-
> >has_h264_mvc_encoding && \
> +                                     (ctx)->intel.has_bsd)
> +
> +#define HAS_HEVC_DECODING(ctx)          ((ctx)->codec_info-
> >has_hevc_decoding && \
> +                                         (ctx)->intel.has_bsd)
> +
> +#define HAS_HEVC_ENCODING(ctx)          ((ctx)->codec_info-
> >has_hevc_encoding && \
> +                                         (ctx)->intel.has_bsd)
> +
> +#define HAS_VP9_DECODING(ctx)          ((ctx)->codec_info-
> >has_vp9_decoding && \
> +                                         (ctx)->intel.has_bsd)
> +
> +#define HAS_VP9_DECODING_PROFILE(ctx, profile)                     \
> +    (HAS_VP9_DECODING(ctx) &&                                      \
> +     ((ctx)->codec_info->vp9_dec_profiles & (1U << (profile -
> VAProfileVP9Profile0))))
> +
> +#define HAS_HEVC10_DECODING(ctx)        ((ctx)->codec_info-
> >has_hevc10_decoding && \
> +                                         (ctx)->intel.has_bsd)
> +
> +#define HAS_VPP_P010(ctx)        ((ctx)->codec_info->has_vpp_p010 &&
> \
> +                                         (ctx)->intel.has_bsd)
> +
> +#define HAS_VP9_ENCODING(ctx)          ((ctx)->codec_info-
> >has_vp9_encoding && \
> +                                         (ctx)->intel.has_bsd)
> +
>  struct i965_surface
>  {
>      struct object_base *base;


More information about the Libva mailing list