From ff607bc202273678eb318348a8fe157bd65c4997 Mon Sep 17 00:00:00 2001 From: Andriy Khulap Date: Fri, 20 Apr 2018 10:20:29 +0300 Subject: [PATCH] i965: Disable guardband clipping on SandyBridge for odd dimensions Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104388 Signed-off-by: Andriy Khulap --- src/mesa/drivers/dri/i965/genX_state_upload.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/mesa/drivers/dri/i965/genX_state_upload.c b/src/mesa/drivers/dri/i965/genX_state_upload.c index a69a496..e4a2fb1 100644 --- a/src/mesa/drivers/dri/i965/genX_state_upload.c +++ b/src/mesa/drivers/dri/i965/genX_state_upload.c @@ -2412,6 +2412,17 @@ brw_calculate_guardband_size(uint32_t fb_width, uint32_t fb_height, */ const float gb_size = GEN_GEN >= 7 ? 16384.0f : 8192.0f; + /* Workaround: prevent gpu hangs on SandyBridge + * by disabling guardband clipping for odd dimensions. + */ + if (GEN_GEN == 6 && (fb_width & 1 || fb_height & 1)) { + *xmin = -1.0f; + *xmax = 1.0f; + *ymin = -1.0f; + *ymax = 1.0f; + return; + } + if (m00 != 0 && m11 != 0) { /* First, we compute the screen-space render area */ const float ss_ra_xmin = MIN3( 0, m30 + m00, m30 - m00); -- 2.7.4