case VA_FOURCC('Y', 'U', 'Y', '2'):
case VA_FOURCC('U', 'Y', 'V', 'Y'):
assert(subsampling == SUBSAMPLE_YUV422H);
- obj_surface->cb_cr_pitch = obj_surface->width * 2;
+ obj_surface->width = ALIGN(obj_surface->orig_width * 2, 128);
+ obj_surface->cb_cr_pitch = obj_surface->width;
obj_surface->y_cb_offset = 0;
obj_surface->y_cr_offset = 0;
obj_surface->cb_cr_width = obj_surface->orig_width / 2;
obj_surface->cb_cr_height = obj_surface->orig_height / 2;
- region_width = obj_surface->width * 2;
+ region_width = obj_surface->width;
region_height = obj_surface->height;
break;
case VA_FOURCC('B', 'G', 'R', 'X'):
assert(subsampling == SUBSAMPLE_RGBX);
- region_width = obj_surface->width * 4;
+ obj_surface->width = ALIGN(obj_surface->orig_width * 4, 128);
+ region_width = obj_surface->width;
region_height = obj_surface->height;
break;
case VA_FOURCC('Y', 'U', 'Y', '2'):
case VA_FOURCC('U', 'Y', 'V', 'Y'):
+ obj_surface->width = ALIGN(obj_surface->orig_width * 2, 16);
obj_surface->y_cb_offset = 0;
obj_surface->y_cr_offset = 0;
obj_surface->cb_cr_width = obj_surface->orig_width / 2;
obj_surface->cb_cr_height = obj_surface->orig_height;
- obj_surface->cb_cr_pitch = obj_surface->width * 2;
- region_width = obj_surface->width * 2;
+ obj_surface->cb_cr_pitch = obj_surface->width;
+ region_width = obj_surface->width;
region_height = obj_surface->height;
break;
case VA_FOURCC('R', 'G', 'B', 'A'):
case VA_FOURCC('R', 'G', 'B', 'X'):
case VA_FOURCC('B', 'G', 'R', 'A'):
case VA_FOURCC('B', 'G', 'R', 'X'):
- region_width = obj_surface->width * 4;
+ obj_surface->width = ALIGN(obj_surface->orig_width * 4, 16);
+ region_width = obj_surface->width;
region_height = obj_surface->height;
break;
&pitch,
0);
assert(tiling_mode == I915_TILING_Y);
- assert(pitch == obj_surface->width ||
- pitch == obj_surface->width * 2 ||
- pitch == obj_surface->width * 4) ;
+ assert(pitch == obj_surface->width);
} else {
obj_surface->bo = dri_bo_alloc(i965->intel.bufmgr,
"vaapi surface",
case VA_FOURCC('Y', 'U', 'Y', '2'):
case VA_FOURCC('U', 'Y', 'V', 'Y'):
image->num_planes = 1;
- image->pitches[0] = obj_surface->width * 2; /* Y, width is aligned already */
+ image->pitches[0] = obj_surface->width; /* Y, width is aligned already */
image->offsets[0] = 0;
break;
case VA_FOURCC('R', 'G', 'B', 'A'):
case VA_FOURCC('B', 'G', 'R', 'A'):
case VA_FOURCC('B', 'G', 'R', 'X'):
image->num_planes = 1;
- image->pitches[0] = obj_surface->width * 4;
+ image->pitches[0] = obj_surface->width;
break;
default:
goto error;
if (full_packed_format) {
scale_factor_of_1st_plane_width_in_byte = 4;
- pitch[0] = obj_surface->width * 4;
}
else if (packed_yuv ) {
scale_factor_of_1st_plane_width_in_byte = 2;
- pitch[0] = obj_surface->width * 2;
}
else if (interleaved_uv) {
width[1] = obj_surface->orig_width;
width[0] = obj_surface->orig_width * 2; /* surface format is R8, so double the width */
else
width[0] = obj_surface->orig_width; /* surface foramt is YCBCR, width is specified in units of pixels */
-
- pitch[0] = obj_surface->width * 2;
} else if (rgbx_format) {
if (is_target)
width[0] = obj_surface->orig_width * 4; /* surface format is R8, so quad the width */
- pitch[0] = obj_surface->width * 4;
}
width[1] = obj_surface->cb_cr_width;