diff --git a/src/gallium/drivers/lima/lima_state.c b/src/gallium/drivers/lima/lima_state.c index 145b98a4736667021a35bbd03773a5494589318a..24080a6130be13c04eaa5e4c79b20dc042073fa5 100644 --- a/src/gallium/drivers/lima/lima_state.c +++ b/src/gallium/drivers/lima/lima_state.c @@ -61,16 +61,16 @@ lima_set_framebuffer_state(struct pipe_context *pctx, fb->width = framebuffer->width; fb->height = framebuffer->height; - fb->shift_h = 0; - fb->shift_w = 0; - fb->shift_max = 0; - int width = align(framebuffer->width, 16) >> 4; int height = align(framebuffer->height, 16) >> 4; if (fb->tiled_w != width || fb->tiled_h != height) { fb->tiled_w = width; fb->tiled_h = height; + fb->shift_h = 0; + fb->shift_w = 0; + fb->shift_max = 0; + int limit = ctx->plb_max_blk; while ((width * height) > limit) { if (width >= height) {