Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5189>
yoff = key->miny;
memset(tile_n, 0, sizeof(tile_n));
for (i = 0; i < nbins_y; i++) {
- uint32_t bw, bh;
+ int bw, bh;
xoff = key->minx;
/* clip bin height: */
bh = MIN2(gmem->bin_h, key->miny + key->height - yoff);
+ assert(bh > 0);
for (j = 0; j < nbins_x; j++) {
struct fd_tile *tile = &gmem->tile[t];
/* clip bin width: */
bw = MIN2(gmem->bin_w, key->minx + key->width - xoff);
+ assert(bw > 0);
+
tile->n = !is_a20x(screen) ? tile_n[p]++ :
((i % tpp_y + 1) << 3 | (j % tpp_x + 1));
tile->p = p;
key.gmem_page_align = gpu_info->gmem_page_align;
struct fd_gmem_stateobj *gmem = gmem_stateobj_init(&screen, &key);
dump_gmem_state(gmem);
+
+ assert((gmem->bin_w * gmem->nbins_x) >= key.width);
+ assert((gmem->bin_h * gmem->nbins_y) >= key.height);
+
ralloc_free(gmem);
}