summaryrefslogtreecommitdiff
path: root/src/sna
diff options
context:
space:
mode:
Diffstat (limited to 'src/sna')
-rw-r--r--src/sna/sna_display.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 12f1e8d2..251d305b 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -4366,6 +4366,7 @@ sna_cursor_pre_init(struct sna *sna)
uint64_t name;
uint64_t value;
} cap;
+ int v;
if (sna->mode.num_real_crtc == 0)
return;
@@ -4374,6 +4375,8 @@ sna_cursor_pre_init(struct sna *sna)
#define DRM_CAP_CURSOR_WIDTH 8
#define DRM_CAP_CURSOR_HEIGHT 9
+#define I915_PARAM_HAS_COHERENT_PHYS_GTT 29
+
sna->cursor.max_size = 64;
cap.value = 0;
@@ -4387,7 +4390,17 @@ sna_cursor_pre_init(struct sna *sna)
assert(sna->cursor.max_size == cap.value);
#endif
- sna->cursor.use_gtt = sna->kgem.gen >= 033;
+ v = -1; /* No param uses the sign bit, reserve it for errors */
+ if (sna->kgem.gen >= 033) {
+ v = 1;
+ } else {
+ drm_i915_getparam_t gp = {
+ I915_PARAM_HAS_COHERENT_PHYS_GTT,
+ &v,
+ };
+ (void)drmIoctl(sna->kgem.fd, DRM_IOCTL_I915_GETPARAM, &gp);
+ }
+ sna->cursor.use_gtt = v > 0;
DBG(("%s: cursor updates use_gtt?=%d\n",
__FUNCTION__, sna->cursor.use_gtt));