OSDN Git Service

android-x86/hardware-intel-common-vaapi.git
6 years agoDon't compare an array against NULL
Xiang, Haihao [Tue, 13 Mar 2018 08:39:03 +0000 (16:39 +0800)]
Don't compare an array against NULL

Instead we should use the corresponding pointers

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
6 years agoMake sure a pointer is valid before using
Xiang, Haihao [Tue, 13 Mar 2018 06:23:33 +0000 (14:23 +0800)]
Make sure a pointer is valid before using

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
6 years agoDon't compare an unsigned variable with 0
Xiang, Haihao [Tue, 13 Mar 2018 05:58:50 +0000 (13:58 +0800)]
Don't compare an unsigned variable with 0

For an unsigned variable xxx, 'xxx < 0U' is always false, and 'xxx >=
0U' is always true

In addition, this commit fixes a minor syntax error.

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
6 years agoCheck function return value
Xiang, Haihao [Tue, 13 Mar 2018 05:26:02 +0000 (13:26 +0800)]
Check function return value

i965_gpe_allocate_2d_resource() may return error

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
6 years agoCorrect the valid buffer size
Xiang, Haihao [Tue, 13 Mar 2018 04:50:50 +0000 (12:50 +0800)]
Correct the valid buffer size

Otherwise it might result in out-of-bounds access of i965->va_vendor

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
6 years agoRemove implicit truncation from unsigned int to bit field
Víctor Manuel Jáquez Leal [Wed, 14 Feb 2018 13:31:00 +0000 (14:31 +0100)]
Remove implicit truncation from unsigned int to bit field

All the members of struct i965_sampler_8x8_coefficient are signed
int of 8 bit long (ranging from -128 to 127).

But there is an assignation of 1U<<7 which is implicitly truncated
to -128.

To make explicit the casting, without losing the expresiveness of
the bitwise operation, this patch adds a macro which uses the
anonymous union technique.

6 years agoRemove implicit truncations from int to bit-field
Víctor Manuel Jáquez Leal [Wed, 14 Feb 2018 12:42:53 +0000 (13:42 +0100)]
Remove implicit truncations from int to bit-field

All the members in the structures scoreboard1 and scoreboard2 are
signed int of 4 bit long (this means they only admit values from
-8 to 7).

Along the code, these structures are assigned with values bigger
than 7 which are implicitly truncated to negative numbers. For
example, 0xF -> -1 or 0xE -> -2

It is better to explictly show the assigned values than rely on
implicit convertions. This patch aims to that direction.

6 years agoRemove spurious assignations
Víctor Manuel Jáquez Leal [Wed, 14 Feb 2018 07:33:35 +0000 (08:33 +0100)]
Remove spurious assignations

6 years agobuild: fix meson build
Víctor Manuel Jáquez Leal [Wed, 14 Feb 2018 13:50:08 +0000 (14:50 +0100)]
build: fix meson build

When X11 is found, the variable assigned is HAVE_X11 but the used
one is WITH_X11, failing to define it in the config header.

6 years agoUpdate .travis.yml
Haihao Xiang [Wed, 7 Mar 2018 03:12:05 +0000 (11:12 +0800)]
Update .travis.yml

Like what we did in commit 14a2088 for libva, the corresponding fix is
also required for this driver to avoid locking dpkg file by an
unattended `apt-get` call

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
6 years agoMerge branch 'v2.1-branch' into master
Haihao Xiang [Thu, 8 Mar 2018 05:20:32 +0000 (13:20 +0800)]
Merge branch 'v2.1-branch' into master

6 years agointel-vaapi-driver 2.1.0
Haihao Xiang [Mon, 12 Feb 2018 06:36:21 +0000 (14:36 +0800)]
intel-vaapi-driver 2.1.0

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
6 years agoAdd meson support
Víctor Manuel Jáquez Leal [Fri, 3 Nov 2017 14:47:26 +0000 (15:47 +0100)]
Add meson support

6 years agobuild: delete shaders targets at distclean
Víctor Manuel Jáquez Leal [Thu, 1 Feb 2018 08:40:53 +0000 (09:40 +0100)]
build: delete shaders targets at distclean

6 years agobuild: EXTRA_DIST doesn't recognize wildcards
Víctor Manuel Jáquez Leal [Thu, 1 Feb 2018 08:10:14 +0000 (09:10 +0100)]
build: EXTRA_DIST doesn't recognize wildcards

6 years agobuild: add to VPATH src and build dirs
Víctor Manuel Jáquez Leal [Thu, 1 Feb 2018 08:08:36 +0000 (09:08 +0100)]
build: add to VPATH src and build dirs

In order to make out-of-tree builds and distcheck to work, we should
set the VPATH to look for sources also in srcdir and builddir.

6 years agobuild: automake options in configure.ac
Víctor Manuel Jáquez Leal [Thu, 1 Feb 2018 08:07:19 +0000 (09:07 +0100)]
build: automake options in configure.ac

Consolidate automake options in configure.ac rather than have them
dispersed.

6 years agobuild: remove undefined variable
Víctor Manuel Jáquez Leal [Mon, 22 Jan 2018 16:01:06 +0000 (17:01 +0100)]
build: remove undefined variable

WAYLAND_CFLAGS is not defined by configure.ac

6 years agobuild: autotools: clean check for wayland dependency
Víctor Manuel Jáquez Leal [Mon, 22 Jan 2018 14:34:09 +0000 (15:34 +0100)]
build: autotools: clean check for wayland dependency

Clean up the the checks for wayland dependencies.

6 years agobuild: autotools: don't check for X11 libraries
Víctor Manuel Jáquez Leal [Mon, 22 Jan 2018 14:30:11 +0000 (15:30 +0100)]
build: autotools: don't check for X11 libraries

The driver doesn't link with any X11 library so there is no need to
check for their pkgconfig's data.

6 years agobuild: autotools: don't check for EGL
Víctor Manuel Jáquez Leal [Mon, 22 Jan 2018 14:04:08 +0000 (15:04 +0100)]
build: autotools: don't check for EGL

libEGL is loaded in run-time using dlopen, thus there is no need to
check for it at comiplation time.

6 years agobuild: autotools: check for dlopen library
Víctor Manuel Jáquez Leal [Mon, 22 Jan 2018 14:14:24 +0000 (15:14 +0100)]
build: autotools: check for dlopen library

6 years agobuild: autotools: remove useless --enable-drm parameter
Víctor Manuel Jáquez Leal [Mon, 22 Jan 2018 13:58:46 +0000 (14:58 +0100)]
build: autotools: remove useless --enable-drm parameter

Link with libdrm is mandatory, thus there is no need for a configure
parameter.

In the other hand, link with libva-drm is only required when the unit
tests are enabled.

6 years agobuild: test: enable out-of-source building
Víctor Manuel Jáquez Leal [Mon, 22 Jan 2018 13:07:04 +0000 (14:07 +0100)]
build: test: enable out-of-source building

It is a good practice to build packages out-of-source tree, but its
support for the unit test is not correct. This patch enables it.

6 years agobuild: automake: add -Wno-portability
Víctor Manuel Jáquez Leal [Mon, 22 Jan 2018 14:50:50 +0000 (15:50 +0100)]
build: automake: add -Wno-portability

In order to suppress the warning

src/Makefile.am:117: warning: '%'-style pattern rules are a GNU make extension

6 years agobuild: Remove unused variable
Víctor Manuel Jáquez Leal [Fri, 3 Nov 2017 13:08:17 +0000 (14:08 +0100)]
build: Remove unused variable

Fixes: #327

6 years agobuild: Add libdrm_intel dependency
Víctor Manuel Jáquez Leal [Fri, 3 Nov 2017 14:47:41 +0000 (15:47 +0100)]
build: Add libdrm_intel dependency

Fixes: #326

6 years agobuild: fix variable name
Víctor Manuel Jáquez Leal [Mon, 22 Jan 2018 14:14:03 +0000 (15:14 +0100)]
build: fix variable name

6 years agointel-vaapi-driver 2.1.0.pre1
Xiang, Haihao [Wed, 31 Jan 2018 07:14:47 +0000 (15:14 +0800)]
intel-vaapi-driver 2.1.0.pre1

Update NEWS and bump a new version

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
6 years agoSupport VBR for HEVC 10bit
Xiang, Haihao [Fri, 2 Feb 2018 04:23:58 +0000 (12:23 +0800)]
Support VBR for HEVC 10bit

VBR should be returned when querying the supported RC modes for
VAProfileHEVCMain10/VAEntrypointEncSlice pair

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
6 years agointel-vaapi-driver 2.1.1.pre1 for development
Xiang, Haihao [Fri, 2 Feb 2018 01:26:56 +0000 (09:26 +0800)]
intel-vaapi-driver 2.1.1.pre1 for development

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
6 years agotest: add virtual dtor to abstract classes
U. Artie Eoff [Thu, 1 Feb 2018 21:46:52 +0000 (13:46 -0800)]
test: add virtual dtor to abstract classes

Abstract classes should have virtual destructors.
Missing virtual dtor's can be detected with
-Wnon-virtual-dtor compiler flag, too.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
6 years agoFix a typo
Xiang, Haihao [Thu, 1 Feb 2018 08:31:22 +0000 (16:31 +0800)]
Fix a typo

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
6 years agoAdd the missing files to the corresponding lists
Xiang, Haihao [Wed, 31 Jan 2018 07:54:47 +0000 (15:54 +0800)]
Add the missing files to the corresponding lists

Otherwise, the tar ball created by 'make dist' doesn't include these
files

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
6 years agoi965_avc_encoder: Fix possible NULL pointer dereferencing
Sreerenj Balachandran [Wed, 31 Jan 2018 03:27:54 +0000 (18:27 -0900)]
i965_avc_encoder: Fix possible NULL pointer dereferencing

6 years agoENC/VP8: set value to VA_ATTRIB_NOT_SUPPORTED when querying VAConfigAttribEncPackedHe...
Xiang, Haihao [Tue, 30 Jan 2018 07:34:20 +0000 (15:34 +0800)]
ENC/VP8: set value to VA_ATTRIB_NOT_SUPPORTED when querying VAConfigAttribEncPackedHeaders

vaGetConfigAttributes() should return VA_ATTRIB_NOT_SUPPORTED if the
corresponding attribute is not supported for a given profile/entrypoint
pair. The driver doesn't support any packed header from application for
VP8 encoding.

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
6 years agoReturn surface width/height in pixels
Xiang, Haihao [Mon, 22 Jan 2018 03:03:22 +0000 (11:03 +0800)]
Return surface width/height in pixels

width/height in VADRMPRIMESurfaceDescriptor specifies the
surface width/height in pixels in VA-API, so we should set
the corresponding variables in pixels in the driver

This fixes https://github.com/01org/intel-vaapi-driver/issues/342,
thanks pkerling for the investigation and proposed fix for this issue.

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
6 years agoEnable VP9 non-low power encoding
Xiang, Haihao [Wed, 17 Jan 2018 06:13:00 +0000 (14:13 +0800)]
Enable VP9 non-low power encoding

We re-use KBL VP9 code

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
6 years agoAdd support for VDEnc VP9 CBR/VBR mode on CNL
Xiang, Haihao [Tue, 26 Dec 2017 13:00:47 +0000 (21:00 +0800)]
Add support for VDEnc VP9 CBR/VBR mode on CNL

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
6 years agoAdd support for VDEnc VP9 CQP mode on CNL
Xiang, Haihao [Tue, 19 Sep 2017 08:44:35 +0000 (16:44 +0800)]
Add support for VDEnc VP9 CQP mode on CNL

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
6 years agoAdd flags for VP9 low power encoding mode
Xiang, Haihao [Thu, 21 Sep 2017 07:42:52 +0000 (15:42 +0800)]
Add flags for VP9 low power encoding mode

Add some related checks as well

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
6 years agoAdd a flag for VP9 BRC mode in struct hw_codec_info
Xiang, Haihao [Tue, 26 Dec 2017 08:25:54 +0000 (16:25 +0800)]
Add a flag for VP9 BRC mode in struct hw_codec_info

Use this new flag to check the supported BRC mode

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
6 years agoAdd vdenc common commands for CNL
peng.chen [Sat, 23 Sep 2017 06:37:38 +0000 (14:37 +0800)]
Add vdenc common commands for CNL

It provides helper functions for low power encoding on CNL

Signed-off-by: peng.chen <peng.c.chen@intel.com>
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
6 years agoAdd HuC common commands for CNL
Xiang, Haihao [Tue, 19 Sep 2017 06:18:04 +0000 (14:18 +0800)]
Add HuC common commands for CNL

It provides helper functions for low power encoding on CNL

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
Signed-off-by: peng.chen <peng.c.chen@intel.com>
6 years agoAdd GPE function for MI_COPY_MEM_MEM command
Xiang, Haihao [Tue, 14 Nov 2017 07:50:51 +0000 (15:50 +0800)]
Add GPE function for MI_COPY_MEM_MEM command

This function is used to reads 4 bytes from memory and stores the value
of that 4 bytes to back to memory, both source and destination addresses
are Per Process Graphics Address

It is a helper function for low power encoding support

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
6 years agoAvoid dereferencing a pointer before checking pointer against NULL
Xiang, Haihao [Fri, 26 Jan 2018 07:35:22 +0000 (15:35 +0800)]
Avoid dereferencing a pointer before checking pointer against NULL

It is possible a sequence parameter buffer is not provided by
application.

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
6 years agoNew PCI IDs for CFL
Xiang, Haihao [Thu, 25 Jan 2018 06:41:29 +0000 (14:41 +0800)]
New PCI IDs for CFL

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
6 years agoCQP is supported for jpeg
Xiang, Haihao [Tue, 23 Jan 2018 06:25:15 +0000 (14:25 +0800)]
CQP is supported for jpeg

This fixed regression since 336d891

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
6 years agoVP8 encoding doesn't require packed header
Xiang, Haihao [Tue, 23 Jan 2018 02:56:25 +0000 (10:56 +0800)]
VP8 encoding doesn't require packed header

The corresponding value is set to VA_ENC_PACKED_HEADER_NONE when
querying the supported packed headers. This fixes the regression
caused by cccf2a3 when using FFmpeg/vaapi

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
6 years agoENC:fix min resolution check for encoder
Pengfei Qu [Thu, 18 Jan 2018 09:39:36 +0000 (17:39 +0800)]
ENC:fix min resolution check for encoder

JPEG encoder allow min resolution 1x1
add min resolution check in vaCreateContext to avoid gtest failture
add fix for gtest case
fix the regression in 88249259d4abb2fd701ed3db229941738da2497e

Fixes #330 #333
Signed-off-by: Pengfei Qu <Pengfei.Qu@intel.com>
6 years agotest/avce_context: update RC expectation for Stats entrypoint
U. Artie Eoff [Tue, 23 Jan 2018 04:25:31 +0000 (20:25 -0800)]
test/avce_context: update RC expectation for Stats entrypoint

Rate control attribute is unsupported for AVCE VAEntrypointStats.

This fixes the following test regressions since 336d8913aa30:

AVCEncode/AVCEContextTest.RateControl/3, where GetParam()
  = (VAProfileH264ConstrainedBaseline, VAEntrypointStats)

AVCEncode/AVCEContextTest.RateControl/7, where GetParam()
  = (VAProfileH264Main, VAEntrypointStats)

AVCEncode/AVCEContextTest.RateControl/11, where GetParam()
  = (VAProfileH264High, VAEntrypointStats)

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
6 years agoCheck the flags of the packed headers when creating a config
Xiang, Haihao [Fri, 19 Jan 2018 05:48:56 +0000 (13:48 +0800)]
Check the flags of the packed headers when creating a config

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
6 years agoCheck the requirement on RC mode
Xiang, Haihao [Fri, 19 Jan 2018 05:26:35 +0000 (13:26 +0800)]
Check the requirement on RC mode

This fixes https://github.com/01org/intel-vaapi-driver/issues/337

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
6 years agoCheck decoding mode
Xiang, Haihao [Fri, 19 Jan 2018 03:01:29 +0000 (11:01 +0800)]
Check decoding mode

VA_DEC_SLICE_MODE_NORMAL is supported only for decoding

This fixes https://github.com/01org/intel-vaapi-driver/issues/336

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
6 years agoUpdate .gitignore
Xiang, Haihao [Thu, 13 Jul 2017 01:54:19 +0000 (09:54 +0800)]
Update .gitignore

Filter out generated Gen assembly files

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
6 years agoUse generic register instead of acc0 to calculate the Y/U/V or R/G/B offset
Xiang, Haihao [Thu, 19 Oct 2017 21:09:51 +0000 (05:09 +0800)]
Use generic register instead of acc0 to calculate the Y/U/V or R/G/B offset

The instruction 'mov' cannot assign acc0 with :v anymore on CNL, so all AVS shaders
doesn't work as expected. Replacing acc0 with GRF registers works well on CNL and it
works on GEN8/GEN9 too.

v2: update code style

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
6 years agoENC: add sanity check for invalid input resolution of encoder
Pengfei Qu [Wed, 17 Jan 2018 04:21:51 +0000 (12:21 +0800)]
ENC: add sanity check for invalid input resolution of encoder

Signed-off-by: Pengfei Qu <Pengfei.Qu@intel.com>
6 years agoENC: add mininum resolution query for encoder
Pengfei Qu [Tue, 16 Jan 2018 06:02:45 +0000 (14:02 +0800)]
ENC: add mininum resolution query for encoder

Signed-off-by: Pengfei Qu <Pengfei.Qu@intel.com>
6 years agoFix AVC encoding regression on KBL/GLK/CFL
Xiang, Haihao [Mon, 15 Jan 2018 05:51:35 +0000 (13:51 +0800)]
Fix AVC encoding regression on KBL/GLK/CFL

adaptive transform decision is disabled by default for KBL/GLK/CFL

This fixes https://github.com/01org/intel-vaapi-driver/issues/323

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
6 years agoenc: Add restriction to vp9 encoder frame rate to avoid hang
jkyu [Thu, 22 Jun 2017 04:12:50 +0000 (00:12 -0400)]
enc: Add restriction to vp9 encoder frame rate to avoid hang

Signed-off-by: jkyu <jiankang.yu@intel.com>
6 years agoENC: fix AVC multi slice
Pengfei Qu [Tue, 26 Dec 2017 09:08:27 +0000 (17:08 +0800)]
ENC: fix AVC multi slice

Fixes #324

Signed-off-by: Pengfei Qu <Pengfei.Qu@intel.com>
6 years agoEnc: fix AVC mbenc curbe paraterer on CNL
Pengfei Qu [Tue, 26 Dec 2017 08:24:49 +0000 (16:24 +0800)]
Enc: fix AVC mbenc curbe paraterer on CNL

Signed-off-by: Pengfei Qu <Pengfei.Qu@intel.com>
6 years agoENC/jpeg: fix regression with Small optimization
Xiang, Haihao [Thu, 11 Jan 2018 05:13:36 +0000 (13:13 +0800)]
ENC/jpeg: fix regression with Small optimization

This fixes 6c1b9b345982babde748518de1834e2af8bcf321:
Small optimization while removing warning

The higher 16 bit of dword_qm[j] (j = 0, 1, ..., 31) is
65535 / (raster_qm[i + 1]) (i = 0, 2, 4, ..., 62)

This fixes https://github.com/01org/intel-vaapi-driver/issues/319

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
6 years agoVDENC: Add the VDENC H264 on CNL
Zhao Yakui [Tue, 18 Apr 2017 03:04:51 +0000 (11:04 +0800)]
VDENC: Add the VDENC H264 on CNL

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Pengfei Qu <pengfei.qu@intel.com>
Signed-off-by: peng.chen <peng.c.chen@intel.com>
6 years agoAdd the HEVC encoder on CNL
peng.chen [Wed, 29 Nov 2017 23:18:31 +0000 (07:18 +0800)]
Add the HEVC encoder on CNL

It was initialed by Yakui

Signed-off-by: peng.chen <peng.c.chen@intel.com>
6 years agoAdd common HCP implementation for CNL
peng.chen [Tue, 19 Dec 2017 09:16:35 +0000 (17:16 +0800)]
Add common HCP implementation for CNL

Signed-off-by: peng.chen <peng.c.chen@intel.com>
6 years agoENC: enable avc encoder on cnl
Qu Pengfei [Fri, 13 Oct 2017 08:21:04 +0000 (16:21 +0800)]
ENC: enable avc encoder on cnl

Signed-off-by: Pengfei Qu <pengfei.qu@intel.com>
Signed-off-by: peng.chen <peng.c.chen@intel.com>
6 years agoENC: add AVC encoder media kernel on CNL
Pengfei Qu [Fri, 13 Oct 2017 08:12:42 +0000 (16:12 +0800)]
ENC: add AVC encoder media kernel on CNL

Signed-off-by: Pengfei Qu <pengfei.qu@intel.com>
Signed-off-by: peng.chen <peng.c.chen@intel.com>
6 years agoAdd support for VP8 encode on CNL
Xiang, Haihao [Fri, 8 Sep 2017 08:42:26 +0000 (16:42 +0800)]
Add support for VP8 encode on CNL

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: peng.chen <peng.c.chen@intel.com>
6 years agoAdd the initial support of CNL
Zhao Yakui [Tue, 28 Jun 2016 09:38:19 +0000 (17:38 +0800)]
Add the initial support of CNL

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
Signed-off-by: peng.chen <peng.c.chen@intel.com>
6 years agoFix: AVC encoder use at most 4 fwd ref frames and 1 bwd ref frames
Pengfei Qu [Tue, 28 Nov 2017 07:35:04 +0000 (15:35 +0800)]
Fix: AVC encoder use at most 4 fwd ref frames and 1 bwd ref frames

Fixes #272

Signed-off-by: Pengfei Qu <Pengfei.Qu@intel.com>
6 years agoStats/PreEnc: tests: Add VAEntryPointStats
Sreerenj Balachandran [Fri, 1 Dec 2017 23:02:24 +0000 (15:02 -0800)]
Stats/PreEnc: tests: Add VAEntryPointStats

Add the Stats entrypoint in test case scenarios.

intel-vaapi-driver PR: https://github.com/01org/intel-vaapi-driver/pull/282
libva PR: https://github.com/01org/libva/pull/110

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
6 years agoStats/PreEnc: Add GEN9 AVC PreEnc support
Sreerenj Balachandran [Fri, 1 Dec 2017 22:47:11 +0000 (14:47 -0800)]
Stats/PreEnc: Add GEN9 AVC PreEnc support

The AVC PreEnc includes three stage processing:

1: It does the dowscaling of source and reference pictures.
Also generate the variance and pixel average of current frame,
past and future ref based on user request.

2: Second stage involves the Hierarchical Motion Estimation
Only the 4x hme is supported in PreEnc.

3:Third stage is a PreProc which can generate the Motion Vectors and
Distortion values

libva PR: https://github.com/01org/libva/pull/110

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
6 years agoStat/PreEnc: Add GEN9 AVC PreEnc specific constants
Sreerenj Balachandran [Fri, 1 Dec 2017 22:45:59 +0000 (14:45 -0800)]
Stat/PreEnc: Add GEN9 AVC PreEnc specific constants

* Added preproc curbe init data for I,P and B frames.
* Add preproc ftq lut init constants

libva PR: https://github.com/01org/libva/pull/110

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
6 years agoStats/PreEnc: Add basic infrastructure for PreEnc enablement
Sreerenj Balachandran [Fri, 1 Dec 2017 22:44:58 +0000 (14:44 -0800)]
Stats/PreEnc: Add basic infrastructure for PreEnc enablement

Add necessary changes in common structures and apis
to support Stats Entrypoint.

* add support for the new entrypoint VAEntrypointStats
* added new preproc encode operation enum
* define virtual methods for preproc_set_curbe/send_surface
* add fixes in vaQueryConfigEntrypoints(), vaQueryConfigProfiles,
  vaGetConfigAttributes(), vaQuerySurfaceAttributes(),
  vaCreateContext(), vaCreateBuffer(),vaBeginPicture(),
  vaRenderPicture() and vaEndPicture()
* If PreEnc enabled, only invoke VME.

Note: Enabled the PreEnc Support only for avc encode in Skylake.

libva PR: https://github.com/01org/libva/pull/110

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
6 years agoAdd informational messages for developers on failed H.265 checks
Mark Thompson [Fri, 8 Dec 2017 14:30:08 +0000 (14:30 +0000)]
Add informational messages for developers on failed H.265 checks

Signed-off-by: Mark Thompson <sw@jkqxz.net>
6 years agoAdd informational messages for developers on failed H.264 checks
Mark Thompson [Sat, 2 Dec 2017 16:00:40 +0000 (16:00 +0000)]
Add informational messages for developers on failed H.264 checks

Includes a warning if the level appears to be invalid, but continues anyway
in this case (it could be a correct future value or an unknown extension).

Signed-off-by: Mark Thompson <sw@jkqxz.net>
6 years agoFix coding style error from astyle
Mark Thompson [Sat, 2 Dec 2017 16:00:22 +0000 (16:00 +0000)]
Fix coding style error from astyle

Signed-off-by: Mark Thompson <sw@jkqxz.net>
6 years agoAdd support for H.264 levels 6, 6.1 and 6.2
Mark Thompson [Thu, 30 Nov 2017 21:47:55 +0000 (21:47 +0000)]
Add support for H.264 levels 6, 6.1 and 6.2

Fixes #307.

Signed-off-by: Mark Thompson <sw@jkqxz.net>
6 years agoConvert H.264 level limit lookup functions to use a table
Mark Thompson [Thu, 30 Nov 2017 21:46:33 +0000 (21:46 +0000)]
Convert H.264 level limit lookup functions to use a table

Do not abort on unknown values - instead use the limits for the nearest
valid value of level_idc less than the given one.

Signed-off-by: Mark Thompson <sw@jkqxz.net>
6 years agoRemove unused functions for slice and mv limits
Mark Thompson [Thu, 30 Nov 2017 21:25:03 +0000 (21:25 +0000)]
Remove unused functions for slice and mv limits

Signed-off-by: Mark Thompson <sw@jkqxz.net>
6 years agoInclude missing do in do/while macro
Victor Toso [Tue, 19 Dec 2017 09:05:10 +0000 (10:05 +0100)]
Include missing do in do/while macro

i965_encoder_vp8.c:1895:123: note: put the semicolon on a separate line
                             to silence this warning
i965_encoder_vp8.c:1898:112: warning: while loop has empty body

> ALLOC_VP8_RESOURCE_BUFFER(pak_mpu_tpu_picture_state_buffer,
>                           VP8_PICTURE_STATE_SIZE,
>                           "Picture state buffer");

Signed-off-by: Victor Toso <victortoso@redhat.com>
6 years agoUse enum's type name to fix implicit conversion
Victor Toso [Tue, 19 Dec 2017 07:07:40 +0000 (08:07 +0100)]
Use enum's type name to fix implicit conversion

The implicit conversion happens because there is another enum defined with
the name GEN9_HEVC_ENC_SURFACE_TYPE introduced in the same commit 455351f9

To avoid the several warnings below (by clang), let's use the enum's
defined type name.

gen9_hevc_encoder.c:5754:34: warning: implicit conversion from
enumeration type 'enum _GEN9_HEVC_ENC_SURFACE_TYPE' to different
enumeration type 'enum GEN9_HEVC_ENC_SURFACE_TYPE' [-Wenum-conversion]
     HEVC_ENC_SURFACE_Y_2X, bti_idx,
     ^~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Victor Toso <victortoso@redhat.com>
6 years agoFix coding style
Victor Toso [Tue, 19 Dec 2017 07:15:41 +0000 (08:15 +0100)]
Fix coding style

Fix requested by the pre-commit hook introduced in 2f0a8449f37b
> astyle --style=linux -cnpUH -s4 -M120 \
> src/gen9_hevc_encoder.c src/i965_encoder_vp8.c

This is necessary to avoid unrelated changes in the next two commits.

Signed-off-by: Victor Toso <victortoso@redhat.com>
6 years agoFix possible implicit conversion
Victor Toso [Tue, 19 Dec 2017 08:52:41 +0000 (09:52 +0100)]
Fix possible implicit conversion

Change variables and function's return type to unsigned int to be able to
hold 4010803200 (level_idc is 186) which is bigger then INT_MAX.

> gen9_hevc_enc_utils.c:72:19: warning: implicit conversion from 'long' to
> 'int' changes value from 4010803200 to -284164096 [-Wconstant-conversion]
>         max_bps = 4010803200;
>                 ~ ^~~~~~~~~~

Signed-off-by: Victor Toso <victortoso@redhat.com>
6 years agoFix check return value without assignment
Victor Toso [Tue, 19 Dec 2017 08:17:33 +0000 (09:17 +0100)]
Fix check return value without assignment

gen9_hevc_encoder.c:1248:19: warning: using the result of an assignment
as a condition without parentheses [-Wparentheses]
    if (va_status |= VA_STATUS_SUCCESS)
        ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~

Signed-off-by: Victor Toso <victortoso@redhat.com>
6 years agoi965: Remove negative check on unsigned variable
Victor Toso [Mon, 18 Dec 2017 15:28:32 +0000 (16:28 +0100)]
i965: Remove negative check on unsigned variable

Since its intoduction at 58a4a6afe80835829e95d

> i965_drv_video.c:2860:23: warning: comparison of unsigned
> expression < 0 is always false [-Wtautological-compare]
>    if ((num_elements < 0) ||
>         ~~~~~~~~~~~~ ^ ~

Signed-off-by: Victor Toso <victortoso@redhat.com>
6 years agoSmall optimization while removing warning
Victor Toso [Mon, 18 Dec 2017 15:01:24 +0000 (16:01 +0100)]
Small optimization while removing warning

Removed the helper array and its initialization loop as we can achieve the
same with two variables in one loop.

This patch also removes the warning below:

> gen8_mfc.c:2735:9: warning: variable 'i' is incremented both in the loop
> header and in the loop body [-Wfor-loop-analysis]
>         i++;
>         ^
> gen8_mfc.c:2732:25: note: incremented here
>     for (i = 0; i < 64; i++) {
>                         ^

Signed-off-by: Victor Toso <victortoso@redhat.com>
6 years agoVC1: Fix for frame coding mode
Xiang, Haihao [Mon, 8 Jan 2018 12:34:11 +0000 (20:34 +0800)]
VC1: Fix for frame coding mode

Some VC1 clips might be marked interlaced but have fcm < 2, and the
wrong fcm will lead to undefined behavior, such as GPU hang.

This fixes https://github.com/01org/intel-vaapi-driver/issues/316

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
6 years agogenX_mfd: add comment on dmv buffer scaling
carpalis [Wed, 6 Dec 2017 11:02:32 +0000 (12:02 +0100)]
genX_mfd: add comment on dmv buffer scaling

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
6 years agogenX_mfd: optimize comparison out of loop
carpalis [Sun, 12 Nov 2017 14:56:57 +0000 (15:56 +0100)]
genX_mfd: optimize comparison out of loop

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
6 years agogenX_mfd: fix code indenting
carpalis [Wed, 1 Nov 2017 19:08:49 +0000 (20:08 +0100)]
genX_mfd: fix code indenting

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
6 years agogen8_mfd: program hardware for range reduction scaling
carpalis [Wed, 1 Nov 2017 19:04:13 +0000 (20:04 +0100)]
gen8_mfd: program hardware for range reduction scaling

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
6 years agogenX_mfd: clean up the use of profile bitstream element
carpalis [Wed, 1 Nov 2017 18:45:42 +0000 (19:45 +0100)]
genX_mfd: clean up the use of profile bitstream element

Only gen6 needs mapping from input range to the hardware range for
the profile bitstream element. For gen7 and up there is no need for a
mapping as the hardware uses only one bit indicating simple/main profile
or advanced profile. Therefore, we can remove the mapping for gen7 and
clean up the code a bit.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
6 years agogenX_mfd: fix range reduction scaling
carpalis [Wed, 1 Nov 2017 15:11:59 +0000 (16:11 +0100)]
genX_mfd: fix range reduction scaling

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
6 years agogenX_mfd: fix dmv buffer size calculation
carpalis [Tue, 31 Oct 2017 14:22:14 +0000 (15:22 +0100)]
genX_mfd: fix dmv buffer size calculation

The picture size may vary within a VC-1 stream. We should calculate
the dmv buffer size from the size of the surface instead of the
size of the first picture that uses the surface. Subsequent pictures
may be larger, which could overflow the dmv buffer.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
6 years agogenX_mfd: fix intensity compensation for frame-interlaced content
carpalis [Sat, 28 Oct 2017 13:21:39 +0000 (15:21 +0200)]
genX_mfd: fix intensity compensation for frame-interlaced content

When frame-interlaced pictures are signalled to be intensity
compensated, we need to set the hardware to compensating both the top and
the bottom field.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
6 years agogen7_mfd: remove obsolete gen7_vc1_surface fields
carpalis [Sat, 28 Oct 2017 09:07:13 +0000 (11:07 +0200)]
gen7_mfd: remove obsolete gen7_vc1_surface fields

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
6 years agoi965_decoder_utils: enable decoding of VC-1 interlaced pictures
carpalis [Fri, 27 Oct 2017 12:58:53 +0000 (14:58 +0200)]
i965_decoder_utils: enable decoding of VC-1 interlaced pictures

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
6 years agogen8_mfd: add support for VC-1 interlaced intensity compensation
carpalis [Fri, 27 Oct 2017 12:57:00 +0000 (14:57 +0200)]
gen8_mfd: add support for VC-1 interlaced intensity compensation

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>