static unsigned
div_align(unsigned num, unsigned denom, unsigned al)
{
- return align(DIV_ROUND_UP(num, denom), al);
+ return util_align_npot(DIV_ROUND_UP(num, denom), al);
}
static bool
return false;
uint32_t bin_w, bin_h;
- bin_w = div_align(key->width, nbins_x, screen->gmem_alignw);
- bin_h = div_align(key->height, nbins_y, screen->gmem_alignh);
+ bin_w = div_align(key->width, nbins_x, screen->tile_alignw);
+ bin_h = div_align(key->height, nbins_y, screen->tile_alignh);
gmem->bin_w = bin_w;
gmem->bin_h = bin_h;
for (i = 0; i < MAX_RENDER_TARGETS; i++) {
if (key->cbuf_cpp[i]) {
- gmem->cbuf_base[i] = align(total, gmem_align);
+ gmem->cbuf_base[i] = util_align_npot(total, gmem_align);
total = gmem->cbuf_base[i] + key->cbuf_cpp[i] * bin_w * bin_h;
}
}
if (key->zsbuf_cpp[0]) {
- gmem->zsbuf_base[0] = align(total, gmem_align);
+ gmem->zsbuf_base[0] = util_align_npot(total, gmem_align);
total = gmem->zsbuf_base[0] + key->zsbuf_cpp[0] * bin_w * bin_h;
}
if (key->zsbuf_cpp[1]) {
- gmem->zsbuf_base[1] = align(total, gmem_align);
+ gmem->zsbuf_base[1] = util_align_npot(total, gmem_align);
total = gmem->zsbuf_base[1] + key->zsbuf_cpp[1] * bin_w * bin_h;
}
/* first, find a bin width that satisfies the maximum width
* restrictions:
*/
- while (div_align(key->width, nbins_x, screen->gmem_alignw) > max_width) {
+ while (div_align(key->width, nbins_x, screen->tile_alignw) > max_width) {
nbins_x++;
}
key->cbuf_cpp[i] *= pfb->samples;
}
- if ((fd_mesa_debug & FD_DBG_NOSCIS) || no_scis_opt) {
+ /* NOTE: on a6xx, the max-scissor-rect is handled in fd6_gmem, and
+ * we just rely on CP_COND_EXEC to skip bins with no geometry.
+ */
+ if (no_scis_opt || is_a6xx(screen)) {
key->minx = 0;
key->miny = 0;
key->width = pfb->width;
} else {
struct pipe_scissor_state *scissor = &batch->max_scissor;
+ if (fd_mesa_debug & FD_DBG_NOSCIS) {
+ scissor->minx = 0;
+ scissor->miny = 0;
+ scissor->maxx = pfb->width;
+ scissor->maxy = pfb->height;
+ }
+
/* round down to multiple of alignment: */
key->minx = scissor->minx & ~(screen->gmem_alignw - 1);
key->miny = scissor->miny & ~(screen->gmem_alignh - 1);
*/
key->gmem_page_align = 8;
} else if (is_a6xx(screen)) {
- key->gmem_page_align = 1;
+ key->gmem_page_align = is_a650(screen) ? 3 : 1;
} else {
// TODO re-check this across gens.. maybe it should only
// be a single page in some cases: