st/va: delay decoder creation until max_references is known
authorJulien Isorce <j.isorce@samsung.com>
Thu, 26 Nov 2015 08:29:54 +0000 (08:29 +0000)
committerJulien Isorce <j.isorce@samsung.com>
Tue, 1 Dec 2015 08:21:20 +0000 (08:21 +0000)
commitb4fb6d76161d86c67697cf28a221d7913b8d084d
treeaea77ec502b933e140d9b85450ef34c8be3ccf94
parent750393ff7d6162372f368f5ed726b23f4cae49a0
st/va: delay decoder creation until max_references is known

In general max_references cannot be based on num_render_targets.

This patch allows to allocate buffers with an accurate size.
I.e. no more than necessary. For other codecs it is a fixed
value 2.

This is similar behaviour as vaapi/vdpau-driver.

For now HEVC case defaults to num_render_targets as before.
But it could also benefits this change by setting a more
accurate max_references number in handlePictureParameterBuffer.

Signed-off-by: Julien Isorce <j.isorce@samsung.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
src/gallium/state_trackers/va/context.c
src/gallium/state_trackers/va/picture.c
src/gallium/state_trackers/va/picture_h264.c
src/gallium/state_trackers/va/va_private.h