summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>2014-05-09 15:08:05 +0200
committerXiang, Haihao <haihao.xiang@intel.com>2014-06-16 11:53:35 +0800
commitda8a7e9accb5f8e1913440fdd2d662af6a0b7ef1 (patch)
tree123eb593e8dae92896e16a7bc9da8269661dd2dd
parentaeef40157a7d3349ea8afc5dca0c198055027601 (diff)
downloadlibva-intel-driver-da8a7e9accb5f8e1913440fdd2d662af6a0b7ef1.tar.gz
libva-intel-driver-da8a7e9accb5f8e1913440fdd2d662af6a0b7ef1.tar.bz2
libva-intel-driver-da8a7e9accb5f8e1913440fdd2d662af6a0b7ef1.zip
surface: drop SURFACE_DISPLAYED flag.
The optimization by which the VA surface storage is deallocated after it is displayed and not used for reference or vaDeriveImage() purposes cannot be implemented safely. We need to honour explicit lifetimes defined by the upper codec layer. Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com> (cherry picked from commit 84926ace7a2c5b88df1ada167a1c273128469aad)
-rwxr-xr-xsrc/gen6_mfd.c6
-rw-r--r--src/gen75_mfd.c6
-rwxr-xr-xsrc/gen7_mfd.c6
-rw-r--r--src/gen8_mfd.c6
-rw-r--r--src/i965_avc_bsd.c6
-rw-r--r--src/i965_drv_video.h4
-rw-r--r--src/i965_output_dri.c1
7 files changed, 20 insertions, 15 deletions
diff --git a/src/gen6_mfd.c b/src/gen6_mfd.c
index e22e57a..437ad3b 100755
--- a/src/gen6_mfd.c
+++ b/src/gen6_mfd.c
@@ -830,8 +830,10 @@ gen6_mfd_avc_decode_init(VADriverContextP ctx,
/* Current decoded picture */
obj_surface = decode_state->render_object;
- obj_surface->flags &= ~SURFACE_REF_DIS_MASK;
- obj_surface->flags |= (pic_param->pic_fields.bits.reference_pic_flag ? SURFACE_REFERENCED : 0);
+ if (pic_param->pic_fields.bits.reference_pic_flag)
+ obj_surface->flags |= SURFACE_REFERENCED;
+ else
+ obj_surface->flags &= ~SURFACE_REFERENCED;
avc_ensure_surface_bo(ctx, decode_state, obj_surface, pic_param);
gen6_mfd_init_avc_surface(ctx, pic_param, obj_surface);
diff --git a/src/gen75_mfd.c b/src/gen75_mfd.c
index aaee807..a1d004b 100644
--- a/src/gen75_mfd.c
+++ b/src/gen75_mfd.c
@@ -1051,8 +1051,10 @@ gen75_mfd_avc_decode_init(VADriverContextP ctx,
/* Current decoded picture */
obj_surface = decode_state->render_object;
- obj_surface->flags &= ~SURFACE_REF_DIS_MASK;
- obj_surface->flags |= (pic_param->pic_fields.bits.reference_pic_flag ? SURFACE_REFERENCED : 0);
+ if (pic_param->pic_fields.bits.reference_pic_flag)
+ obj_surface->flags |= SURFACE_REFERENCED;
+ else
+ obj_surface->flags &= ~SURFACE_REFERENCED;
avc_ensure_surface_bo(ctx, decode_state, obj_surface, pic_param);
gen75_mfd_init_avc_surface(ctx, pic_param, obj_surface);
diff --git a/src/gen7_mfd.c b/src/gen7_mfd.c
index db35abf..97f9705 100755
--- a/src/gen7_mfd.c
+++ b/src/gen7_mfd.c
@@ -748,8 +748,10 @@ gen7_mfd_avc_decode_init(VADriverContextP ctx,
/* Current decoded picture */
obj_surface = decode_state->render_object;
- obj_surface->flags &= ~SURFACE_REF_DIS_MASK;
- obj_surface->flags |= (pic_param->pic_fields.bits.reference_pic_flag ? SURFACE_REFERENCED : 0);
+ if (pic_param->pic_fields.bits.reference_pic_flag)
+ obj_surface->flags |= SURFACE_REFERENCED;
+ else
+ obj_surface->flags &= ~SURFACE_REFERENCED;
avc_ensure_surface_bo(ctx, decode_state, obj_surface, pic_param);
gen7_mfd_init_avc_surface(ctx, pic_param, obj_surface);
diff --git a/src/gen8_mfd.c b/src/gen8_mfd.c
index 4e24f55..df0cd42 100644
--- a/src/gen8_mfd.c
+++ b/src/gen8_mfd.c
@@ -814,8 +814,10 @@ gen8_mfd_avc_decode_init(VADriverContextP ctx,
/* Current decoded picture */
obj_surface = decode_state->render_object;
- obj_surface->flags &= ~SURFACE_REF_DIS_MASK;
- obj_surface->flags |= (pic_param->pic_fields.bits.reference_pic_flag ? SURFACE_REFERENCED : 0);
+ if (pic_param->pic_fields.bits.reference_pic_flag)
+ obj_surface->flags |= SURFACE_REFERENCED;
+ else
+ obj_surface->flags &= ~SURFACE_REFERENCED;
avc_ensure_surface_bo(ctx, decode_state, obj_surface, pic_param);
gen8_mfd_init_avc_surface(ctx, pic_param, obj_surface);
diff --git a/src/i965_avc_bsd.c b/src/i965_avc_bsd.c
index 43bace6..aca3c01 100644
--- a/src/i965_avc_bsd.c
+++ b/src/i965_avc_bsd.c
@@ -432,8 +432,10 @@ i965_avc_bsd_buf_base_state(VADriverContextP ctx,
va_pic = &pic_param->CurrPic;
obj_surface = decode_state->render_object;
- obj_surface->flags &= ~SURFACE_REF_DIS_MASK;
- obj_surface->flags |= (pic_param->pic_fields.bits.reference_pic_flag ? SURFACE_REFERENCED : 0);
+ if (pic_param->pic_fields.bits.reference_pic_flag)
+ obj_surface->flags |= SURFACE_REFERENCED;
+ else
+ obj_surface->flags &= ~SURFACE_REFERENCED;
i965_check_alloc_surface_bo(ctx, obj_surface, 0, VA_FOURCC_NV12, SUBSAMPLE_YUV420);
/* initial uv component for YUV400 case */
diff --git a/src/i965_drv_video.h b/src/i965_drv_video.h
index e25b9c8..95ee193 100644
--- a/src/i965_drv_video.h
+++ b/src/i965_drv_video.h
@@ -202,12 +202,8 @@ struct object_context
};
#define SURFACE_REFERENCED (1 << 0)
-#define SURFACE_DISPLAYED (1 << 1)
#define SURFACE_DERIVED (1 << 2)
-#define SURFACE_REF_DIS_MASK ((SURFACE_REFERENCED) | \
- (SURFACE_DISPLAYED))
#define SURFACE_ALL_MASK ((SURFACE_REFERENCED) | \
- (SURFACE_DISPLAYED) | \
(SURFACE_DERIVED))
struct object_surface
diff --git a/src/i965_output_dri.c b/src/i965_output_dri.c
index 3b24534..6f8ea31 100644
--- a/src/i965_output_dri.c
+++ b/src/i965_output_dri.c
@@ -205,7 +205,6 @@ i965_put_surface_dri(
if (!(g_intel_debug_option_flags & VA_INTEL_DEBUG_OPTION_BENCH))
dri_vtable->swap_buffer(ctx, dri_drawable);
- obj_surface->flags |= SURFACE_DISPLAYED;
_i965UnlockMutex(&i965->render_mutex);