xf86-video-intel: 2 commits - src/sna/kgem.c src/sna/sna_display.c

Chris Wilson ickle at kemper.freedesktop.org
Wed Feb 25 05:00:49 PST 2015


 src/sna/kgem.c        |    8 ++++----
 src/sna/sna_display.c |    5 +++--
 2 files changed, 7 insertions(+), 6 deletions(-)

New commits:
commit 6bf6b4b7509768d10bf31128ce6e52cb060fd177
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Feb 25 11:25:10 2015 +0000

    sna: Check types on querying RAM
    
    Turns out to be a false alarm as the machine I was looking at only had
    4GiB. I thought I was looking at another one and started panicking about
    where had all the memory gone...
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 94f881c..2cc2c74 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -920,11 +920,11 @@ total_ram_size(void)
 #ifdef HAVE_STRUCT_SYSINFO_TOTALRAM
 	struct sysinfo info;
 	if (sysinfo(&info) == 0)
-		return info.totalram * info.mem_unit;
+		return (size_t)info.totalram * info.mem_unit;
 #endif
 
 #ifdef _SC_PHYS_PAGES
-	 return sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGE_SIZE);
+	 return (size_t)sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGE_SIZE);
 #endif
 
 	return 0;
@@ -1657,7 +1657,7 @@ void kgem_init(struct kgem *kgem, int fd, struct pci_device *dev, unsigned gen)
 		kgem->aperture_high /= 2;
 		kgem->aperture_low /= 2;
 	}
-	DBG(("%s: aperture low=%d [%d], high=%d [%d]\n", __FUNCTION__,
+	DBG(("%s: aperture low=%u [%u], high=%u [%u]\n", __FUNCTION__,
 	     kgem->aperture_low, kgem->aperture_low / (1024*1024),
 	     kgem->aperture_high, kgem->aperture_high / (1024*1024)));
 
@@ -1695,7 +1695,7 @@ void kgem_init(struct kgem *kgem, int fd, struct pci_device *dev, unsigned gen)
 		     __FUNCTION__));
 		totalram = kgem->aperture_total;
 	}
-	DBG(("%s: total ram=%ld\n", __FUNCTION__, (long)totalram));
+	DBG(("%s: total ram=%lld\n", __FUNCTION__, (long long)totalram));
 	if (kgem->max_object_size > totalram / 2)
 		kgem->max_object_size = totalram / 2;
 	if (kgem->max_gpu_size > totalram / 4)
commit 41e559f57e5284462ffb46f8617aeb9f56f97937
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Feb 25 09:01:25 2015 +0000

    sna: Update the active_scanout flags on async flips
    
    In order to keep our sanity checks and buffers in order, we need to
    remember to mark the new frontbuffer as the active scanout after an
    asynchronous pageflip.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index d7f5500..c3cc6ba 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -5501,6 +5501,7 @@ sna_page_flip(struct sna *sna,
 			     crtc_offset, crtc->offset));
 fixup_flip:
 			if (crtc->bo != bo && sna_crtc_flip(sna, crtc, bo, crtc->base->x, crtc->base->y)) {
+update_scanout:
 				DBG(("%s: removing handle=%d [active_scanout=%d] from scanout, installing handle=%d [active_scanout=%d]\n",
 				     __FUNCTION__, crtc->bo->handle, crtc->bo->active_scanout,
 				     bo->handle, bo->active_scanout));
@@ -5596,8 +5597,8 @@ retry_flip:
 
 			DBG(("%s: recording flip on CRTC:%d handle=%d, active_scanout=%d, serial=%d\n",
 			     __FUNCTION__, crtc->id, crtc->flip_bo->handle, crtc->flip_bo->active_scanout, crtc->flip_serial));
-		}
-
+		} else
+			goto update_scanout;
 next_crtc:
 		count++;
 	}


More information about the xorg-commit mailing list