tests/gem_partial_pwrite_pread: don't trash gtt unnecessarily
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 6 Dec 2011 15:57:53 +0000 (16:57 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 6 Dec 2011 15:57:53 +0000 (16:57 +0100)
On chips that don't have a unmappable gtt part it's utterly pointless.

Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
lib/intel_chipset.h
tests/gem_partial_pwrite_pread.c

index 35edaf7..668bf59 100755 (executable)
 #define IS_945(devid)          (devid == PCI_CHIP_I945_G || \
                                 devid == PCI_CHIP_I945_GM || \
                                 devid == PCI_CHIP_I945_GME || \
-                                devid == PCI_CHIP_G33_G || \
+                                IS_G33(devid))
+
+#define IS_G33(devid)          (devid == PCI_CHIP_G33_G || \
                                 devid == PCI_CHIP_Q33_G || \
                                 devid == PCI_CHIP_Q35_G || IS_IGD(devid))
 
index 57076cf..e00167f 100644 (file)
@@ -124,7 +124,8 @@ blt_bo_fill(drm_intel_bo *tmp_bo, drm_intel_bo *bo, int val)
 
        drm_intel_gem_bo_unmap_gtt(tmp_bo);
 
-       if (bo->offset < num_trash_bos*1024*1024)
+       if (bo->offset < num_trash_bos*1024*1024 &&
+           (IS_G33(devid) || intel_gen(devid) >= 4))
                trash_aperture();
 
        copy_bo(tmp_bo, bo);