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

Chris Wilson ickle at kemper.freedesktop.org
Mon Feb 20 01:53:37 PST 2012


 src/sna/kgem.c    |   23 ++++++++++++++---------
 src/sna/sna_dri.c |   31 +++++++++++++++++++------------
 2 files changed, 33 insertions(+), 21 deletions(-)

New commits:
commit 7f0a4a5f7224003a0cd226137de5a068949a41b4
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Feb 20 09:52:37 2012 +0000

    sna/dri: Ensure the domain tracking is reset when releasing bo used for swaps
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
index 0689fc5..2a25cbd 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -710,6 +710,14 @@ sna_dri_add_frame_event(struct sna_dri_frame_event *info)
 }
 
 static void
+sna_dri_frame_event_release_bo(struct kgem *kgem, struct kgem_bo *bo)
+{
+	bo->needs_flush = true; /* has been used externally, reset domains */
+	bo->reusable = true; /* No longer in use by an external client */
+	kgem_bo_destroy(kgem, bo);
+}
+
+static void
 sna_dri_frame_event_info_free(struct sna_dri_frame_event *info)
 {
 	DBG(("%s: del[%p] (%p, %ld)\n", __FUNCTION__,
@@ -721,18 +729,17 @@ sna_dri_frame_event_info_free(struct sna_dri_frame_event *info)
 	_sna_dri_destroy_buffer(info->sna, info->front);
 	_sna_dri_destroy_buffer(info->sna, info->back);
 
-	if (info->old_front.bo) {
-		info->old_front.bo->reusable = true;
-		kgem_bo_destroy(&info->sna->kgem, info->old_front.bo);
-	}
-	if (info->next_front.bo) {
-		info->next_front.bo->reusable = true;
-		kgem_bo_destroy(&info->sna->kgem, info->next_front.bo);
-	}
-	if (info->cache.bo) {
-		info->cache.bo->reusable = true;
-		kgem_bo_destroy(&info->sna->kgem, info->cache.bo);
-	}
+	if (info->old_front.bo)
+		sna_dri_frame_event_release_bo(&info->sna->kgem,
+					       info->old_front.bo);
+
+	if (info->next_front.bo)
+		sna_dri_frame_event_release_bo(&info->sna->kgem,
+					       info->next_front.bo);
+
+	if (info->cache.bo)
+		sna_dri_frame_event_release_bo(&info->sna->kgem,
+					       info->cache.bo);
 
 	free(info);
 }
commit 7d147c7462ba183f5316e7e8dafeca62add6f97c
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sun Feb 19 17:50:56 2012 +0000

    sna: Correct tile sizes for Y-tiling on i915g
    
    128-byte Y-tiling wasn't introduced until the 945.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index f20a7bb..f107f14 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -731,11 +731,16 @@ static uint32_t kgem_untiled_pitch(struct kgem *kgem,
 void kgem_get_tile_size(struct kgem *kgem, int tiling,
 			int *tile_width, int *tile_height, int *tile_size)
 {
-	if (kgem->gen < 30) {
+	if (kgem->gen <= 30) {
 		if (tiling) {
 			*tile_width = 512;
-			*tile_height = 16;
-			*tile_size = 2048;
+			if (kgem->gen < 30) {
+				*tile_height = 16;
+				*tile_size = 2048;
+			} else {
+				*tile_height = 8;
+				*tile_size = 4096;
+			}
 		} else {
 			*tile_width = 1;
 			*tile_height = 1;
@@ -754,7 +759,7 @@ void kgem_get_tile_size(struct kgem *kgem, int tiling,
 		*tile_size = 4096;
 		break;
 	case I915_TILING_Y:
-		*tile_width = kgem->gen <= 30 ? 512 : 128;
+		*tile_width = 128;
 		*tile_height = 32;
 		*tile_size = 4096;
 		break;
@@ -776,10 +781,10 @@ static uint32_t kgem_surface_size(struct kgem *kgem,
 	assert(width <= MAXSHORT);
 	assert(height <= MAXSHORT);
 
-	if (kgem->gen < 30) {
+	if (kgem->gen <= 30) {
 		if (tiling) {
 			tile_width = 512;
-			tile_height = 16;
+			tile_height = kgem->gen < 30 ? 16 : 8;
 		} else {
 			tile_width = scanout ? 64 : kgem->min_alignment;
 			tile_height = 2;
@@ -795,7 +800,7 @@ static uint32_t kgem_surface_size(struct kgem *kgem,
 		tile_height = 8;
 		break;
 	case I915_TILING_Y:
-		tile_width = kgem->gen <= 30 ? 512 : 128;
+		tile_width = 128;
 		tile_height = 32;
 		break;
 	}
@@ -837,8 +842,8 @@ static uint32_t kgem_aligned_height(struct kgem *kgem,
 {
 	uint32_t tile_height;
 
-	if (kgem->gen < 30) {
-		tile_height = tiling ? 16 : 2;
+	if (kgem->gen <= 30) {
+		tile_height = tiling ? kgem->gen < 30 ? 16 : 8 : 1;
 	} else switch (tiling) {
 	default:
 	case I915_TILING_NONE:


More information about the xorg-commit mailing list