From 7c4216d84be8b67a118de7defa946e6753424758 Mon Sep 17 00:00:00 2001 From: "U. Artie Eoff" Date: Thu, 8 Sep 2016 07:47:57 -0700 Subject: [PATCH] move HAS_* macros to header 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. v2: rebased Signed-off-by: U. Artie Eoff Reviewed-by: Sean V Kelley (cherry picked from commit 21aaa176a24a1eb61f514f7e1fb1d4aa46b36b70) --- src/i965_drv_video.c | 72 ---------------------------------------------------- src/i965_drv_video.h | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 72 deletions(-) diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c index 9e9393e..2ca84c0 100644 --- a/src/i965_drv_video.c +++ b/src/i965_drv_video.c @@ -57,78 +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_HEVC10_ENCODING(ctx) ((ctx)->codec_info->has_hevc10_encoding && \ - (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 77e32d8..9b9bfac 100644 --- a/src/i965_drv_video.h +++ b/src/i965_drv_video.h @@ -77,6 +77,78 @@ #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_HEVC10_ENCODING(ctx) ((ctx)->codec_info->has_hevc10_encoding && \ + (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; -- 2.11.0