From fa0cd3d8df547622e4a46244e430b4776145de21 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 25 Mar 2011 10:46:14 +0000 Subject: [PATCH] MI_LOAD_SCAN_LINES_INCL are inclusive and range [0, display height-1] We have seen GPU hangs with: batchbuffer at 0x0f9b4000: 0x0f9b4000: 0x09000000: MI_LOAD_SCAN_LINES_INCL 0x0f9b4004: 0x00000300: dword 1 0x0f9b4008: 0x09000000: MI_LOAD_SCAN_LINES_INCL 0x0f9b400c: 0x00000300: dword 1 0x0f9b4010: 0x01820000: MI_WAIT_FOR_EVENT 0x0f9b4014: HEAD 0x02000006: MI_FLUSH on a 1366x768 display. That according to the specs an invalid command for the pipe. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=35576 Signed-off-by: Chris Wilson --- src/intel_dri.c | 4 ++-- src/intel_video.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/intel_dri.c b/src/intel_dri.c index 16e42f1..e0835c8 100644 --- a/src/intel_dri.c +++ b/src/intel_dri.c @@ -497,10 +497,10 @@ I830DRI2CopyRegion(DrawablePtr drawable, RegionPtr pRegion, */ OUT_BATCH(MI_LOAD_SCAN_LINES_INCL | load_scan_lines_pipe); - OUT_BATCH((y1 << 16) | y2); + OUT_BATCH((y1 << 16) | y2-1); OUT_BATCH(MI_LOAD_SCAN_LINES_INCL | load_scan_lines_pipe); - OUT_BATCH((y1 << 16) | y2); + OUT_BATCH((y1 << 16) | y2-1); OUT_BATCH(MI_WAIT_FOR_EVENT | event); ADVANCE_BATCH(); } diff --git a/src/intel_video.c b/src/intel_video.c index 5294f73..f007918 100644 --- a/src/intel_video.c +++ b/src/intel_video.c @@ -1358,9 +1358,9 @@ intel_wait_for_scanline(ScrnInfoPtr scrn, PixmapPtr pixmap, /* The documentation says that the LOAD_SCAN_LINES command * always comes in pairs. Don't ask me why. */ OUT_BATCH(MI_LOAD_SCAN_LINES_INCL | pipe); - OUT_BATCH((y1 << 16) | y2); + OUT_BATCH((y1 << 16) | y2-1); OUT_BATCH(MI_LOAD_SCAN_LINES_INCL | pipe); - OUT_BATCH((y1 << 16) | y2); + OUT_BATCH((y1 << 16) | y2-1); OUT_BATCH(MI_WAIT_FOR_EVENT | event); ADVANCE_BATCH(); } -- 1.7.4.1