i915: On Gen <= 3 there is no W-tiling
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
This commit is contained in:
parent
97d332ce0e
commit
122e6dc451
|
@ -525,14 +525,13 @@ intel_miptree_get_tile_offsets(struct intel_mipmap_tree *mt,
|
||||||
uint32_t x, y;
|
uint32_t x, y;
|
||||||
uint32_t mask_x, mask_y;
|
uint32_t mask_x, mask_y;
|
||||||
|
|
||||||
intel_region_get_tile_masks(region, &mask_x, &mask_y, false);
|
intel_region_get_tile_masks(region, &mask_x, &mask_y);
|
||||||
intel_miptree_get_image_offset(mt, level, slice, &x, &y);
|
intel_miptree_get_image_offset(mt, level, slice, &x, &y);
|
||||||
|
|
||||||
*tile_x = x & mask_x;
|
*tile_x = x & mask_x;
|
||||||
*tile_y = y & mask_y;
|
*tile_y = y & mask_y;
|
||||||
|
|
||||||
return intel_region_get_aligned_offset(region, x & ~mask_x, y & ~mask_y,
|
return intel_region_get_aligned_offset(region, x & ~mask_x, y & ~mask_y);
|
||||||
false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -284,15 +284,11 @@ intel_region_release(struct intel_region **region_handle)
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
intel_region_get_tile_masks(struct intel_region *region,
|
intel_region_get_tile_masks(struct intel_region *region,
|
||||||
uint32_t *mask_x, uint32_t *mask_y,
|
uint32_t *mask_x, uint32_t *mask_y)
|
||||||
bool map_stencil_as_y_tiled)
|
|
||||||
{
|
{
|
||||||
int cpp = region->cpp;
|
int cpp = region->cpp;
|
||||||
uint32_t tiling = region->tiling;
|
uint32_t tiling = region->tiling;
|
||||||
|
|
||||||
if (map_stencil_as_y_tiled)
|
|
||||||
tiling = I915_TILING_Y;
|
|
||||||
|
|
||||||
switch (tiling) {
|
switch (tiling) {
|
||||||
default:
|
default:
|
||||||
assert(false);
|
assert(false);
|
||||||
|
@ -317,25 +313,12 @@ intel_region_get_tile_masks(struct intel_region *region,
|
||||||
*/
|
*/
|
||||||
uint32_t
|
uint32_t
|
||||||
intel_region_get_aligned_offset(struct intel_region *region, uint32_t x,
|
intel_region_get_aligned_offset(struct intel_region *region, uint32_t x,
|
||||||
uint32_t y, bool map_stencil_as_y_tiled)
|
uint32_t y)
|
||||||
{
|
{
|
||||||
int cpp = region->cpp;
|
int cpp = region->cpp;
|
||||||
uint32_t pitch = region->pitch;
|
uint32_t pitch = region->pitch;
|
||||||
uint32_t tiling = region->tiling;
|
uint32_t tiling = region->tiling;
|
||||||
|
|
||||||
if (map_stencil_as_y_tiled) {
|
|
||||||
tiling = I915_TILING_Y;
|
|
||||||
|
|
||||||
/* When mapping a W-tiled stencil buffer as Y-tiled, each 64-high W-tile
|
|
||||||
* gets transformed into a 32-high Y-tile. Accordingly, the pitch of
|
|
||||||
* the resulting region is twice the pitch of the original region, since
|
|
||||||
* each row in the Y-tiled view corresponds to two rows in the actual
|
|
||||||
* W-tiled surface. So we need to correct the pitch before computing
|
|
||||||
* the offsets.
|
|
||||||
*/
|
|
||||||
pitch *= 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (tiling) {
|
switch (tiling) {
|
||||||
default:
|
default:
|
||||||
assert(false);
|
assert(false);
|
||||||
|
|
|
@ -101,12 +101,11 @@ void intel_recreate_static_regions(struct intel_context *intel);
|
||||||
|
|
||||||
void
|
void
|
||||||
intel_region_get_tile_masks(struct intel_region *region,
|
intel_region_get_tile_masks(struct intel_region *region,
|
||||||
uint32_t *mask_x, uint32_t *mask_y,
|
uint32_t *mask_x, uint32_t *mask_y);
|
||||||
bool map_stencil_as_y_tiled);
|
|
||||||
|
|
||||||
uint32_t
|
uint32_t
|
||||||
intel_region_get_aligned_offset(struct intel_region *region, uint32_t x,
|
intel_region_get_aligned_offset(struct intel_region *region, uint32_t x,
|
||||||
uint32_t y, bool map_stencil_as_y_tiled);
|
uint32_t y);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used with images created with image_from_names
|
* Used with images created with image_from_names
|
||||||
|
|
|
@ -278,7 +278,7 @@ intel_setup_image_from_mipmap_tree(struct intel_context *intel, __DRIimage *imag
|
||||||
|
|
||||||
intel_miptree_check_level_layer(mt, level, zoffset);
|
intel_miptree_check_level_layer(mt, level, zoffset);
|
||||||
|
|
||||||
intel_region_get_tile_masks(mt->region, &mask_x, &mask_y, false);
|
intel_region_get_tile_masks(mt->region, &mask_x, &mask_y);
|
||||||
intel_miptree_get_image_offset(mt, level, zoffset, &draw_x, &draw_y);
|
intel_miptree_get_image_offset(mt, level, zoffset, &draw_x, &draw_y);
|
||||||
|
|
||||||
image->width = mt->level[level].width;
|
image->width = mt->level[level].width;
|
||||||
|
@ -288,8 +288,7 @@ intel_setup_image_from_mipmap_tree(struct intel_context *intel, __DRIimage *imag
|
||||||
|
|
||||||
image->offset = intel_region_get_aligned_offset(mt->region,
|
image->offset = intel_region_get_aligned_offset(mt->region,
|
||||||
draw_x & ~mask_x,
|
draw_x & ~mask_x,
|
||||||
draw_y & ~mask_y,
|
draw_y & ~mask_y);
|
||||||
false);
|
|
||||||
|
|
||||||
intel_region_reference(&image->region, mt->region);
|
intel_region_reference(&image->region, mt->region);
|
||||||
}
|
}
|
||||||
|
@ -685,7 +684,7 @@ intel_from_planar(__DRIimage *parent, int plane, void *loaderPrivate)
|
||||||
image->offset = offset;
|
image->offset = offset;
|
||||||
intel_setup_image_from_dimensions(image);
|
intel_setup_image_from_dimensions(image);
|
||||||
|
|
||||||
intel_region_get_tile_masks(image->region, &mask_x, &mask_y, false);
|
intel_region_get_tile_masks(image->region, &mask_x, &mask_y);
|
||||||
if (offset & mask_x)
|
if (offset & mask_x)
|
||||||
_mesa_warning(NULL,
|
_mesa_warning(NULL,
|
||||||
"intel_create_sub_image: offset not on tile boundary");
|
"intel_create_sub_image: offset not on tile boundary");
|
||||||
|
|
Loading…
Reference in New Issue