From c3aba45f241d9fe6857ec7b6cc6fbb7873fb6651 Mon Sep 17 00:00:00 2001 From: Eugeni Dodonov Date: Thu, 10 Nov 2011 16:01:04 -0200 Subject: Use MI_LOAD_SCAN_LINES_EXCL instead of MI_LOAD_SCAN_LINES_INCL on SNB+ The former one is gone from the hardware... Signed-off-by: Eugeni Dodonov --- src/i830_reg.h | 3 +++ src/intel_dri.c | 32 +++++++++++++++++++++++--------- src/intel_video.c | 29 +++++++++++++++++++++-------- 3 files changed, 47 insertions(+), 17 deletions(-) diff --git a/src/i830_reg.h b/src/i830_reg.h index 93d03cf3..8ac1d2bf 100644 --- a/src/i830_reg.h +++ b/src/i830_reg.h @@ -62,8 +62,11 @@ /* Set the scan line for MI_WAIT_FOR_PIPE?_SCAN_LINE_WINDOW */ #define MI_LOAD_SCAN_LINES_INCL (0x12<<23) +#define MI_LOAD_SCAN_LINES_EXCL (0x13<<23) #define MI_LOAD_SCAN_LINES_DISPLAY_PIPEA (0) #define MI_LOAD_SCAN_LINES_DISPLAY_PIPEB (0x1<<20) +/* SNB moved this register around */ +#define MI_LOAD_SCAN_LINES_DISPLAY_PIPEB_SNB (0x1<<19) /* BLT commands */ #define COLOR_BLT_CMD ((2<<29)|(0x40<<22)|(0x3)) diff --git a/src/intel_dri.c b/src/intel_dri.c index 1227dbb0..5294632f 100644 --- a/src/intel_dri.c +++ b/src/intel_dri.c @@ -514,8 +514,12 @@ I830DRI2CopyRegion(DrawablePtr drawable, RegionPtr pRegion, event = MI_WAIT_FOR_PIPEA_SVBLANK; } else { event = MI_WAIT_FOR_PIPEB_SCAN_LINE_WINDOW; - load_scan_lines_pipe = - MI_LOAD_SCAN_LINES_DISPLAY_PIPEB; + if (INTEL_INFO(intel)->gen >= 60) + load_scan_lines_pipe = + MI_LOAD_SCAN_LINES_DISPLAY_PIPEB_SNB; + else + load_scan_lines_pipe = + MI_LOAD_SCAN_LINES_DISPLAY_PIPEB; if (full_height && INTEL_INFO(intel)->gen >= 40) event = MI_WAIT_FOR_PIPEB_SVBLANK; } @@ -531,13 +535,23 @@ I830DRI2CopyRegion(DrawablePtr drawable, RegionPtr pRegion, * 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 | - load_scan_lines_pipe); - OUT_BATCH((y1 << 16) | (y2-1)); - OUT_BATCH(MI_LOAD_SCAN_LINES_INCL | - load_scan_lines_pipe); - OUT_BATCH((y1 << 16) | (y2-1)); - OUT_BATCH(MI_WAIT_FOR_EVENT | event); + if (INTEL_INFO(intel)->gen >= 60) { + OUT_BATCH(MI_LOAD_SCAN_LINES_EXCL | + load_scan_lines_pipe); + OUT_BATCH((0 << 16) | (y1-1)); + OUT_BATCH(MI_LOAD_SCAN_LINES_EXCL | + load_scan_lines_pipe); + OUT_BATCH((y1 << 16) | (y2-1)); + OUT_BATCH(MI_WAIT_FOR_EVENT | event); + } else { + OUT_BATCH(MI_LOAD_SCAN_LINES_EXCL | + load_scan_lines_pipe); + OUT_BATCH((y1 << 16) | (y2-1)); + OUT_BATCH(MI_LOAD_SCAN_LINES_EXCL | + load_scan_lines_pipe); + 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 d1d61269..4aff9ffd 100644 --- a/src/intel_video.c +++ b/src/intel_video.c @@ -1327,7 +1327,10 @@ intel_wait_for_scanline(ScrnInfoPtr scrn, PixmapPtr pixmap, if (full_height && INTEL_INFO(intel)->gen >= 40) event = MI_WAIT_FOR_PIPEA_SVBLANK; } else { - pipe = MI_LOAD_SCAN_LINES_DISPLAY_PIPEB; + if (INTEL_INFO(intel)->gen >= 60) + pipe = MI_LOAD_SCAN_LINES_DISPLAY_PIPEB_SNB; + else + pipe = MI_LOAD_SCAN_LINES_DISPLAY_PIPEB; event = MI_WAIT_FOR_PIPEB_SCAN_LINE_WINDOW; if (full_height && INTEL_INFO(intel)->gen >= 40) event = MI_WAIT_FOR_PIPEB_SVBLANK; @@ -1339,15 +1342,25 @@ intel_wait_for_scanline(ScrnInfoPtr scrn, PixmapPtr pixmap, y2 /= 2; } - BEGIN_BATCH(5); /* 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-1)); - OUT_BATCH(MI_LOAD_SCAN_LINES_INCL | pipe); - OUT_BATCH((y1 << 16) | (y2-1)); - OUT_BATCH(MI_WAIT_FOR_EVENT | event); - ADVANCE_BATCH(); + if (INTEL_INFO(intel)->gen >= 60) { + BEGIN_BATCH(5); + OUT_BATCH(MI_LOAD_SCAN_LINES_EXCL | pipe); + OUT_BATCH((0 << 16) | (y1 - 1)); + OUT_BATCH(MI_LOAD_SCAN_LINES_EXCL | pipe); + OUT_BATCH((y1 << 16) | (y2 - 1)); + OUT_BATCH(MI_WAIT_FOR_EVENT | event); + ADVANCE_BATCH(); + } else { + BEGIN_BATCH(5); + OUT_BATCH(MI_LOAD_SCAN_LINES_INCL | pipe); + OUT_BATCH((y1 << 16) | (y2 - 1)); + OUT_BATCH(MI_LOAD_SCAN_LINES_INCL | pipe); + OUT_BATCH((y1 << 16) | (y2 - 1)); + OUT_BATCH(MI_WAIT_FOR_EVENT | event); + ADVANCE_BATCH(); + } } static Bool -- cgit v1.2.3