const unsigned hw_screen_offset_alignment =
ctx->chip_class >= VI ? 16 : MAX2(ctx->screen->se_tile_repeat, 16);
- hw_screen_offset_x = MIN2(hw_screen_offset_x, hw_screen_offset_max);
- hw_screen_offset_y = MIN2(hw_screen_offset_y, hw_screen_offset_max);
+ hw_screen_offset_x = CLAMP(hw_screen_offset_x, 0, hw_screen_offset_max);
+ hw_screen_offset_y = CLAMP(hw_screen_offset_y, 0, hw_screen_offset_max);
/* Align the screen offset by dropping the low 4 bits. */
hw_screen_offset_x &= ~(hw_screen_offset_alignment - 1);