Module Name:    src
Committed By:   riastradh
Date:           Mon May 19 14:39:33 UTC 2014

Modified Files:
        src/sys/external/bsd/drm2/i915drm: i915_gem_gtt.c

Log Message:
Use the scratch page, not zero, to clear ggtt entries for gen<6.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/drm2/i915drm/i915_gem_gtt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/i915drm/i915_gem_gtt.c
diff -u src/sys/external/bsd/drm2/i915drm/i915_gem_gtt.c:1.6 src/sys/external/bsd/drm2/i915drm/i915_gem_gtt.c:1.7
--- src/sys/external/bsd/drm2/i915drm/i915_gem_gtt.c:1.6	Wed May 14 15:58:24 2014
+++ src/sys/external/bsd/drm2/i915drm/i915_gem_gtt.c	Mon May 19 14:39:33 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: i915_gem_gtt.c,v 1.6 2014/05/14 15:58:24 riastradh Exp $	*/
+/*	$NetBSD: i915_gem_gtt.c,v 1.7 2014/05/19 14:39:33 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_gem_gtt.c,v 1.6 2014/05/14 15:58:24 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_gem_gtt.c,v 1.7 2014/05/19 14:39:33 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -481,13 +481,17 @@ static void
 agp_ggtt_clear_range(struct drm_device *dev, unsigned start_page,
     unsigned npages)
 {
+	struct drm_i915_private *const dev_priv = dev->dev_private;
+	struct intel_gtt *const gtt = dev_priv->mm.gtt;
+	const bus_addr_t addr = gtt->gtt_scratch_seg.ds_addr;
 	struct agp_i810_softc *const isc = agp_i810_sc->as_chipc;
 	unsigned page;
 
 	for (page = start_page; npages--; page++)
-		agp_i810_write_gtt_entry(isc, (off_t)page << PAGE_SHIFT, 0);
+		agp_i810_write_gtt_entry(isc, (off_t)page << PAGE_SHIFT,
+		    (addr | 1));
 
-	agp_i810_post_gtt_entry(isc, ((page - 1) << PAGE_SHIFT));
+	agp_i810_post_gtt_entry(isc, ((off_t)(page - 1) << PAGE_SHIFT));
 }
 
 /*

Reply via email to