Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/i915drm Use the scratch page, not zero...



details:   https://anonhg.NetBSD.org/src/rev/00a45c6f68cb
branches:  trunk
changeset: 329316:00a45c6f68cb
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon May 19 14:39:33 2014 +0000

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

diffstat:

 sys/external/bsd/drm2/i915drm/i915_gem_gtt.c |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r 1ea9a8532ca0 -r 00a45c6f68cb sys/external/bsd/drm2/i915drm/i915_gem_gtt.c
--- a/sys/external/bsd/drm2/i915drm/i915_gem_gtt.c      Mon May 19 10:12:19 2014 +0000
+++ b/sys/external/bsd/drm2/i915drm/i915_gem_gtt.c      Mon May 19 14:39:33 2014 +0000
@@ -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 @@
 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));
 }
 
 /*



Home | Main Index | Thread Index | Old Index