i965_drv_video: move AVC-ILDB data buffer to struct i965_h264_context
authorXiang, Haihao <haihao.xiang@intel.com>
Mon, 19 Apr 2010 06:41:31 +0000 (14:41 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Mon, 19 Apr 2010 06:41:31 +0000 (14:41 +0800)
i965_avc_bsd.c
i965_avc_bsd.h
i965_media_h264.c
i965_media_h264.h

index d00fe7d..00a1675 100644 (file)
@@ -433,7 +433,7 @@ i965_avc_bsd_buf_base_state(VADriverContextP ctx,
     OUT_BCS_RELOC(ctx, i965_h264_context->avc_it_data.bo,
                   I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION,
                   (i965_h264_context->avc_it_data.write_offset << 6));
-    OUT_BCS_RELOC(ctx, i965_avc_bsd_context->ildb_data.bo,
+    OUT_BCS_RELOC(ctx, i965_h264_context->avc_ildb_data.bo,
                   I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION,
                   0);
 
@@ -1002,14 +1002,6 @@ i965_avc_bsd_decode_init(VADriverContextP ctx)
                       64);
     assert(bo);
     i965_avc_bsd_context->mpr_row_store.bo = bo;
-
-    dri_bo_unreference(i965_avc_bsd_context->ildb_data.bo);
-    bo = dri_bo_alloc(i965->intel.bufmgr,
-                      "ildb data",
-                      0x100000, /* at least 1044480 bytes */
-                      64);
-    assert(bo);
-    i965_avc_bsd_context->ildb_data.bo = bo;
 }
 
 Bool 
@@ -1017,7 +1009,6 @@ i965_avc_bsd_ternimate(struct i965_avc_bsd_context *i965_avc_bsd_context)
 {
     dri_bo_unreference(i965_avc_bsd_context->bsd_raw_store.bo);
     dri_bo_unreference(i965_avc_bsd_context->mpr_row_store.bo);
-    dri_bo_unreference(i965_avc_bsd_context->ildb_data.bo);
 
     return True;
 }
index 7f39ba5..a9db6d1 100644 (file)
@@ -54,10 +54,6 @@ struct i965_avc_bsd_context
         dri_bo *bo;
         long write_offset;
     } avc_it_data;
-
-    struct {
-        dri_bo *bo;
-    } ildb_data;
 };
 
 void i965_avc_bsd_pipeline(VADriverContextP, struct decode_state *);
index fe8c219..ee8d7e7 100644 (file)
@@ -792,6 +792,14 @@ i965_media_h264_decode_init(VADriverContextP ctx)
     dri_bo_reference(media_state->indirect_object.bo);
     media_state->indirect_object.offset = i965_h264_context->avc_it_data.write_offset;
 
+    dri_bo_unreference(i965_h264_context->avc_ildb_data.bo);
+    bo = dri_bo_alloc(i965->intel.bufmgr,
+                      "AVC-ILDB Data Buffer",
+                      0x100000, /* at least 1044480 bytes */
+                      64);
+    assert(bo);
+    i965_h264_context->avc_ildb_data.bo = bo;
+
     /* bsd pipeline */
     i965_avc_bsd_decode_init(ctx);
 
@@ -892,6 +900,7 @@ i965_media_h264_ternimate(VADriverContextP ctx)
         i965_avc_bsd_ternimate(&i965_h264_context->i965_avc_bsd_context);
         dri_bo_unreference(i965_h264_context->avc_it_command_mb_info.bo);
         dri_bo_unreference(i965_h264_context->avc_it_data.bo);
+        dri_bo_unreference(i965_h264_context->avc_ildb_data.bo);
         free(i965_h264_context);
         media_state->private_context = NULL;
     }
index 4df37a4..49204a1 100644 (file)
@@ -26,6 +26,10 @@ struct i965_h264_context
     } avc_it_data;
 
     struct {
+        dri_bo *bo;
+    } avc_ildb_data;
+
+    struct {
         unsigned int width_in_mbs;
         unsigned int height_in_mbs;
         int mbaff_frame_flag;