Fix INSERT_OBJECT command on Ivybridge
authorXiang, Haihao <haihao.xiang@intel.com>
Fri, 16 Dec 2011 01:03:49 +0000 (09:03 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Fri, 16 Dec 2011 01:03:49 +0000 (09:03 +0800)
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
src/gen6_mfc.c
src/i965_defines.h

index dbddc77..fef5061 100644 (file)
@@ -662,11 +662,16 @@ gen6_mfc_avc_insert_object(VADriverContextP ctx, struct gen6_encoder_context *ge
                            unsigned int *insert_data, int lenght_in_dws, int data_bits_in_last_dw,
                            int skip_emul_byte_count, int is_last_header, int is_end_of_slice, int emulation_flag)
 {
+    struct i965_driver_data *i965 = i965_driver_data(ctx);
     struct intel_batchbuffer *batch = gen6_encoder_context->base.batch;
 
     BEGIN_BCS_BATCH(batch, lenght_in_dws + 2);
 
-    OUT_BCS_BATCH(batch, MFC_AVC_INSERT_OBJECT | (lenght_in_dws + 2 - 2));
+    if (IS_GEN7(i965->intel.device_id))
+        OUT_BCS_BATCH(batch, MFX_INSERT_OBJECT | (lenght_in_dws + 2 - 2));
+    else
+        OUT_BCS_BATCH(batch, MFC_AVC_INSERT_OBJECT | (lenght_in_dws + 2 - 2));
+
     OUT_BCS_BATCH(batch,
                   (0 << 16) |   /* always start at offset 0 */
                   (data_bits_in_last_dw << 8) |
index 13f6ed8..8d23bec 100644 (file)
 #define MFX_QM_STATE                            MFX(2, 0, 0, 7)
 #define MFX_FQM_STATE                           MFX(2, 0, 0, 8)
 
+#define MFX_INSERT_OBJECT                       MFX(2, 0, 2, 8)
+
 #define MFX_WAIT                                MFX(1, 0, 0, 0)
 
 #define MFX_AVC_IMG_STATE                       MFX(2, 1, 0, 0)