#include "gen6_mfd.h"
-#define DMV_SIZE 0x88000 /* 557056 bytes for a frame */
-
static const uint32_t zigzag_direct[64] = {
0, 1, 8, 16, 9, 2, 3, 10,
17, 24, 32, 25, 18, 11, 4, 5,
{
struct i965_driver_data *i965 = i965_driver_data(ctx);
struct gen6_avc_surface *gen6_avc_surface = obj_surface->private_data;
+ int height_in_mbs;
obj_surface->free_private_data = gen6_mfd_free_avc_surface;
+ height_in_mbs = ((pic_param->picture_height_in_mbs_minus1 + 1) & 0xff); /* frame height */
if (!gen6_avc_surface) {
gen6_avc_surface = calloc(sizeof(struct gen6_avc_surface), 1);
if (gen6_avc_surface->dmv_top == NULL) {
gen6_avc_surface->dmv_top = dri_bo_alloc(i965->intel.bufmgr,
"direct mv w/r buffer",
- DMV_SIZE,
+ 128 * height_in_mbs * 64, /* scalable with frame height */
0x1000);
}
gen6_avc_surface->dmv_bottom == NULL) {
gen6_avc_surface->dmv_bottom = dri_bo_alloc(i965->intel.bufmgr,
"direct mv w/r buffer",
- DMV_SIZE,
+ 128 * height_in_mbs * 64, /* scalable with frame height */
0x1000);
}
}
struct object_surface *obj_surface;
dri_bo *bo;
int i, j, enable_avc_ildb = 0;
+ int width_in_mbs;
for (j = 0; j < decode_state->num_slice_params && enable_avc_ildb == 0; j++) {
assert(decode_state->slice_params && decode_state->slice_params[j]->buffer);
assert(decode_state->pic_param && decode_state->pic_param->buffer);
pic_param = (VAPictureParameterBufferH264 *)decode_state->pic_param->buffer;
gen6_mfd_avc_frame_store_index(ctx, pic_param, gen6_mfd_context);
+ width_in_mbs = ((pic_param->picture_width_in_mbs_minus1 + 1) & 0xff);
/* Current decoded picture */
va_pic = &pic_param->CurrPic;
dri_bo_unreference(gen6_mfd_context->intra_row_store_scratch_buffer.bo);
bo = dri_bo_alloc(i965->intel.bufmgr,
"intra row store",
- 128 * 64,
+ width_in_mbs * 64,
0x1000);
assert(bo);
gen6_mfd_context->intra_row_store_scratch_buffer.bo = bo;
dri_bo_unreference(gen6_mfd_context->deblocking_filter_row_store_scratch_buffer.bo);
bo = dri_bo_alloc(i965->intel.bufmgr,
"deblocking filter row store",
- 30720, /* 4 * 120 * 64 */
+ width_in_mbs * 64 * 4,
0x1000);
assert(bo);
gen6_mfd_context->deblocking_filter_row_store_scratch_buffer.bo = bo;
dri_bo_unreference(gen6_mfd_context->bsd_mpc_row_store_scratch_buffer.bo);
bo = dri_bo_alloc(i965->intel.bufmgr,
"bsd mpc row store",
- 11520, /* 1.5 * 120 * 64 */
+ width_in_mbs * 96,
0x1000);
assert(bo);
gen6_mfd_context->bsd_mpc_row_store_scratch_buffer.bo = bo;
dri_bo_unreference(gen6_mfd_context->mpr_row_store_scratch_buffer.bo);
bo = dri_bo_alloc(i965->intel.bufmgr,
"mpr row store",
- 7680, /* 1. 0 * 120 * 64 */
+ width_in_mbs * 64,
0x1000);
assert(bo);
gen6_mfd_context->mpr_row_store_scratch_buffer.bo = bo;
struct object_surface *obj_surface;
int i;
dri_bo *bo;
+ unsigned int width_in_mbs;
assert(decode_state->pic_param && decode_state->pic_param->buffer);
pic_param = (VAPictureParameterBufferMPEG2 *)decode_state->pic_param->buffer;
+ width_in_mbs = ALIGN(pic_param->horizontal_size, 16) / 16;
/* reference picture */
obj_surface = SURFACE(pic_param->forward_reference_picture);
dri_bo_unreference(gen6_mfd_context->bsd_mpc_row_store_scratch_buffer.bo);
bo = dri_bo_alloc(i965->intel.bufmgr,
"bsd mpc row store",
- 11520, /* 1.5 * 120 * 64 */
+ width_in_mbs * 96,
0x1000);
assert(bo);
gen6_mfd_context->bsd_mpc_row_store_scratch_buffer.bo = bo;
{
struct i965_driver_data *i965 = i965_driver_data(ctx);
struct gen6_vc1_surface *gen6_vc1_surface = obj_surface->private_data;
+ int height_in_mbs = ALIGN(pic_param->coded_height, 16) / 16;
obj_surface->free_private_data = gen6_mfd_free_vc1_surface;
if (gen6_vc1_surface->dmv == NULL) {
gen6_vc1_surface->dmv = dri_bo_alloc(i965->intel.bufmgr,
"direct mv w/r buffer",
- 557056, /* 64 * 128 * 64 */
+ 128 * height_in_mbs * 64, /* scalable with frame height */
0x1000);
}
}
struct object_surface *obj_surface;
int i;
dri_bo *bo;
+ int width_in_mbs;
assert(decode_state->pic_param && decode_state->pic_param->buffer);
pic_param = (VAPictureParameterBufferVC1 *)decode_state->pic_param->buffer;
+ width_in_mbs = ALIGN(pic_param->coded_width, 16) / 16;
/* reference picture */
obj_surface = SURFACE(pic_param->forward_reference_picture);
dri_bo_unreference(gen6_mfd_context->intra_row_store_scratch_buffer.bo);
bo = dri_bo_alloc(i965->intel.bufmgr,
"intra row store",
- 128 * 64,
+ width_in_mbs * 64,
0x1000);
assert(bo);
gen6_mfd_context->intra_row_store_scratch_buffer.bo = bo;
dri_bo_unreference(gen6_mfd_context->deblocking_filter_row_store_scratch_buffer.bo);
bo = dri_bo_alloc(i965->intel.bufmgr,
"deblocking filter row store",
- 46080, /* 6 * 120 * 64 */
+ width_in_mbs * 6 * 64,
0x1000);
assert(bo);
gen6_mfd_context->deblocking_filter_row_store_scratch_buffer.bo = bo;
dri_bo_unreference(gen6_mfd_context->bsd_mpc_row_store_scratch_buffer.bo);
bo = dri_bo_alloc(i965->intel.bufmgr,
"bsd mpc row store",
- 11520, /* 1.5 * 120 * 64 */
+ width_in_mbs * 96,
0x1000);
assert(bo);
gen6_mfd_context->bsd_mpc_row_store_scratch_buffer.bo = bo;
#include "gen7_mfd.h"
-#define DMV_SIZE 0x88000 /* 557056 bytes for a frame */
-
static const uint32_t zigzag_direct[64] = {
0, 1, 8, 16, 9, 2, 3, 10,
17, 24, 32, 25, 18, 11, 4, 5,
{
struct i965_driver_data *i965 = i965_driver_data(ctx);
struct gen7_avc_surface *gen7_avc_surface = obj_surface->private_data;
+ int width_in_mbs, height_in_mbs;
obj_surface->free_private_data = gen7_mfd_free_avc_surface;
+ width_in_mbs = ((pic_param->picture_width_in_mbs_minus1 + 1) & 0xff);
+ height_in_mbs = ((pic_param->picture_height_in_mbs_minus1 + 1) & 0xff); /* frame height */
if (!gen7_avc_surface) {
gen7_avc_surface = calloc(sizeof(struct gen7_avc_surface), 1);
if (gen7_avc_surface->dmv_top == NULL) {
gen7_avc_surface->dmv_top = dri_bo_alloc(i965->intel.bufmgr,
"direct mv w/r buffer",
- DMV_SIZE,
+ width_in_mbs * height_in_mbs * 64,
0x1000);
}
gen7_avc_surface->dmv_bottom == NULL) {
gen7_avc_surface->dmv_bottom = dri_bo_alloc(i965->intel.bufmgr,
"direct mv w/r buffer",
- DMV_SIZE,
+ width_in_mbs * height_in_mbs * 64,
0x1000);
}
}
struct object_surface *obj_surface;
dri_bo *bo;
int i, j, enable_avc_ildb = 0;
+ int width_in_mbs;
for (j = 0; j < decode_state->num_slice_params && enable_avc_ildb == 0; j++) {
assert(decode_state->slice_params && decode_state->slice_params[j]->buffer);
assert(decode_state->pic_param && decode_state->pic_param->buffer);
pic_param = (VAPictureParameterBufferH264 *)decode_state->pic_param->buffer;
gen7_mfd_avc_frame_store_index(ctx, pic_param, gen7_mfd_context);
+ width_in_mbs = ((pic_param->picture_width_in_mbs_minus1 + 1) & 0xff);
/* Current decoded picture */
va_pic = &pic_param->CurrPic;
dri_bo_unreference(gen7_mfd_context->intra_row_store_scratch_buffer.bo);
bo = dri_bo_alloc(i965->intel.bufmgr,
"intra row store",
- 128 * 64,
+ width_in_mbs * 64,
0x1000);
assert(bo);
gen7_mfd_context->intra_row_store_scratch_buffer.bo = bo;
dri_bo_unreference(gen7_mfd_context->deblocking_filter_row_store_scratch_buffer.bo);
bo = dri_bo_alloc(i965->intel.bufmgr,
"deblocking filter row store",
- 30720, /* 4 * 120 * 64 */
+ width_in_mbs * 64 * 4,
0x1000);
assert(bo);
gen7_mfd_context->deblocking_filter_row_store_scratch_buffer.bo = bo;
dri_bo_unreference(gen7_mfd_context->bsd_mpc_row_store_scratch_buffer.bo);
bo = dri_bo_alloc(i965->intel.bufmgr,
"bsd mpc row store",
- 11520, /* 1.5 * 120 * 64 */
+ width_in_mbs * 96,
0x1000);
assert(bo);
gen7_mfd_context->bsd_mpc_row_store_scratch_buffer.bo = bo;
dri_bo_unreference(gen7_mfd_context->mpr_row_store_scratch_buffer.bo);
bo = dri_bo_alloc(i965->intel.bufmgr,
"mpr row store",
- 7680, /* 1. 0 * 120 * 64 */
+ width_in_mbs * 64,
0x1000);
assert(bo);
gen7_mfd_context->mpr_row_store_scratch_buffer.bo = bo;
struct object_surface *obj_surface;
int i;
dri_bo *bo;
+ unsigned int width_in_mbs;
assert(decode_state->pic_param && decode_state->pic_param->buffer);
pic_param = (VAPictureParameterBufferMPEG2 *)decode_state->pic_param->buffer;
+ width_in_mbs = ALIGN(pic_param->horizontal_size, 16) / 16;
/* reference picture */
obj_surface = SURFACE(pic_param->forward_reference_picture);
dri_bo_unreference(gen7_mfd_context->bsd_mpc_row_store_scratch_buffer.bo);
bo = dri_bo_alloc(i965->intel.bufmgr,
"bsd mpc row store",
- 11520, /* 1.5 * 120 * 64 */
+ width_in_mbs * 96,
0x1000);
assert(bo);
gen7_mfd_context->bsd_mpc_row_store_scratch_buffer.bo = bo;
{
struct i965_driver_data *i965 = i965_driver_data(ctx);
struct gen7_vc1_surface *gen7_vc1_surface = obj_surface->private_data;
+ int width_in_mbs = ALIGN(pic_param->coded_width, 16) / 16;
+ int height_in_mbs = ALIGN(pic_param->coded_height, 16) / 16;
obj_surface->free_private_data = gen7_mfd_free_vc1_surface;
if (gen7_vc1_surface->dmv == NULL) {
gen7_vc1_surface->dmv = dri_bo_alloc(i965->intel.bufmgr,
"direct mv w/r buffer",
- 557056, /* 64 * 128 * 64 */
+ width_in_mbs * height_in_mbs * 64,
0x1000);
}
}
struct object_surface *obj_surface;
int i;
dri_bo *bo;
+ int width_in_mbs;
assert(decode_state->pic_param && decode_state->pic_param->buffer);
pic_param = (VAPictureParameterBufferVC1 *)decode_state->pic_param->buffer;
+ width_in_mbs = ALIGN(pic_param->coded_width, 16) / 16;
/* reference picture */
obj_surface = SURFACE(pic_param->forward_reference_picture);
dri_bo_unreference(gen7_mfd_context->intra_row_store_scratch_buffer.bo);
bo = dri_bo_alloc(i965->intel.bufmgr,
"intra row store",
- 128 * 64,
+ width_in_mbs * 64,
0x1000);
assert(bo);
gen7_mfd_context->intra_row_store_scratch_buffer.bo = bo;
dri_bo_unreference(gen7_mfd_context->deblocking_filter_row_store_scratch_buffer.bo);
bo = dri_bo_alloc(i965->intel.bufmgr,
"deblocking filter row store",
- 46080, /* 6 * 120 * 64 */
+ width_in_mbs * 6 * 64,
0x1000);
assert(bo);
gen7_mfd_context->deblocking_filter_row_store_scratch_buffer.bo = bo;
dri_bo_unreference(gen7_mfd_context->bsd_mpc_row_store_scratch_buffer.bo);
bo = dri_bo_alloc(i965->intel.bufmgr,
"bsd mpc row store",
- 11520, /* 1.5 * 120 * 64 */
+ width_in_mbs * 96,
0x1000);
assert(bo);
gen7_mfd_context->bsd_mpc_row_store_scratch_buffer.bo = bo;