summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugeni Dodonov <eugeni.dodonov@intel.com>2011-11-10 16:01:04 -0200
committerEugeni Dodonov <eugeni.dodonov@intel.com>2011-11-14 11:57:20 -0200
commitc3aba45f241d9fe6857ec7b6cc6fbb7873fb6651 (patch)
tree0e8b259258681ce73a21bf5a36032f7d6d64d478
parent3252b46e115e6cc46abbcc4f502feeb9edc31ad6 (diff)
Use MI_LOAD_SCAN_LINES_EXCL instead of MI_LOAD_SCAN_LINES_INCL on SNB+snb-tearing
The former one is gone from the hardware... Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
-rw-r--r--src/i830_reg.h3
-rw-r--r--src/intel_dri.c32
-rw-r--r--src/intel_video.c29
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