Giter Club home page Giter Club logo

media-driver's Introduction

Intel(R) Media Driver for VAAPI

Introduction

The Intel(R) Media Driver for VAAPI is a new VA-API (Video Acceleration API) user mode driver supporting hardware accelerated decoding, encoding, and video post processing for GEN based graphics hardware.

License

The Intel(R) Media Driver for VAAPI is distributed under the MIT license with portions covered under the BSD 3-clause "New" or "Revised" License. You may obtain a copy of the License at MIT & BSD-3-Clause

Building

For Ubuntu 16.04+

apt install autoconf libtool libdrm-dev xorg xorg-dev openbox libx11-dev libgl1-mesa-glx

Equivalents for other distributions should work.

  1. Build and install LibVA
  2. Build and install GmmLib following GmmLib compatibility
  3. Get media repo and format the workspace folder as below (suggest the workspace to be a dedicated one for media driver build):
    <workspace>
        |- media-driver
    
  4. Create build_media new folder under your workspace
    $ mkdir <workspace>/build_media
    
    then the workspace looks like below
    <workspace>
        |- media-driver
        |- build_media
    
  5. $ cd <workspace>/build_media
    
  6. $ cmake ../media-driver
    
  7. $ make -j"$(nproc)"
    

Install

$ sudo make install

This will install the following files (e.g. on Ubuntu):

-- Installing: /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
-- Installing: /etc/profile.d/intel-media.sh
-- Installing: /usr/lib/x86_64-linux-gnu/igfxcmrt64.so

For iHD_drv_video.so please export related LIBVA environment variables.

export LIBVA_DRIVERS_PATH=<path-contains-iHD_drv_video.so>
export LIBVA_DRIVER_NAME=iHD

Supported Platforms

  • BDW (Broadwell)
  • SKL (Skylake)
  • BXTx (BXT: Broxton, APL: Apollo Lake, GLK: Gemini Lake)
  • KBLx (KBL: Kaby Lake, CFL: Coffee Lake, WHL: Whiskey Lake, CML: Comet Lake, AML: Amber Lake)
  • ICL (Ice Lake)
  • JSL (Jasper Lake) / EHL (Elkhart Lake)
  • TGLx (TGL: Tiger Lake, RKL: Rocket Lake, ADL-S/P/N: Alder Lake, RPL-S/P: Raptor Lake)
  • DG1/SG1
  • Alchemist(DG2)/ATSM
  • MTLx (MTL: Meteor Lake, ARL-S/H: Arrow Lake)

Components and Features

Media driver contains three components as below

  • Video decoding calls hardware-based decoder(VDBox) which provides fully-accelerated hardware video decoding to release the graphics engine for other operations.
  • Video encoding supports two modes, one calls hardware-based encoder(VDEnc/Huc) to provide low power encoding, another one is hardware(PAK)+shader(media kernel+VME) based encoding. User could choose the mode through VA-API.
  • Video processing supports several popular features by hardware-based video processor(VEBox/SFC) and shader(media kernel) based solution together.

Media driver supports below two builds

  • Full Feature Build is default driver build, which supports all feature by hardware accelerator and close source shaders(media kernel binaries). Most of OSVs(like RHEL/SUSE/fedora) are using this build.
  • Free Kernel Build, enables fully open source shaders(media kernels) and hardware features but the features would be limited.

About Ubuntu/Debian OSV, they provide intel-media-va-driver-non-free (Full feature build) and intel-media-va-driver (Free kernel build) two packages. Free here means open source kernel but not related to fee need to pay. You could refer to build options for more detail.

If you are looking forward to have a big table to share media component features on these two builds, below tables are good referene for your information.

Decoding/Encoding Features

CODEC Build Types MTLx DG2/ATSM DG1/SG1 TGLx EHL/JSL ICL KBLx BXTx SKL BDW
AVC Full-Feature
Free-Kernel
D/E
D/E
D/E
D/E
D/E/Es
D/E
D/E/Es
D/E
D/E
D/E
D/E/Es
D/E
D/E/Es
D/E
D/E/Es
D/E
D/E/Es
D/E
D/Es
D
MPEG-2 Full-Feature
Free-Kernel
D
D
D
D
D/Es
D
D/Es
D
D
D
D/Es
D
D/Es
D
D
D
D/Es
D
D/Es
D
VC-1 Full-Feature
Free-Kernel
 
 
 
 
D
 
D
 
D
 
D
 
D
 
D
 
D
 
D
 
JPEG Full-Feature
Free-Kernel
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D
D
VP8 Full-Feature
Free-Kernel
D
D
 
 
 
 
D*
D*
D
D
D/Es
D
D/Es
D
D
D
D
D
D
D
HEVC 8bit Full-Feature
Free-Kernel
D/E
D/E
D/E
D/E
D/E/Es
D/E
D/E/Es
D/E
D/E
D/E
D/E/Es
D/E
D/Es
D
D/Es
D
D/Es
D
HEVC 8bit 422 Full-Feature
Free-Kernel
D
D
D/E
D/E
D/Es
D
D/Es
D
D
D
D/Es
D
HEVC 8bit 444 Full-Feature
Free-Kernel
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
HEVC 10bit Full-Feature
Free-Kernel
D/E
D/E
D/E
D/E
D/E/Es
D/E
D/E/Es
D/E
D/E
D/E
D/E/Es
D/E
D/Es
D
D
D
HEVC 10bit 422 Full-Feature
Free-Kernel
D
D
D/E
D/E
D/Es
D
D/Es
D
D
D
D/Es
D
HEVC 10bit 444 Full-Feature
Free-Kernel
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
HEVC 12bit Full-Feature
Free-Kernel
D
D
D
D
D/Es
D
D/Es
D
HEVC 12bit 422 Full-Feature
Free-Kernel
D
D
D
D
D
D
D
D
HEVC 12bit 444 Full-Feature
Free-Kernel
D
D
D
D
D
D
D
D
VP9 8bit Full-Feature
Free-Kernel
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D
D
D
D
VP9 8bit 444 Full-Feature
Free-Kernel
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
VP9 10bit Full-Feature
Free-Kernel
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D
D
VP9 10bit 444 Full-Feature
Free-Kernel
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
VP9 12bit Full-Feature
Free-Kernel
D
D
D
D
D
D
D
D
VP9 12bit 444 Full-Feature
Free-Kernel
D
D
D
D
D
D
D
D
AV1 8bit Full-Feature
Free-Kernel
D/E
D/E
D/E
D/E
D
D
D
D
AV1 10bit Full-Feature
Free-Kernel
D/E
D/E
D/E
D/E
D
D
D
D
  • * VP8 decoding is only supported on TGL platform
  • D - Hardware Decoding
  • E - Hardware Encoding, Low Power Encoding(VDEnc/Huc)
  • Es - Hardware(PAK) + Shader(media kernel+VME) Encoding

Note: Low Power Encoding(VAEntrypointEncSliceLP) and Shader Encoding(VAEntrypointEncSlice) are consolidated to the unified interface(VAEntrypointEncSlice) from MTL platform. It goes through VDEnc/Huc for HW acceleration to unleash GPU resource to customers.

For more decoding and encoding features information, please refer to

Video Processing Features

CODEC Build Types MTLx DG2/ATSM DG1/SG1 TGLx EHL/JSL ICL KBLx BXTx SKL BDW
Blending Full-Feature
Free-Kernel
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
 
Yes
 
Yes
 
Yes
 
CSC Full-Feature
Free-Kernel
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
 
Yes
 
Yes
 
Yes
 
De-interlace Full-Feature
Free-Kernel
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes*
Yes*
Yes
Yes
Yes
 
Yes
 
Yes
 
Yes
 
De-noise Full-Feature
Free-Kernel
Yes
 
Yes
 
Yes
 
Yes
 
 
 
Yes
 
Yes
 
Yes
 
Yes
 
Yes
 
Luma Key Full-Feature
Free-Kernel
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
 
Yes
 
Yes
 
Yes
 
Mirroring Full-Feature
Free-Kernel
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
 
Yes
 
Yes
 
Yes
 
ProcAmp Full-Feature
Free-Kernel
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
 
Yes
 
Yes
 
Yes
 
Rotation Full-Feature
Free-Kernel
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
 
Yes
 
Yes
 
Yes
 
Scaling Full-Feature
Free-Kernel
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
 
Yes
 
Yes
 
Yes
 
Sharpening Full-Feature
Free-Kernel
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
 
Yes
 
Yes
 
Yes
 
STD/E Full-Feature
Free-Kernel
Yes
 
Yes
 
Yes
 
Yes
 
 
 
Yes
 
Yes
 
Yes
 
Yes
 
Yes
 
TCC Full-Feature
Free-Kernel
Yes
 
Yes
 
Yes
 
Yes
 
 
 
Yes
 
Yes
 
Yes
 
Yes
 
Yes
 
Color fill Full-Feature
Free-Kernel
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
 
Yes
 
Yes
 
Yes
 
Chroma Siting Full-Feature
Free-Kernel
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
 
Yes
 
Yes
 
 
 
HDR10 TM Full-Feature
Free-Kernel
Yes
 
Yes
 
Yes
 
Yes
 
 
 
Yes
 
 
 
 
 
 
 
 
 
3DLUT Full-Feature
Free-Kernel
Yes
 
Yes
 
Yes
 
Yes
 
 
 
 
 
 
 
 
 
 
 
 
 
  • * EHL/JSL only support BOB DI
  • CSC: Color Space Conversion
  • ProcAmp: brightness,contrast,hue,saturation
  • STD/E: Skin Tone Detect & Enhancement
  • TCC: Total Color Control
  • HDR10 TM: HDR10 Tone Mapping
  • 3DLUT: Three Dimensional Look Up Table

For more feature information, please refer to Supported video processing csc/scaling format

Build Options

Media-driver supports different build types as described below. You could refer to the following settings to enable them.

  • Full Feature Build: ENABLE_KERNELS=ON(Default) ENABLE_NONFREE_KERNELS=ON(Default)
  • Free Kernel Build: ENABLE_KERNELS=ON ENABLE_NONFREE_KERNELS=OFF
    • If trying to use pre-built open source kernel binaries, please add BUILD_KERNELS=OFF(Default).
    • If trying to rebuild open source kernel from source code, please add BUILD_KERNELS=ON.

Media-driver requires special i915 kernel mode driver (KMD) version to support the following platforms since upstream version of i915 KMD does not fully support them(pending patches upstream). To enable these platforms, it requires to specify ENABLE_PRODUCTION_KMD=ON (default: OFF) build configuration option.

  • DG1/SG1
  • ATSM

Known Issues and Limitations

  1. Intel(R) Media Driver for VAAPI is recommended to be built against gcc compiler v6.1 or later, which officially supported C++11.

  2. SKL: Green or other incorrect color will be observed in output frames when using YV12/I420 as input format for csc/scaling/blending/rotation, etc. on Ubuntu 16.04 stock (with kernel 4.10). The issue can be addressed with the kernel patch: WaEnableYV12BugFixInHalfSliceChicken7

  3. HuC firmware is necessary for AVC/HEVC/VP9/AV1 low power encoding bitrate control, including CBR, VBR, etc. The default kernel configuration didn't enable HuC loading for TGL/RKL and legacy platforms but enabled it from ADL+ platforms. You could change the HuC setting with "options i915 enable_guc=2" > /etc/modprobe.d/i915.conf under root. For ADL+ platforms, the kernel loads HuC as default if the related platform HuC binary exists in /lib/firware/i915. The HuC firmwares available on different platforms are:

    • APL/KBL: starting from kernel 4.11, HuC loading is disabled as default, so set i915.enable_guc=2
    • CFL: starting from kernel 4.15, HuC loading is disabled as default, so set i915.enable_guc=2
    • ICL: starting from kernel 5.2, HuC loading is disabled as default, so set i915.enable_guc=2
    • EHL/JSL: starting from kernel 5.8, HuC loading is disabled as default, so set i915.enable_guc=2
    • TGL: starting from kernel 5.9, HuC loading is disabled as default, so set i915.enable_guc=2
    • RKL: starting from kernel 5.17, HuC loading is disabled as default, so set i915.enable_guc=2
    • ADL-S/ADL-P: starting from kernel 5.17
    • ADL-N/RPL-S/RPL-P: starting from kernel 6.2
    • DG1/SG1: intel-gpu/intel-gpu-i915-backports
    • Alchemist(DG2): starting from kernel 6.2
    • ATSM: intel-gpu/intel-gpu-i915-backports
  4. Other more known issues, please refer to media-driver/wiki "Known Issues" pages.

(*) Other names and brands may be claimed as property of others.

media-driver's People

Contributors

alex1zhang avatar bai-isaac avatar dylan-debug avatar fenhu avatar furongzhang avatar guangyao-bai avatar hanlong1 avatar hefan2017 avatar huangli2018 avatar intel-mediadev avatar ivan-losev avatar jexu avatar jister avatar kchen1024 avatar lhgu avatar ljia5 avatar luleilei1 avatar microyy avatar pengwan1 avatar perrchen avatar pingliwa avatar shawnli2 avatar vickyzengg avatar walter-bai avatar wangqia6 avatar wyc55069407 avatar xiaoton1 avatar xinfengzhang avatar yanfeng-mi avatar zefuli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

media-driver's Issues

Driver installation should use libva.pc driverdir variable

LibVA provides a pkgconfig (libva.pc) file that defines a driverdir variable. This variable specifies the default path that libva will search for drivers. This variable can be obtained with pkg-config libva --variable driverdir. The cmake configuration should use this driverdir as the default installation location for the driver (but still allow it to be overridden by developer... e.g. -DLIBVA_DRIVERS_PATH=). Obviously, users can still override libva driver search path with environment var at runtime.

[gstreamer-vaapi-master][iHD_SKL] [VPP] "tsdemux0: Internal data stream error" error message occurs during run vpp transcoding with iHD driver on SKL

Test Env:

Platform: SKL
Arch: x86_64
Kernel: 4.12.0-rc2
libva: master branch df544cd5a31e54d4cbd33a391795a8747ddaf789
repo: https://github.com/01org/libva.git
media_driver: master branch 81796c8
repo: https://github.com/intel/media-driver
gmmlib: repo: https://github.com/intel/gmmlib
gst-vaapi: master branch b0d41c5db8c29b3df2a5b23d3da55141d701b992

Reproduce Steps:

  1. build env as above lists or according to wiki https://github.com/intel/media-driver
  2. take one case for example, run command
    gst-launch-1.0 filesrc location=/media/ts/Sally.ts ! tsdemux ! mpegvideoparse ! vaapimpeg2dec ! vaapih264enc rate-control=cqp init-qp=4 keyframe-period=1 max-bframes=0 cabac=true ! qtmux faststart=true '!' filesink location=test.mp4
  3. error info. as below
    ERROR: from element /GstPipeline:pipeline0/GstTSDemux:tsdemux0: Internal data stream error.
    Additional debug info:
    mpegtsbase.c(1613): mpegts_base_loop (): /GstPipeline:pipeline0/GstTSDemux:tsdemux0:
    streaming stopped, reason not-negotiated (-4)
    ERROR: pipeline doesn't want to preroll

~2000 test failures in test_va_api

test_va_api is part of https://github.com/01org/libva-utils and is used for simple VA API conformance validation. Currently, when executed with LIBVA_DRIVER_NAME=iHD there are ~2000 test failures. Some test failures are inevitable (since they may be specific to i965 driver), but many others are real failures.

FYI... i965 driver has 0 failures in test_va_api as of writing.

vainfo invalid VAContextID

vainfo is provided by https://github.com/01org/libva-utils and is the defacto tool used by developers and users to run a sanity check on vaapi driver capabilities. Unfortunately, vainfo fails when using iHD vaapi driver:

$ export LIBVA_DRIVER_NAME=iHD
$ vainfo
libva info: VA-API version 1.0.0
libva info: va_getDriverName() returns 0
libva info: User requested driver 'iHD'
libva info: Trying to open /home/uaeoff/Work/workspace/media/install/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_0
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.0 (libva 2.0.1.pre1)
vainfo: Driver version: 2.0.0
vainfo: Supported profile and entrypoints
vaQueryConfigProfiles failed with error code 5 (invalid VAContextID),exit

[gstreamer-vaapi-master][iHD_SKL] [JPEG_decode] 52 cases decoding fail during run jpeg decoding cases with iHD driver on SKL

Test Env:

Platform: SKL
Arch: x86_64
Kernel: 4.12.0-rc2
libva: master branch df544cd5a31e54d4cbd33a391795a8747ddaf789
repo: https://github.com/01org/libva.git
media_driver: master branch 81796c8
repo: https://github.com/intel/media-driver
gmmlib: repo: https://github.com/intel/gmmlib
gst-vaapi: master branch b0d41c5db8c29b3df2a5b23d3da55141d701b992

Reproduce Steps:

  1. build env as above lists or according to wiki https://github.com/intel/media-driver
  2. take one case for example, run command
    gst-launch-1.0 filesrc location=/media//JPEG_RefCompare/400_f_14312182_t8o4hv9r9eqs17mc1zzykfaxeufdh0p0.jpg '!' jpegparse '!' vaapijpegdec '!' videoconvert '!' video/x-raw, format=I420 '!' filesink location=400_f_14312182_t8o4hv9r9eqs17mc1zzykfaxeufdh0p0.jpg.yuv
  3. error info. as below
    0:00:00.034652253 17348 0xf33ed0 ERROR vaapidecode gstvaapidecode.c:716:gst_vaapidecode_handle_frame: decode error -1
    ERROR: from element /GstPipeline:pipeline0/GstVaapiDecode_jpeg:vaapidecode_jpeg0: No valid frames decoded before end of stream

Failed cases
decode_jpeg/126296226_bf7eba45c21.jpg yuvj444p 500 332 DecodeFAIL
decode_jpeg/127746-fb.jpg yuvj444p 338 450 DecodeFAIL
decode_jpeg/1-gbb-peace-389.jpg yuvj444p 600 464 DecodeFAIL
decode_jpeg/29-4673tourists-rice-boat-on-the-backwaters-near-kayamkulam-kerala-india-posters.jpg yuvj444p 400 300 DecodeFAIL
decode_jpeg/29-725.jpg yuvj444p 400 296 DecodeFAIL
decode_jpeg/3245_by_chris_johansen-thumb.jpg yuvj444p 500 656 DecodeFAIL
decode_jpeg/34tew40.jpg yuvj444p 450 734 DecodeFAIL
decode_jpeg/390-2377.jpg yuvj444p 400 300 DecodeFAIL
decode_jpeg/400_f_11014777_vbypseclj6jfkjhgn5wsiidtrm5j0ukm.jpg yuvj444p 400 300 DecodeFAIL
decode_jpeg/400_f_11333253_dkuzd0h1xj8oqtwsxz9ea9nujxj5mjrq.jpg yuvj444p 400 320 DecodeFAIL
decode_jpeg/400_f_13944420_gihrb2varxosawnjrvflrggxvnpmkeyg.jpg yuvj444p 400 400 DecodeFAIL
decode_jpeg/400_f_14004535_9qiymls1kpn2mq8kgdfysndvw4qimbtl.jpg yuvj444p 400 296 DecodeFAIL
decode_jpeg/400_f_14150758_epe7fh0blmqvoxqstyzff9kz0xxjyt9t.jpg yuvj444p 400 300 DecodeFAIL
decode_jpeg/400_f_14201614_jqrgiltby92rwjadydtqlagod5tc6njg.jpg yuvj444p 400 314 DecodeFAIL
decode_jpeg/400_f_14310896_gaep1uru4nutibf98qt4iicukm0vayeg.jpg yuvj444p 400 400 DecodeFAIL
decode_jpeg/400_f_14310927_ayxnxkrpahml6atf6fm7mfgvnczdv5bv.jpg yuvj444p 400 400 DecodeFAIL
decode_jpeg/400_f_14311495_refaunj64cbf4rf3zobifluyio0hzmkh.jpg yuvj444p 300 400 DecodeFAIL
decode_jpeg/400_f_14311552_tmefk12yayjvorxyzmh9j92623glx7zh.jpg yuvj444p 400 400 DecodeFAIL
decode_jpeg/400_f_14311635_tvumkyrtgl2lnyouhfqp7urpxo1o8kxr.jpg yuvj444p 400 300 DecodeFAIL
decode_jpeg/400_f_14312182_t8o4hv9r9eqs17mc1zzykfaxeufdh0p0.jpg yuvj444p 400 400 DecodeFAIL
decode_jpeg/400_f_14313041_senx94ixyp2iokaqxsmas6aq43pzmfue.jpg yuvj444p 400 288 DecodeFAIL
decode_jpeg/400_f_14313562_yh6xdckpetsqd6cpzymfmjoy66uwboqz.jpg yuvj444p 400 400 DecodeFAIL
decode_jpeg/400_f_14316145_utxi4cegtqh0m5iobzbwyns5osumck8w.jpg yuvj444p 400 400 DecodeFAIL
decode_jpeg/400_f_5643155_upbvgu5cooibzcw4g5f4hgglijyumdqw.jpg yuvj444p 400 300 DecodeFAIL
decode_jpeg/400_f_6674077_w0c4zo0owuaqwdgd37aeztu437c2felb.jpg yuvj444p 400 400 DecodeFAIL
decode_jpeg/400_f_7095312_qdpqkhefixx37xfjtkly03lgnly2d3mt.jpg yuvj444p 400 400 DecodeFAIL
decode_jpeg/400_f_7717462_0kkv7ej7lfp1ztqtbhjzx419t8goqkeh.jpg yuvj444p 400 400 DecodeFAIL
decode_jpeg/415107223_273915da90.jpg yuvj444p 500 400 DecodeFAIL
decode_jpeg/439263359_dff7ea8381.jpg yuvj444p 500 400 DecodeFAIL
decode_jpeg/4point5.jpg yuvj444p 688 600 DecodeFAIL
decode_jpeg/4_tile.jpg yuvj444p 400 400 DecodeFAIL
decode_jpeg/548-3262vishnumurthi-teyyam-ritual-nellikkathuruthi-temple-malabar-coast-kerala-state-india-posters.jpg yuvj444p 400 300 DecodeFAIL
decode_jpeg/7sisters.bmp_RGB_444_100.jpg yuvj444p 1024 692 DecodeFAIL
decode_jpeg/a17_jb00519.jpg yuvj444p 4288 2848 DecodeFAIL
decode_jpeg/annual-1-tumb.jpg yuvj444p 500 332 DecodeFAIL
decode_jpeg/arbonne.jpg yuvj444p 300 528 DecodeFAIL
decode_jpeg/canona20_010421-1106-44.jpg yuvj422p 1600 1200 DecodeFAIL
decode_jpeg/canona520_img_0259.jpg yuvj422p 2272 1704 DecodeFAIL
decode_jpeg/canona95_img_8468.jpg yuvj422p 2592 1944 DecodeFAIL
decode_jpeg/canondigitalixus300_010319-0950-20.jpg yuvj422p 1600 1200 DecodeFAIL
decode_jpeg/canonditalixus330_020403-1144-46.jpg yuvj422p 1600 1200 DecodeFAIL
decode_jpeg/canoneos1ds_021104-1112-01-capt1.jpg yuvj444p 4072 2712 DecodeFAIL
decode_jpeg/canoneos5dmarkii_img_0001-acr.jpg yuvj444p 5616 3744 DecodeFAIL
decode_jpeg/capture28.jpg yuvj420p 904 4340 DecodeFAIL
decode_jpeg/capture30.jpg yuvj420p 860 1616 DecodeFAIL
decode_jpeg/capture31.jpg yuvj420p 982 1522 DecodeFAIL
decode_jpeg/capture37.JPG yuvj420p 1280 968 DecodeFAIL
decode_jpeg/capture39.JPG yuvj420p 1280 968 DecodeFAIL
decode_jpeg/capture40.JPG yuvj420p 1280 968 DecodeFAIL
decode_jpeg/capture47.jpg yuvj420p 860 1534 DecodeFAIL
decode_jpeg/cave.jpg yuvj420p 1600 1200 DecodeFAIL
decode_jpeg/collage1.JPG yuvj420p 1280 968 DecodeFAIL

Compile error c++ (GCC) 7.2.1 20170915 (not a constant expression)

With c++ (GCC) 7.2.1 20170915 (i.e. Fedora 27 default GCC version), the following compiler error is generated:

In file included from <snip>/media_driver/agnostic/common/os/mos_context.cpp:28:0:
<snip>/media_driver/linux/common/os/mos_context_specific.h:63:67: error: value ‘18446744073709551615’ of type ‘void*’ is not a constant expression
     constexpr static void* MOS_LINUX_SHM_INVALID       = (void *)-1;
                                                                   ^

Conformance: vaQuerySurfaceAttributes does not adjust num_attribs

Per API documentation (https://github.com/01org/libva/blob/68a4befd03535bf9ed8077b27d8a0c421951a445/va/va.h#L1320):

 * The \c attrib_list array is allocated by the user and \c
 * num_attribs shall be initialized to the number of allocated
 * elements in that array. Upon successful return, the actual number
 * of attributes will be overwritten into \c num_attribs. Otherwise,
 * \c VA_STATUS_ERROR_MAX_NUM_EXCEEDED is returned and \c num_attribs
 * is adjusted to the number of elements that would be returned if
 * enough space was available.

iHD does not adjust num_attribs when VA_STATUS_ERROR_MAX_NUM_EXCEEDED and therefore client apps are unable to act accordingly.

Some Unit Test give a Error message, but test result is OK

I build media-driver with :
cmake ../media-driver -DCMAKE_INSTALL_PREFIX=/usr -DMEDIA_VERSION="2.0.0" -DBUILD_ALONG_WITH_CMRTLIB=1 -DBS_DIR_GMMLIB=pwd/../gmmlib/Source/GmmLib/ -DBS_DIR_COMMON=pwd/../gmmlib/Source/Common/ -DBS_DIR_INC=pwd/../gmmlib/Source/inc/ -DBS_DIR_MEDIA=pwd/../media-driver -DBUILD_TYPE=Debug

get some suspicious unit test log and result, this is sample as follow:

[----------] 5 tests from Surface2DTest
[ RUN ] Surface2DTest.MultipleSizes
Load driver from ../../../iHD_drv_video.so.
INFO: Load driver success
INFO: Found init function __vaDriverInit_1_0 and CM entry point vaCmExtSendReqMsg
.INFO: Get driver DDI functions
drmIoctl: with unsupport IOType
Load driver from ../../../iHD_drv_video.so.
INFO: Load driver success
INFO: Found init function __vaDriverInit_1_0 and CM entry point vaCmExtSendReqMsg
.INFO: Get driver DDI functions
drmIoctl: with unsupport IOType
Load driver from ../../../iHD_drv_video.so.
INFO: Load driver success
INFO: Found init function __vaDriverInit_1_0 and CM entry point vaCmExtSendReqMsg
.INFO: Get driver DDI functions
drmIoctl: with unsupport IOType
Load driver from ../../../iHD_drv_video.so.
INFO: Load driver success
INFO: Found init function __vaDriverInit_1_0 and CM entry point vaCmExtSendReqMsg
.INFO: Get driver DDI functions
drmIoctl: with unsupport IOType
Load driver from ../../../iHD_drv_video.so.
INFO: Load driver success
INFO: Found init function __vaDriverInit_1_0 and CM entry point vaCmExtSendReqMsg
.INFO: Get driver DDI functions
drmIoctl: with unsupport IOType
Load driver from ../../../iHD_drv_video.so.
INFO: Load driver success
INFO: Found init function __vaDriverInit_1_0 and CM entry point vaCmExtSendReqMsg
.INFO: Get driver DDI functions
drmIoctl: with unsupport IOType
Load driver from ../../../iHD_drv_video.so.
INFO: Load driver success
INFO: Found init function __vaDriverInit_1_0 and CM entry point vaCmExtSendReqMsg
.INFO: Get driver DDI functions
drmIoctl: with unsupport IOType
Load driver from ../../../iHD_drv_video.so.
INFO: Load driver success
INFO: Found init function __vaDriverInit_1_0 and CM entry point vaCmExtSendReqMsg
.INFO: Get driver DDI functions
drmIoctl: with unsupport IOType
Load driver from ../../../iHD_drv_video.so.
INFO: Load driver success
INFO: Found init function __vaDriverInit_1_0 and CM entry point vaCmExtSendReqMsg
.INFO: Get driver DDI functions
drmIoctl: with unsupport IOType
Load driver from ../../../iHD_drv_video.so.
INFO: Load driver success
INFO: Found init function __vaDriverInit_1_0 and CM entry point vaCmExtSendReqMsg
.INFO: Get driver DDI functions
drmIoctl: with unsupport IOType
Load driver from ../../../iHD_drv_video.so.
INFO: Load driver success
INFO: Found init function __vaDriverInit_1_0 and CM entry point vaCmExtSendReqMsg
.INFO: Get driver DDI functions
drmIoctl: with unsupport IOType
Load driver from ../../../iHD_drv_video.so.
INFO: Load driver success
INFO: Found init function __vaDriverInit_1_0 and CM entry point vaCmExtSendReqMsg
.INFO: Get driver DDI functions
drmIoctl: with unsupport IOType
Load driver from ../../../iHD_drv_video.so.
INFO: Load driver success
INFO: Found init function __vaDriverInit_1_0 and CM entry point vaCmExtSendReqMsg
.INFO: Get driver DDI functions
drmIoctl: with unsupport IOType
[CM]: CRITICAL - Surface2DSanityCheck:116: Error: Invalid surface width.
[CM]: CRITICAL - CreateSurface2D:1006: Error: Surface 2D sanity check failure.

Load driver from ../../../iHD_drv_video.so.
INFO: Load driver success
INFO: Found init function __vaDriverInit_1_0 and CM entry point vaCmExtSendReqMsg
.INFO: Get driver DDI functions
drmIoctl: with unsupport IOType
[CM]: CRITICAL - Surface2DSanityCheck:116: Error: Invalid surface width.
[CM]: CRITICAL - CreateSurface2D:1006: Error: Surface 2D sanity check failure.
Load driver from ../../../iHD_drv_video.so.
INFO: Load driver success
INFO: Found init function __vaDriverInit_1_0 and CM entry point vaCmExtSendReqMsg
.INFO: Get driver DDI functions
drmIoctl: with unsupport IOType
[CM]: CRITICAL - Surface2DSanityCheck:116: Error: Invalid surface width.
[CM]: CRITICAL - CreateSurface2D:1006: Error: Surface 2D sanity check failure.
Load driver from ../../../iHD_drv_video.so.
INFO: Load driver success
INFO: Found init function __vaDriverInit_1_0 and CM entry point vaCmExtSendReqMsg
.INFO: Get driver DDI functions
drmIoctl: with unsupport IOType
[CM]: CRITICAL - Surface2DSanityCheck:116: Error: Invalid surface width.
[CM]: CRITICAL - CreateSurface2D:1006: Error: Surface 2D sanity check failure.
Load driver from ../../../iHD_drv_video.so.
INFO: Load driver success
INFO: Found init function __vaDriverInit_1_0 and CM entry point vaCmExtSendReqMsg
.INFO: Get driver DDI functions
drmIoctl: with unsupport IOType
[CM]: CRITICAL - Surface2DSanityCheck:116: Error: Invalid surface width.
[CM]: CRITICAL - CreateSurface2D:1006: Error: Surface 2D sanity check failure.
Load driver from ../../../iHD_drv_video.so.
INFO: Load driver success
INFO: Found init function __vaDriverInit_1_0 and CM entry point vaCmExtSendReqMsg
.INFO: Get driver DDI functions
drmIoctl: with unsupport IOType
[CM]: CRITICAL - Surface2DSanityCheck:116: Error: Invalid surface width.
[CM]: CRITICAL - CreateSurface2D:1006: Error: Surface 2D sanity check failure.
Load driver from ../../../iHD_drv_video.so.
INFO: Load driver success
INFO: Found init function __vaDriverInit_1_0 and CM entry point vaCmExtSendReqMsg
.INFO: Get driver DDI functions
drmIoctl: with unsupport IOType
[CM]: CRITICAL - Surface2DSanityCheck:116: Error: Invalid surface width.
[CM]: CRITICAL - CreateSurface2D:1006: Error: Surface 2D sanity check failure.
Load driver from ../../../iHD_drv_video.so.
INFO: Load driver success
INFO: Found init function __vaDriverInit_1_0 and CM entry point vaCmExtSendReqMsg
.INFO: Get driver DDI functions
drmIoctl: with unsupport IOType
[CM]: CRITICAL - Surface2DSanityCheck:116: Error: Invalid surface width.
[CM]: CRITICAL - CreateSurface2D:1006: Error: Surface 2D sanity check failure.
Load driver from ../../../iHD_drv_video.so.
INFO: Load driver success
INFO: Found init function __vaDriverInit_1_0 and CM entry point vaCmExtSendReqMsg
.INFO: Get driver DDI functions
drmIoctl: with unsupport IOType
[CM]: CRITICAL - Surface2DSanityCheck:122: Error: Invalid surface height.
[CM]: CRITICAL - CreateSurface2D:1006: Error: Surface 2D sanity check failure.
Load driver from ../../../iHD_drv_video.so.
INFO: Load driver success
INFO: Found init function __vaDriverInit_1_0 and CM entry point vaCmExtSendReqMsg
.INFO: Get driver DDI functions
drmIoctl: with unsupport IOType
[CM]: CRITICAL - Surface2DSanityCheck:122: Error: Invalid surface height.
[CM]: CRITICAL - CreateSurface2D:1006: Error: Surface 2D sanity check failure.
Load driver from ../../../iHD_drv_video.so.
INFO: Load driver success
INFO: Found init function __vaDriverInit_1_0 and CM entry point vaCmExtSendReqMsg
.INFO: Get driver DDI functions
drmIoctl: with unsupport IOType
[CM]: CRITICAL - Surface2DSanityCheck:122: Error: Invalid surface height.
[CM]: CRITICAL - CreateSurface2D:1006: Error: Surface 2D sanity check failure.
Load driver from ../../../iHD_drv_video.so.
INFO: Load driver success
INFO: Found init function __vaDriverInit_1_0 and CM entry point vaCmExtSendReqMsg
.INFO: Get driver DDI functions
drmIoctl: with unsupport IOType
[CM]: CRITICAL - Surface2DSanityCheck:122: Error: Invalid surface height.
[CM]: CRITICAL - CreateSurface2D:1006: Error: Surface 2D sanity check failure.
Load driver from ../../../iHD_drv_video.so.
INFO: Load driver success
INFO: Found init function __vaDriverInit_1_0 and CM entry point vaCmExtSendReqMsg
.INFO: Get driver DDI functions
drmIoctl: with unsupport IOType
[CM]: CRITICAL - Surface2DSanityCheck:122: Error: Invalid surface height.
[CM]: CRITICAL - CreateSurface2D:1006: Error: Surface 2D sanity check failure.
Load driver from ../../../iHD_drv_video.so.
INFO: Load driver success
INFO: Found init function __vaDriverInit_1_0 and CM entry point vaCmExtSendReqMsg
.INFO: Get driver DDI functions
drmIoctl: with unsupport IOType
[CM]: CRITICAL - Surface2DSanityCheck:122: Error: Invalid surface height.
[CM]: CRITICAL - CreateSurface2D:1006: Error: Surface 2D sanity check failure.
Load driver from ../../../iHD_drv_video.so.
INFO: Load driver success
INFO: Found init function __vaDriverInit_1_0 and CM entry point vaCmExtSendReqMsg
.INFO: Get driver DDI functions
drmIoctl: with unsupport IOType
[CM]: CRITICAL - Surface2DSanityCheck:122: Error: Invalid surface height.
[CM]: CRITICAL - CreateSurface2D:1006: Error: Surface 2D sanity check failure.
Load driver from ../../../iHD_drv_video.so.
INFO: Load driver success
INFO: Found init function __vaDriverInit_1_0 and CM entry point vaCmExtSendReqMsg
.INFO: Get driver DDI functions
drmIoctl: with unsupport IOType
[CM]: CRITICAL - Surface2DSanityCheck:122: Error: Invalid surface height.
[CM]: CRITICAL - CreateSurface2D:1006: Error: Surface 2D sanity check failure.
[ OK ] Surface2DTest.MultipleSizes (133 ms)
[ RUN ] Surface2DTest.ReadWrit

Incorrect EU count is used on some SKU with one EU disabled.

The driver will try to query the EU_count/sub_slicecount by using drm_ioctl. But as no slice_count is queried, it uses the below code to update the eu_count/sub_slicecount based on device_id.
>sysInfo->SliceCount = devInfo->SliceCount;
sysInfo->SubSliceCount = devInfo->SubSliceCount;
sysInfo->EUCount = devInfo->EUCount;

See table and notes in https://01.org/sites/default/files/documentation/intel-gfx-prm-osrc-skl-vol04-configurations.pdf - "[a] Particular SKUs produced by Intel may have one EU disabled."
So the EUCount in driver is incorrect on the particular SKU.

Compilation fails with missing defines

It looks like the typdefs such as FALSE, TRUE, PVOID,.. are not accessible from the files that require it.
For instance:

In file included from /workspace/dev/qsv/git/media-driver/media_driver/agnostic/common/os/mos_os.h:34:0,
from /workspace/dev/qsv/git/media-driver/media_driver/agnostic/common/codec/hal/codechal_common.h:35,
from /workspace/dev/qsv/git/media-driver/media_driver/agnostic/common/codec/hal/codechal.h:29,
from /workspace/dev/qsv/git/media-driver/media_driver/agnostic/common/codec/hal/codechal_decoder.h:31,
from /workspace/dev/qsv/git/media-driver/media_driver/agnostic/common/codec/hal/codechal_decode_downsampling.cpp:27:
/workspace/dev/qsv/git/media-driver/media_driver/agnostic/common/codec/hal/codechal_decode_downsampling.cpp: In member function 'bool FieldScalingInterface::IsFieldScalingSupported(CODECHAL_DECODE_PROCESSING_PARAMS*)':
/workspace/dev/qsv/git/media-driver/media_driver/agnostic/common/os/mos_defs.h:271:78: error: 'TRUE' was not declared in this scope
#define MOS_WITHIN_RANGE(_x, _min, _max) (((_x >= _min) && (_x <= _max)) ? (TRUE) : (FALSE))
^
/workspace/dev/qsv/git/media-driver/media_driver/agnostic/common/codec/hal/codechal_decode_downsampling.cpp:523:10: note: in expansion of macro 'MOS_WITHIN_RANGE'
if (!MOS_WITHIN_RANGE(srcSurface->dwWidth, m_minInputWidth, m_maxInputWidth) ||
^
/workspace/dev/qsv/git/media-driver/media_driver/agnostic/common/os/mos_defs.h:271:87: error: 'FALSE' was not declared in this scope
#define MOS_WITHIN_RANGE(_x, _min, _max) (((_x >= _min) && (_x <= _max)) ? (TRUE) : (FALSE))
^

Did i miss something ?

Thanks

[DDI] m_encMax4KWidth naming

m_encMax4KWidth is set as ENCODE_4K_MAX_PIC_WIDTH, but what if we check 8K in the future, in that sense the naming is not good. This applies to Height check as well.

[DDI] unclear comment

Line 356, Line 419 of media_driver/linux/common/ddi/media_libva_caps.cpp. Would it be better to make it be more specific about "currently" and "at present"? Thanks.

vaQueryConfigAttributes should not check input value of num_attribs

num_attribs is an "out" only parameter for vaQueryConfigAttributes and therefore implementations should not make any assumptions of its input value when passed (other than it's not NULL).

DdiMedia_QueryConfigAttributes() checks the input value of num_attribs but shouldn't since user might have not explicitly initialized its value (therefore, it could be any arbitrary value to start with). The only contract with users is that its value is set appropriately by the implementation upon returning.

DDI_CHK_LESS(*num_attribs, VAConfigAttribTypeMax, "Invalid attribute number", VA_STATUS_ERROR_INVALID_PARAMETER);

[gstreamer-vaapi-master][iHD_SKL] [AVC_decode] "h264parse0: Internal data stream error" error message occurs during run h264 decoding cases with iHD driver on SKL

Test Env:

Platform: SKL
Arch: x86_64
Kernel: 4.12.0-rc2
libva: master branch df544cd5a31e54d4cbd33a391795a8747ddaf789
repo: https://github.com/01org/libva.git
media_driver: master branch 81796c8
repo: https://github.com/intel/media-driver
gmmlib: repo: https://github.com/intel/gmmlib
gst-vaapi: master branch b0d41c5db8c29b3df2a5b23d3da55141d701b992

Reproduce Steps:

  1. build env as above lists or according to wiki https://github.com/intel/media-driver
  2. take one case for example, run command
    gst-launch-1.0 -q filesrc location=/media//h264/CAPCM1_Sand_E.264 ! h264parse ! vaapih264dec ! vaapipostproc format=i420 ! checksumsink2 frame-checksum=FALSE file-checksum=TRUE plane-checksum=FALSE
  3. error info. as below
    0:00:00.041966159 2891 0x1520e30 ERROR vaapivideomemory gstvaapivideomemory.c:278:map_vaapi_memory: failed to make image current
    0:00:00.041992987 2891 0x1520e30 ERROR default video-frame.c:161:gst_video_frame_map_id: failed to map video frame plane 0
    0:00:00.042020944 2891 0x1520e30 ERROR checksumsink2 gstchecksumsink.c:381:gst_cksum_image_sink_render: failed to map frame
    ERROR: from element /GstPipeline:pipeline0/GstH264Parse:h264parse0: Internal data stream error.
    Additional debug info:
    gstbaseparse.c(3597): gst_base_parse_loop (): /GstPipeline:pipeline0/GstH264Parse:h264parse0:
    streaming stopped, reason error (-5)
    d41d8cd98f00b204e9800998ecf8427e

Consider git submodule for gmmlib dependency

Since commit intel/gmmlib@aa11d6ada523 , the media-driver does not compile (see intel/gmmlib#3) on current media-driver master (4d89071).

If gmmlib was included as a git submodule in media-driver, then the specific commit can be controlled more precisely and prevent recent changes in gmmlib from breaking the media-driver when not warranted. This would also allow media-driver to remove all the cmake scripts that it currently duplicates from gmmlib to simplify maintainability (e.g. keeping them in sync is currently a chore).

[gstreamer-vaapi-master][iHD_SKL] [VP8_encode] Feature vp8_encode can not be enabled during compile gst-vaapi with iHD driver on SKL

Test Env:

Platform: SKL
Arch: x86_64
Kernel: 4.12.0-rc2
libva: master branch df544cd5a31e54d4cbd33a391795a8747ddaf789
repo: https://github.com/01org/libva.git
media_driver: master branch 81796c8
repo: https://github.com/intel/media-driver
gmmlib: repo: https://github.com/intel/gmmlib
gst-vaapi: master branch b0d41c5db8c29b3df2a5b23d3da55141d701b992

Reproduce Steps:

  1. build env as above lists or according to wiki https://github.com/intel/media-driver
  2. compile gst-vaapi component with command "./autogen.sh --disable-glx --prefix=/opt/yami/gstreamer10/ --enable-encoders" successfully
  3. export GST_VAAPI_ALL_DRIVERS=1 due to vpg driver not in whitelist
  4. run command "gst-inspect-1.0 vaapi", finding that vp8 encode does not be enabled

gst-inspect-1.0 vaapi
Plugin Details:
Name vaapi
Description VA-API based elements
Filename /opt/yami/gstreamer10/lib/gstreamer-1.0/libgstvaapi.so
Version 1.13.0.1
License LGPL
Source module gstreamer-vaapi
Source release date 2017-12-13 18:48 (UTC)
Binary package gstreamer-vaapi
Origin URL http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer

vaapijpegdec: VA-API JPEG decoder
vaapimpeg2dec: VA-API MPEG2 decoder
vaapih264dec: VA-API H264 decoder
vaapivc1dec: VA-API VC1 decoder
vaapivp8dec: VA-API VP8 decoder
vaapih265dec: VA-API H265 decoder
vaapipostproc: VA-API video postprocessing
vaapidecodebin: VA-API Decode Bin
vaapisink: VA-API sink
vaapimpeg2enc: VA-API MPEG-2 encoder
vaapih265enc: VA-API H265 encoder
vaapijpegenc: VA-API JPEG encoder
vaapih264enc: VA-API H264 encoder
vaapih264feienc: VA-API H264 FEI Advanced encoder (Experimental)

14 features:
+-- 14 elements

[DDI] VAEntrypointStats should not be bounded to AVC FEI

VAEntrypointStats is generic, and can be used for both AVC and HEVC FEI, and may later for other encoders. It's not good coding behavior to bound VAEntrypointStats to AVC FEI in MediaLibvaCaps::GetEncodeCodecMode.

Also, if in regular calling sequence that DDI decode or encode key is already parsed from input parameters such as profile and vaentrypoint, suggest use the key to map to CODECHAL keys defined in lower layer (i.e., CODECHAL) instead of parsing the same profile and vaentrypoint again.

[SKL][MPEG2ENC] MPEG2ENC lead to GPU hang in SKL

in SKL, mpeg2enc will hang when setting macro block address like this:

vslice->macroblock_address = priv->mb_width * slice->index;
vslice->num_macroblocks = priv->mb_width;

but when change the code as: vslice->macroblock_address =slice->index;, it's working, I think media-driver doesn't follow VA-API Spec for uint32_t macroblock_address in VAEncSliceParameterBufferMPEG2. (https://github.com/01org/libva/blob/c88000b75602ded8ec24e6ea032f4841a4437049/va/va_enc_mpeg2.h#L278)

[gstreamer-vaapi-master][iHD_SKL]"vaapisink0: Internal error: could not render surface" error message occurs when run command using option "vaapisink" to show on screen with iHD driver on SKL

Test Env:

Platform: SKL
Arch: x86_64
Kernel: 4.12.0-rc2
libva: master branch df544cd5a31e54d4cbd33a391795a8747ddaf789
repo: https://github.com/01org/libva.git
media_driver: master branch 81796c8
repo: https://github.com/intel/media-driver
gmmlib: repo: https://github.com/intel/gmmlib
gst-vaapi: master branch b0d41c5db8c29b3df2a5b23d3da55141d701b992

Reproduce Steps:

  1. build env as above lists or according to wiki https://github.com/intel/media-driver
  2. take one case for example, run command
    gst-launch-1.0 filesrc location=/media/h264/freh10.264 ! h264parse ! vaapih264dec ! vaapipostproc width=336 ! vaapipostproc skin-tone-enhancement=TRUE ! vaapisink
  3. error info. as below
    ** (gst-launch-1.0:21742): WARNING **: gstvaapidisplay.c:990: invalid property id 3 for "hue" of type 'GParamFloat' in 'GstVaapiDisplayX11'

** (gst-launch-1.0:21742): WARNING **: gstvaapidisplay.c:990: invalid property id 4 for "saturation" of type 'GParamFloat' in 'GstVaapiDisplayX11'

** (gst-launch-1.0:21742): WARNING **: gstvaapidisplay.c:990: invalid property id 5 for "brightness" of type 'GParamFloat' in 'GstVaapiDisplayX11'

** (gst-launch-1.0:21742): WARNING **: gstvaapidisplay.c:990: invalid property id 6 for "contrast" of type 'GParamFloat' in 'GstVaapiDisplayX11'
ERROR: from element /GstPipeline:pipeline0/GstVaapiSink:vaapisink0: Internal error: could not render surface

Fail to build cmrt if libva is installed at custom location

Try to build media stack as follows:

export CUSTOM_DIR=/path/to/custom/location  # not /usr or /usr/inlcude
cd libva
./autogen.sh --prefix=$CUSTOM_DIR
make && make install

export PKG_CONFIG_PATH=$CUSTOM_DIR/lib/pkgconfig
mkdir -p build && cd build
cmake ../media-driver \
  -DMEDIA_VERSION="2.0.0" \
  -DBUILD_ALONG_WITH_CMRTLIB=1 \
  -DBS_DIR_GMMLIB=`pwd`/../gmmlib/Source/GmmLib/ \
  -DBS_DIR_COMMON=`pwd`/../gmmlib/Source/Common/ \
  -DBS_DIR_INC=`pwd`/../gmmlib/Source/inc/ \
  -DBS_DIR_MEDIA=`pwd`/../media-driver \
  -DCMAKE_INSTALL_PREFIX=$CUSTOM_DIR \
  -DCMAKE_INSTALL_LIBDIR=$CUSTOM_DIR/lib \
  -DINSTALL_DRIVER_SYSCONF=OFF \
  -DLIBVA_DRIVERS_PATH=$CUSTOM_DIR/dri
make

You will see the following error:
Scanning dependencies of target igfxcmrt

make[2]: Leaving directory `/data/dvrogozh/git/github/build'
make[2]: Entering directory `/data/dvrogozh/git/github/build'
[  0%] Building CXX object cmrtlib/linux/CMakeFiles/igfxcmrt.dir/__/agnostic/share/cm_printf_host.cpp.o
[  1%] Building CXX object cmrtlib/linux/CMakeFiles/igfxcmrt.dir/__/agnostic/share/cm_rt_helpers.cpp.o
[  1%] Building CXX object cmrtlib/linux/CMakeFiles/igfxcmrt.dir/__/agnostic/share/cm_avs_state_msg_ex.cpp.o
[  1%] Building CXX object cmrtlib/linux/CMakeFiles/igfxcmrt.dir/__/agnostic/hardware/cm_device.cpp.o
[  1%] Building CXX object cmrtlib/linux/CMakeFiles/igfxcmrt.dir/__/agnostic/hardware/cm_device_export.cpp.o
[  2%] Building CXX object cmrtlib/linux/CMakeFiles/igfxcmrt.dir/__/agnostic/hardware/cm_surface_manager.cpp.o
[  2%] Building CXX object cmrtlib/linux/CMakeFiles/igfxcmrt.dir/__/agnostic/hardware/cm_timer.cpp.o
[  2%] Building CXX object cmrtlib/linux/CMakeFiles/igfxcmrt.dir/__/agnostic/hardware/cm_queue.cpp.o
[  2%] Building CXX object cmrtlib/linux/CMakeFiles/igfxcmrt.dir/__/agnostic/hardware/cm_perf_statistics.cpp.o
[  2%] Building CXX object cmrtlib/linux/CMakeFiles/igfxcmrt.dir/hardware/cm_device_os.cpp.o
[  3%] Building CXX object cmrtlib/linux/CMakeFiles/igfxcmrt.dir/hardware/cm_surface_manager_os.cpp.o
[  3%] Building CXX object cmrtlib/linux/CMakeFiles/igfxcmrt.dir/hardware/cm_device_export_os.cpp.o
[  3%] Building CXX object cmrtlib/linux/CMakeFiles/igfxcmrt.dir/hardware/cm_performance.cpp.o
[  3%] Building CXX object cmrtlib/linux/CMakeFiles/igfxcmrt.dir/hardware/cm_timer_os.cpp.o
[  4%] Linking CXX shared library igfxcmrt64.so
/usr/bin/ld: cannot find -lva
collect2: error: ld returned 1 exit status
make[2]: *** [cmrtlib/linux/igfxcmrt64.so] Error 1
make[2]: Leaving directory `/data/dvrogozh/git/github/build'
make[1]: *** [cmrtlib/linux/CMakeFiles/igfxcmrt.dir/all] Error 2
make[1]: Leaving directory `/data/dvrogozh/git/github/build'
make: *** [all] Error 2
make: Leaving directory `/data/dvrogozh/git/github/build'

[gstreamer-vaapi-master][iHD_SKL] [VC1_decode] "filesrc0: Internal data stream error" error message occurs during run VC1 decode cases with iHD driver on SKL

Test Env:

Platform: SKL
Arch: x86_64
Kernel: 4.12.0-rc2
libva: master branch df544cd5a31e54d4cbd33a391795a8747ddaf789
repo: https://github.com/01org/libva.git
media_driver: master branch 81796c8
repo: https://github.com/intel/media-driver
gmmlib: repo: https://github.com/intel/gmmlib
gst-vaapi: master branch b0d41c5db8c29b3df2a5b23d3da55141d701b992

Reproduce Steps:

  1. build env as above lists or according to wiki https://github.com/intel/media-driver
  2. take one case for example, run command
    gst-launch-1.0 -q filesrc location=/media//yami_vc1/SA10086.vc1 '!' 'video/x-wmv,profile=(string)advanced,' width=720, height=576, framerate=14/1 '!' vaapivc1dec '!' vaapipostproc format=i420 '!' checksumsink2 frame-checksum=FALSE file-checksum=TRUE plane-checksum=FALSE
  3. error info. as below
    0:00:00.045216413 4074 0x189acf0 ERROR vaapivideomemory gstvaapivideomemory.c:278:map_vaapi_memory: failed to make image current
    0:00:00.045252735 4074 0x189acf0 ERROR default video-frame.c:161:gst_video_frame_map_id: failed to map video frame plane 0
    0:00:00.045320055 4074 0x189acf0 ERROR checksumsink2 gstchecksumsink.c:381:gst_cksum_image_sink_render: failed to map frame
    ERROR: from element /GstPipeline:pipeline0/GstFileSrc:filesrc0: Internal data stream error.
    Additional debug info:
    gstbasesrc.c(2939): gst_base_src_loop (): /GstPipeline:pipeline0/GstFileSrc:filesrc0:
    streaming stopped, reason error (-5)
    d41d8cd98f00b204e9800998ecf8427e

GCC 6.x+ compilation errors (-Werror=deprecated-declarations)

Compilation fails with GCC 6.x+ since,

commit fa0d40ee6d3d7ec34478da166b2740eaf9b7c0ce
Author: xuan_(oliver)__sang <[email protected]>
Date:   Sun Jan 21 17:38:35 2018 +0800

    treat warning as error for Linux build(CL#732090)
    
    Change-Id: I24c93e7d2cf2d800d9ad67a82dd2c4adf698c1fc

The compilation errors are:

[  9%] Building CXX object media_driver/CMakeFiles/iHD_drv_video.dir/linux/common/codec/ddi/media_ddi_encode_avc.cpp.o
/home/uaeoff/Work/workspace/media/build/intel-media-driver/media_driver/linux/common/codec/ddi/media_ddi_encode_avc.cpp: In member function ‘CODEC_AVC_PROFILE_IDC DdiEncodeAvc::GetAVCProfileFromVAProfile()’:
/home/uaeoff/Work/workspace/media/build/intel-media-driver/media_driver/linux/common/codec/ddi/media_ddi_encode_avc.cpp:141:10: error: ‘VAProfileH264Baseline’ is deprecated [-Werror=deprecated-declarations]
     case VAProfileH264Baseline:
          ^~~~~~~~~~~~~~~~~~~~~
In file included from /home/uaeoff/Work/workspace/media/build/intel-media-driver/media_driver/linux/common/ddi/media_libva.h:30:0,
                 from /home/uaeoff/Work/workspace/media/build/intel-media-driver/media_driver/linux/common/codec/ddi/media_ddi_encode_avc.cpp:27:
/home/uaeoff/Work/workspace/media/install/include/va/va.h:359:5: note: declared here
     VAProfileH264Baseline va_deprecated_enum = 5,
     ^~~~~~~~~~~~~~~~~~~~~
/home/uaeoff/Work/workspace/media/build/intel-media-driver/media_driver/linux/common/codec/ddi/media_ddi_encode_avc.cpp: In member function ‘VAStatus DdiEncodeAvc::ParsePackedHeaderParams(void*)’:
/home/uaeoff/Work/workspace/media/build/intel-media-driver/media_driver/linux/common/codec/ddi/media_ddi_encode_avc.cpp:1655:47: error: ‘VAEncPackedHeaderH264_SEI’ is deprecated [-Werror=deprecated-declarations]
     else if (encPackedHeaderParamBuf->type == VAEncPackedHeaderH264_SEI)
                                               ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/uaeoff/Work/workspace/media/install/include/va/va.h:4181:0,
                 from /home/uaeoff/Work/workspace/media/build/intel-media-driver/media_driver/linux/common/ddi/media_libva.h:30,
                 from /home/uaeoff/Work/workspace/media/build/intel-media-driver/media_driver/linux/common/codec/ddi/media_ddi_encode_avc.cpp:27:
/home/uaeoff/Work/workspace/media/install/include/va/va_enc_h264.h:125:5: note: declared here
     VAEncPackedHeaderH264_SEI va_deprecated_enum  = (0x80000000 | 1),
     ^~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[2]: *** [media_driver/CMakeFiles/iHD_drv_video.dir/build.make:7743: media_driver/CMakeFiles/iHD_drv_video.dir/linux/common/codec/ddi/media_ddi_encode_avc.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:164: media_driver/CMakeFiles/iHD_drv_video.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

The deprecations are in libva and have been deprecated since libva 2.0.

GCC 7.x is the default compiler on Ubuntu 17.10 (artful) and Fedora 26 and 27. GCC 6.x is default on Ubuntu 17.04 (zesty).

[gstreamer-vaapi-master][iHD_SKL] [MPEG2_decode] "mpegvparse0: Internal data stream error" error message occurs during run mpeg2 decode cases with iHD driver on SKL

Test Env:

Platform: SKL
Arch: x86_64
Kernel: 4.12.0-rc2
libva: master branch df544cd5a31e54d4cbd33a391795a8747ddaf789
repo: https://github.com/01org/libva.git
media_driver: master branch 81796c8
repo: https://github.com/intel/media-driver
gmmlib: repo: https://github.com/intel/gmmlib
gst-vaapi: master branch b0d41c5db8c29b3df2a5b23d3da55141d701b992

Reproduce Steps:

  1. build env as above lists or according to wiki https://github.com/intel/media-driver
  2. take one case for example, run command
    gst-launch-1.0 -q filesrc location=/media//yami_mpeg2/sony-ct2.bits.mpeg2 '!' mpegvideoparse '!' vaapimpeg2dec '!' vaapipostproc format=i420 '!' checksumsink2 frame-checksum=FALSE file-checksum=TRUE plane-checksum=FALSE
  3. error info. as below
    0:00:00.041989190 3619 0x1336230 ERROR vaapidecode gstvaapidecode.c:716:gst_vaapidecode_handle_frame: decode error -1
    0:00:00.052408344 3619 0x1336230 ERROR vaapivideomemory gstvaapivideomemory.c:278:map_vaapi_memory: failed to make image current
    0:00:00.052434276 3619 0x1336230 ERROR default video-frame.c:161:gst_video_frame_map_id: failed to map video frame plane 0
    0:00:00.052461787 3619 0x1336230 ERROR checksumsink2 gstchecksumsink.c:381:gst_cksum_image_sink_render: failed to map frame
    ERROR: from element /GstPipeline:pipeline0/GstMpegvParse:mpegvparse0: Internal data stream error.
    Additional debug info:
    gstbaseparse.c(3597): gst_base_parse_loop (): /GstPipeline:pipeline0/GstMpegvParse:mpegvparse0:
    streaming stopped, reason error (-5)
    d41d8cd98f00b204e9800998ecf8427e

[gstreamer-vaapi-master][iHD_SKL] [HEVC_decode] "h265parse0: Internal data stream error" error message occurs during run h265 decoding cases with iHD driver on SKL

Test Env:

Platform: SKL
Arch: x86_64
Kernel: 4.12.0-rc2
libva: master branch df544cd5a31e54d4cbd33a391795a8747ddaf789
repo: https://github.com/01org/libva.git
media_driver: master branch 81796c8
repo: https://github.com/intel/media-driver
gmmlib: repo: https://github.com/intel/gmmlib
gst-vaapi: master branch b0d41c5db8c29b3df2a5b23d3da55141d701b992

Reproduce Steps:

  1. build env as above lists or according to wiki https://github.com/intel/media-driver
  2. take one case for example, run command
    gst-launch-1.0 -q filesrc location=/media/HEVC/MSFT//MSHDRef_Difficult_Edge_06_720x576i25f_lowdelay_P_main.bin ! h265parse ! vaapih265dec ! vaapipostproc format=i420 ! checksumsink2 frame-checksum=FALSE file-checksum=TRUE plane-checksum=FALSE
  3. error info. as below
    0:00:00.039642921 4763 0x208c230 ERROR vaapivideomemory gstvaapivideomemory.c:278:map_vaapi_memory: failed to make image current
    0:00:00.039683951 4763 0x208c230 ERROR default video-frame.c:161:gst_video_frame_map_id: failed to map video frame plane 0
    0:00:00.039736491 4763 0x208c230 ERROR checksumsink2 gstchecksumsink.c:381:gst_cksum_image_sink_render: failed to map frame
    ERROR: from element /GstPipeline:pipeline0/GstH265Parse:h265parse0: Internal data stream error.
    Additional debug info:
    gstbaseparse.c(3597): gst_base_parse_loop (): /GstPipeline:pipeline0/GstH265Parse:h265parse0:
    streaming stopped, reason error (-5)
    d41d8cd98f00b204e9800998ecf8427e

[gstreamer-vaapi-master][iHD_SKL] [VP8_decode] "ivfparse0: Internal data stream error" error message occurs during run VP8 decoding cases with iHD driver on SKL

Test Env:

Platform: SKL
Arch: x86_64
Kernel: 4.12.0-rc2
libva: master branch df544cd5a31e54d4cbd33a391795a8747ddaf789
repo: https://github.com/01org/libva.git
media_driver: master branch 81796c8
repo: https://github.com/intel/media-driver
gmmlib: repo: https://github.com/intel/gmmlib
gst-vaapi: master branch b0d41c5db8c29b3df2a5b23d3da55141d701b992

Reproduce Steps:

  1. build env as above lists or according to wiki https://github.com/intel/media-driver
  2. take one case for example, run command
    gst-launch-1.0 -q filesrc location=/media//vp8/vp80-00-comprehensive-002.ivf '!' ivfparse '!' vaapivp8dec '!' vaapipostproc format=i420 '!' checksumsink2 frame-checksum=FALSE file-checksum=TRUE plane-checksum=FALSE
  3. error info. as below
    0:00:00.090096521 4162 0x1d17230 ERROR vaapivideomemory gstvaapivideomemory.c:278:map_vaapi_memory: failed to make image current
    0:00:00.090122526 4162 0x1d17230 ERROR default video-frame.c:161:gst_video_frame_map_id: failed to map video frame plane 0
    0:00:00.090148982 4162 0x1d17230 ERROR checksumsink2 gstchecksumsink.c:381:gst_cksum_image_sink_render: failed to map frame
    ERROR: from element /GstPipeline:pipeline0/GstIvfParse:ivfparse0: Internal data stream error.
    Additional debug info:
    gstbaseparse.c(3597): gst_base_parse_loop (): /GstPipeline:pipeline0/GstIvfParse:ivfparse0:
    streaming stopped, reason error (-5)
    d41d8cd98f00b204e9800998ecf8427e

MJPEG ENC return a lot of attributes, but the iHD didn't support them actually

For MJPEG ENC, iHD return a lot attributes when call vaGetConfigAttributes(), but the driver can't support them, I think if the driver can't support the attributes, need to return value VA_ATTRIB_NOT_SUPPORTED, now iHD didn't follow this action.

(gdb) p *attributeList
$14 = std::map with 21 elements = {[VAConfigAttribRTFormat] = 196639, [VAConfigAttribEncryption] = 2147483648, [VAConfigAttribRateControl] = 150, [VAConfigAttribEncPackedHeaders] = 2147483648,
[VAConfigAttribEncInterlaced] = 0, [VAConfigAttribEncMaxRefFrames] = 65537, [VAConfigAttribEncMaxSlices] = 0, [VAConfigAttribEncSliceStructure] = 2, [VAConfigAttribMaxPictureWidth] = 16384,
[VAConfigAttribMaxPictureHeight] = 16384, [VAConfigAttribEncJPEG] = 53440, [VAConfigAttribEncQualityRange] = 1, [VAConfigAttribEncQuantization] = 0, [VAConfigAttribEncIntraRefresh] = 0,
[VAConfigAttribEncSkipFrame] = 1, [VAConfigAttribEncROI] = 0, [VAConfigAttribProcessingRate] = 1, [VAConfigAttribEncDirtyRect] = 4, [VAConfigAttribEncParallelRateControl] = 1,
[VAConfigAttribFEIMVPredictors] = 0, [VAConfigAttribCustomRoundingControl] = 0}

And I think VAStatus MediaLibvaCaps::CreateEncAttributes() need more strict check for other CODEC

[RFC] is it support KBL/GLK/CFL in media-driver now?

Now the media-driver support BDW (Broadwell)/SKL (Skylake)/BXT (Broxton) / APL (Apollolake)/CNL (Cannonlake), is it will support KBL/GLK/CFL? Tks,

After grep the code with cmd as follow:

barry@barry-HP-ENVY-Notebook:~/Sources/umd_dev/media-driver$ grep "DeviceInfoFactory" * -rn

get the out put as follow:
media_driver/linux/gen10/ddi/media_sysinfo_g10.cpp:33://extern template class DeviceInfoFactory;
media_driver/linux/gen10/ddi/media_sysinfo_g10.cpp:34:typedef DeviceInfoFactory base_fact;
media_driver/linux/gen10/ddi/media_sysinfo_g10.cpp:261:static bool cnlDevice5a4a = DeviceInfoFactory::
media_driver/linux/gen10/ddi/media_sysinfo_g10.cpp:264:static bool cnlDevice5a42 = DeviceInfoFactory::
media_driver/linux/gen10/ddi/media_sysinfo_g10.cpp:267:static bool cnlDevice5a41 = DeviceInfoFactory::
media_driver/linux/gen10/ddi/media_sysinfo_g10.cpp:270:static bool cnlDevice5a49 = DeviceInfoFactory::
media_driver/linux/gen10/ddi/media_sysinfo_g10.cpp:273:static bool cnlDevice5a44 = DeviceInfoFactory::
media_driver/linux/gen10/ddi/media_sysinfo_g10.cpp:276:static bool cnlDevice5a59 = DeviceInfoFactory::
media_driver/linux/gen10/ddi/media_sysinfo_g10.cpp:279:static bool cnlDevice5a5a = DeviceInfoFactory::
media_driver/linux/gen10/ddi/media_sysinfo_g10.cpp:282:static bool cnlDevice5a5c = DeviceInfoFactory::
media_driver/linux/gen10/ddi/media_sysinfo_g10.cpp:285:static bool cnlDevice5a50 = DeviceInfoFactory::
media_driver/linux/gen10/ddi/media_sysinfo_g10.cpp:288:static bool cnlDevice5a51 = DeviceInfoFactory::
media_driver/linux/gen10/ddi/media_sysinfo_g10.cpp:291:static bool cnlDevice5a52 = DeviceInfoFactory::
media_driver/linux/gen10/ddi/media_sysinfo_g10.cpp:294:static bool cnlDevice5a54 = DeviceInfoFactory::
media_driver/linux/gen10/ddi/media_sku_wa_g10.cpp:34://extern template class DeviceInfoFactory;
media_driver/linux/gen8/ddi/media_sysinfo_g8.cpp:229://extern template class DeviceInfoFactory;
media_driver/linux/gen8/ddi/media_sysinfo_g8.cpp:230:typedef DeviceInfoFactory base_fact;
media_driver/linux/gen8/ddi/media_sysinfo_g8.cpp:232:static bool bdwDevice1602 = DeviceInfoFactory::
media_driver/linux/gen8/ddi/media_sysinfo_g8.cpp:235:static bool bdwDevice1606 = DeviceInfoFactory::
media_driver/linux/gen8/ddi/media_sysinfo_g8.cpp:238:static bool bdwDevice160a = DeviceInfoFactory::
media_driver/linux/gen8/ddi/media_sysinfo_g8.cpp:241:static bool bdwDevice160d = DeviceInfoFactory::
media_driver/linux/gen8/ddi/media_sysinfo_g8.cpp:244:static bool bdwDevice160e = DeviceInfoFactory::
media_driver/linux/gen8/ddi/media_sysinfo_g8.cpp:247:static bool bdwDevice160b = DeviceInfoFactory::
media_driver/linux/gen8/ddi/media_sysinfo_g8.cpp:250:static bool bdwDevice1612 = DeviceInfoFactory::
media_driver/linux/gen8/ddi/media_sysinfo_g8.cpp:253:static bool bdwDevice1616 = DeviceInfoFactory::
media_driver/linux/gen8/ddi/media_sysinfo_g8.cpp:256:static bool bdwDevice161a = DeviceInfoFactory::
media_driver/linux/gen8/ddi/media_sysinfo_g8.cpp:259:static bool bdwDevice161d = DeviceInfoFactory::
media_driver/linux/gen8/ddi/media_sysinfo_g8.cpp:262:static bool bdwDevice161e = DeviceInfoFactory::
media_driver/linux/gen8/ddi/media_sysinfo_g8.cpp:265:static bool bdwDevice161b = DeviceInfoFactory::
media_driver/linux/gen8/ddi/media_sysinfo_g8.cpp:269:static bool bdwDevice1622 = DeviceInfoFactory::
media_driver/linux/gen8/ddi/media_sysinfo_g8.cpp:272:static bool bdwDevice1626 = DeviceInfoFactory::
media_driver/linux/gen8/ddi/media_sysinfo_g8.cpp:275:static bool bdwDevice162b = DeviceInfoFactory::
media_driver/linux/gen8/ddi/media_sysinfo_g8.cpp:278:static bool bdwDevice162a = DeviceInfoFactory::
media_driver/linux/gen8/ddi/media_sysinfo_g8.cpp:281:static bool bdwDevice162d = DeviceInfoFactory::
media_driver/linux/gen8/ddi/media_sysinfo_g8.cpp:284:static bool bdwDevice162e = DeviceInfoFactory::
media_driver/linux/gen8/ddi/media_sysinfo_g8.cpp:288:static bool bdwDevice163b = DeviceInfoFactory::
media_driver/linux/gen8/ddi/media_sku_wa_g8.cpp:32://extern template class DeviceInfoFactory;
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:33://extern template class DeviceInfoFactory;
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:34:typedef DeviceInfoFactory base_fact;
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:626:static bool sklDevice1902 = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:629:static bool sklDevice1906 = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:632:static bool sklDevice190a = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:635:static bool sklDevice190b = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:638:static bool sklDevice190e = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:641:static bool sklDevice1913 = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:644:static bool sklDevice1915 = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:647:static bool sklDevice1917 = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:650:static bool sklDevice1912 = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:653:static bool sklDevice1916 = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:656:static bool sklDevice191a = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:659:static bool sklDevice191b = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:662:static bool sklDevice191d = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:665:static bool sklDevice191e = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:668:static bool sklDevice1921 = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:672:static bool sklDevice1923 = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:675:static bool sklDevice192b = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:678:static bool sklDevice1926 = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:681:static bool sklDevice1927 = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:684:static bool sklDevice192d = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:688:static bool sklDevice192a = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:691:static bool sklDevice1932 = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:694:static bool sklDevice193a = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:697:static bool sklDevice193b = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:700:static bool sklDevice193d = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:704:static bool bxtDevice1a84 = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:707:static bool bxtDevice1a85 = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:710:static bool bxtDevice5a84 = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:713:static bool bxtDevice5a85 = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:716:static bool glkDevice3a84 = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:719:static bool glkDevice3a85 = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:722:static bool kblDevice5906 = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:725:static bool kblDevice5902 = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:728:static bool kblDevice5908 = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:731:static bool kblDevice590a = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:734:static bool kblDevice590b = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:737:static bool kblDevice590e = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:740:static bool kblDevice5913 = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:743:static bool kblDevice5915 = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:746:static bool kblDevice5916 = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:749:static bool kblDevice5917 = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:752:static bool kblDevice5912 = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:755:static bool kblDevice591e = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:758:static bool kblDevice591a = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:761:static bool kblDevice591b = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:764:static bool kblDevice591d = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:767:static bool kblDevice5921 = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:770:static bool kblDevice5923 = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:773:static bool kblDevice5926 = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:776:static bool kblDevice5927 = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:779:static bool kblDevice593b = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:782:static bool kblDevice5932 = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:785:static bool kblDevice592b = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:788:static bool kblDevice592a = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:791:static bool cflDevice3e93 = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:794:static bool cflDevice3e90 = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:797:static bool cflDevice3e92 = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:800:static bool cflDevice3e94 = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:803:static bool cflDevice3e91 = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:806:static bool cflDevice3e96 = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:809:static bool cflDevice3e9b = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:813:static bool cflDevice3ea5 = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:816:static bool cflDevice3ea6 = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:819:static bool cflDevice3ea7 = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sysinfo_g9.cpp:822:static bool cflDevice3ea8 = DeviceInfoFactory::
media_driver/linux/gen9/ddi/media_sku_wa_g9.cpp:32://extern template class DeviceInfoFactory;

Now can find CNL (GEN10), BDW(GEN8), SKL(GEN9), GLK(GEN9), KBL(GEN9), CFL(GEN9), BXT (GEN9), is it media-driver support CFL/GLK/KBL now?

[gstreamer-vaapi-master][iHD_SKL] [encode] "inner_rawvideoparse: Internal data stream error" error message occurs during run encoding cases for AVC/MPEG2/HEVC/JPEG with iHD driver on SKL

Test Env:

Platform: SKL
Arch: x86_64
Kernel: 4.12.0-rc2
libva: master branch df544cd5a31e54d4cbd33a391795a8747ddaf789
repo: https://github.com/01org/libva.git
media_driver: master branch 81796c8
repo: https://github.com/intel/media-driver
gmmlib: repo: https://github.com/intel/gmmlib
gst-vaapi: master branch b0d41c5db8c29b3df2a5b23d3da55141d701b992

Reproduce Steps:

  1. build env as above lists or according to wiki https://github.com/intel/media-driver
  2. take one case each test suite for example, run command
    Avc encode
    gst-launch-1.0 filesrc location=/media/encoderbitstreams//720p5994_parkrun_ter.yuv ! videoparse format=i420 width=1280 height=720 framerate=30 ! vaapih264enc rate-control=cqp init-qp=26 keyframe-period=1 num-slices=1 max-bframes=0 quality-level=1 ! video/x-h264,profile=main ! h264parse ! filesink location=./720p5994_parkrun_i420_profilemain_rc0_i_qp26_slice1_gop30_tu1_fps30.h264

Hevc encode
gst-launch-1.0 filesrc location=/media/encoderbitstreams//4K_2013_3840_2160_300frames.yuv ! videoparse format=i420 width=3840 height=2160 framerate=25 ! vaapih265enc rate-control=cqp init-qp=26 keyframe-period=30 num-slices=4 max-bframes=2 quality-level=4 ! video/x-265,profile=main ! h265parse ! filesink location=./4K_3840x2160_i420_profilemain_rc0_ipb_qp26_slice4_gop30_tu4_fps25.h265

Mpeg2 encode
gst-launch-1.0 filesrc location=/media/encoderbitstreams//720p5994_parkrun_ter.yuv ! videoparse format=i420 width=1280 height=720 framerate=30 ! vaapimpeg2enc rate-control=cqp quantizer=26 keyframe-period=1 max-bframes=0 quality-level=1 ! mpegvideoparse ! mpegtsmux ! filesink location=./720p5994_parkrun_i420_profilemain_rc0_i_qp26_slice1_gop29_tu1_fps30.mpg

Jpeg encode
gst-launch-1.0 filesrc location=/media/encoderbitstreams//MOBILE_352x288_30_orig_01.yuv '!' videoparse format=i420 width=704 height=576 '!' vaapijpegenc quality=20 '!' filesink location=MOBILE_352x288_30_orig_01.yuv.jpeg

  1. error info. as below
    0:00:00.021428060 21441 0x17eac00 ERROR vaapi gstvaapiencoder.c:435:gst_vaapi_encoder_put_frame: failed to encode frame (status = -1)
    0:00:00.021458995 21441 0x17eac00 ERROR vaapiencode gstvaapiencode.c:722:gst_vaapiencode_handle_frame: failed to encode frame 0 (status -1)
    ERROR: from element /GstPipeline:pipeline0/GstVideoParse:videoparse0/GstRawVideoParse:inner_rawvideoparse: Internal data stream error

HEVC ENC need to setting VA_RC_MB

User has to set VA_RC_MB when using VA_RC_CBR or VA_RC_VBR in HEVC ENC, but AVC encoding does not need to setting VA_RC_MB for CBR/VBR mode.

Provide support for cmake 2.8 and align cmake requirements across sources

Some Linux distributions, especially server distributions, still has older cmake versions than 3.5 by default. Cent OS 7.4 is an example:

# cmake --version
cmake version 2.8.12.2

Yocto is another example:

# cmake --version
cmake version 3.3.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).

Please, provide compatibility with older versions of cmake starting from 2.8 to extend Linux distributions coverage.

Also, please, align cmake version requirements across sources. As it stands now:

# fgrep -rsn cmake_minimum_required .
./Tools/MediaDriverTools/GenKrnBin/CMakeLists.txt:21:cmake_minimum_required(VERSION 2.6)
./Tools/MediaDriverTools/KernelBinToSource/CMakeLists.txt:21:cmake_minimum_required (VERSION 2.8)
./Tools/MediaDriverTools/KrnToHex_IGA/CMakeLists.txt:21:cmake_minimum_required(VERSION 2.6)
./cmrtlib/CMakeLists.txt:22:cmake_minimum_required(VERSION 2.8)
./cmrtlib/linux/CMakeLists.txt:21:cmake_minimum_required(VERSION 2.8)
./media_driver/CMakeLists.txt:22:cmake_minimum_required(VERSION 3.5)
./CMakeLists.txt:21:cmake_minimum_required(VERSION 3.5)

Mind that I have submitted similar request against gmmlib: intel/gmmlib#1

Don't hardcode install paths

Currently, various cmake install targets are installed into hardcoded paths that only follow Ubuntu's directory layout. This burdens developers and packagers on other Linux distros and also makes it impossible to override install destination/prefix. Often, developers prefer to isolate installs into custom locations for various reasons, too.

Instead of hardcoded paths, the install targets should use the GNU standard installation directories. This allows for developers to override specific install paths (e.g. -DCMAKE_INSTALL_LIBDIR=<somedir>). Also, the developer could set -DCMAKE_INSTALL_PREFIX=<somedir> to customize the prefix for all target types.

https://cmake.org/cmake/help/v3.5/module/GNUInstallDirs.html

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.