From c3a8d77a2b6806a69de87fbaadea8612ef5f91dd Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 19 Dec 2011 16:51:29 +0000 Subject: [PATCH] sna: Tune the inplace cross-over point to be half-cache size The theory being that we will also require cache space to copy from when uploading into the shadow. Signed-off-by: Chris Wilson --- src/sna/kgem.c | 2 +- src/sna/kgem.h | 2 +- src/sna/sna_accel.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sna/kgem.c b/src/sna/kgem.c index 41aded66..2d0b3442 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -467,7 +467,7 @@ void kgem_init(struct kgem *kgem, int fd, struct pci_device *dev, int gen) kgem->wedged = drmCommandNone(kgem->fd, DRM_I915_GEM_THROTTLE) == -EIO; kgem->wedged |= DBG_NO_HW; - kgem->cpu_cache_pages = cpu_cache_size() >> 12; + kgem->half_cpu_cache_pages = cpu_cache_size() >> 13; list_init(&kgem->partial); list_init(&kgem->requests); diff --git a/src/sna/kgem.h b/src/sna/kgem.h index efc4e807..42a0ba46 100644 --- a/src/sna/kgem.h +++ b/src/sna/kgem.h @@ -130,7 +130,7 @@ struct kgem { uint32_t has_relaxed_fencing :1; uint16_t fence_max; - uint16_t cpu_cache_pages; + uint16_t half_cpu_cache_pages; uint32_t aperture_high, aperture_low, aperture; uint32_t aperture_fenced, aperture_mappable; uint32_t max_object_size; diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index e00f6202..39aebb67 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -621,7 +621,7 @@ static inline bool pixmap_inplace(struct sna *sna, return true; return (pixmap->devKind * pixmap->drawable.height >> 12) > - sna->kgem.cpu_cache_pages; + sna->kgem.half_cpu_cache_pages; } bool @@ -783,7 +783,7 @@ static inline bool region_inplace(struct sna *sna, return ((region->extents.x2 - region->extents.x1) * (region->extents.y2 - region->extents.y1) * pixmap->drawable.bitsPerPixel >> 15) - > sna->kgem.cpu_cache_pages; + > sna->kgem.half_cpu_cache_pages; } bool