sna: Reduce the downsample tile size to accommodate alignment
If we need to enlarge the sampled tile due to tiling alignments, the resulting sample can become larger than we can accommodate through the 3D pipeline, resulting in FAIL. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
93a0b10f16
commit
2653524dff
|
|
@ -622,7 +622,7 @@ static int sna_render_picture_downsample(struct sna *sna,
|
|||
struct sna_pixmap *priv;
|
||||
pixman_transform_t t;
|
||||
PixmapPtr tmp;
|
||||
int width, height;
|
||||
int width, height, size;
|
||||
int sx, sy, ox, oy, ow, oh;
|
||||
int error, ret = 0;
|
||||
BoxRec box, b;
|
||||
|
|
@ -743,8 +743,13 @@ static int sna_render_picture_downsample(struct sna *sna,
|
|||
ValidatePicture(tmp_dst);
|
||||
ValidatePicture(tmp_src);
|
||||
|
||||
w = sna->render.max_3d_size / sx - 2 * sx;
|
||||
h = sna->render.max_3d_size / sy - 2 * sy;
|
||||
/* Use a small size to accommodate enlargement through tile alignment */
|
||||
size = sna->render.max_3d_size - 4096 / pixmap->drawable.bitsPerPixel;
|
||||
while (size * size * 4 > sna->kgem.max_copy_tile_size)
|
||||
size /= 2;
|
||||
|
||||
w = size / sx - 2 * sx;
|
||||
h = size / sy - 2 * sy;
|
||||
DBG(("%s %d:%d downsampling using %dx%d GPU tiles\n",
|
||||
__FUNCTION__, (width + w-1)/w, (height + h-1)/h, w, h));
|
||||
|
||||
|
|
|
|||
|
|
@ -142,7 +142,8 @@ sna_tiling_composite_done(struct sna *sna,
|
|||
|
||||
/* Use a small step to accommodate enlargement through tile alignment */
|
||||
step = sna->render.max_3d_size;
|
||||
if (tile->dst_x & (8*512 / tile->dst->pDrawable->bitsPerPixel - 1))
|
||||
if (tile->dst_x & (8*512 / tile->dst->pDrawable->bitsPerPixel - 1) ||
|
||||
tile->dst_y & 63)
|
||||
step /= 2;
|
||||
while (step * step * 4 > sna->kgem.max_copy_tile_size)
|
||||
step /= 2;
|
||||
|
|
@ -330,7 +331,11 @@ sna_tiling_fill_boxes(struct sna *sna,
|
|||
|
||||
pixman_region_init_rects(®ion, box, n);
|
||||
|
||||
/* Use a small step to accommodate enlargement through tile alignment */
|
||||
step = sna->render.max_3d_size;
|
||||
if (region.extents.x1 & (8*512 / dst->drawable.bitsPerPixel - 1) ||
|
||||
region.extents.y1 & 63)
|
||||
step /= 2;
|
||||
while (step * step * 4 > sna->kgem.max_copy_tile_size)
|
||||
step /= 2;
|
||||
|
||||
|
|
@ -443,7 +448,10 @@ Bool sna_tiling_blt_copy_boxes(struct sna *sna, uint8_t alu,
|
|||
|
||||
pixman_region_init_rects(®ion, box, nbox);
|
||||
|
||||
/* Use a small step to accommodate enlargement through tile alignment */
|
||||
step = sna->render.max_3d_size;
|
||||
if (region.extents.x1 & (8*512 / bpp - 1) || region.extents.y1 & 63)
|
||||
step /= 2;
|
||||
while (step * step * 4 > sna->kgem.max_copy_tile_size)
|
||||
step /= 2;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue