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 Work around broken GTT size de...



details:   https://anonhg.NetBSD.org/src/rev/1cc3205892b9
branches:  trunk
changeset: 329578:1cc3205892b9
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Thu May 29 22:05:24 2014 +0000

description:
Work around broken GTT size detection in agp_i810 code.

This will do until I work out the twisty maze of registers, all
different, to reliably determine the size of the GTT (and hence the
GPU's virtual address space) separately from the size of the AGP
aperture.

diffstat:

 sys/external/bsd/drm2/i915drm/i915_gem_gtt.c |  13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diffs (34 lines):

diff -r fab54a15690a -r 1cc3205892b9 sys/external/bsd/drm2/i915drm/i915_gem_gtt.c
--- a/sys/external/bsd/drm2/i915drm/i915_gem_gtt.c      Thu May 29 21:15:55 2014 +0000
+++ b/sys/external/bsd/drm2/i915drm/i915_gem_gtt.c      Thu May 29 22:05:24 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_gem_gtt.c,v 1.13 2014/05/28 15:44:02 riastradh Exp $      */
+/*     $NetBSD: i915_gem_gtt.c,v 1.14 2014/05/29 22:05:24 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.13 2014/05/28 15:44:02 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_gem_gtt.c,v 1.14 2014/05/29 22:05:24 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -405,7 +405,14 @@
        gtt->gma_bus_addr = agp_i810_sc->as_apaddr;
        gtt->gtt_mappable_entries = (agp_i810_sc->as_apsize >> AGP_PAGE_SHIFT);
        gtt->stolen_size = (isc->stolen << AGP_PAGE_SHIFT);
-       gtt->gtt_total_entries = isc->gtt_size/4;
+
+       /*
+        * XXX Not quite right -- on some devices (i965), there are
+        * more entries in the GTT than fit in the aperture.  However,
+        * this is a safe approximation until we work out the fake AGP
+        * code to detect the correct number of GTT entries.
+        */
+       gtt->gtt_total_entries = gtt->gtt_mappable_entries;
 
        product = PCI_PRODUCT(dev->pdev->pd_pa.pa_id);
        if (((product == PCI_PRODUCT_INTEL_IRONLAKE_M_HB) ||



Home | Main Index | Thread Index | Old Index