xf86-video-intel: 3 commits - src/sna/kgem.c src/sna/sna_display.c src/sna/sna.h src/sna/sna_tiling.c

Chris Wilson ickle at kemper.freedesktop.org
Thu Mar 7 15:05:49 PST 2013


 src/sna/kgem.c        |    8 ++++++++
 src/sna/sna.h         |    3 ---
 src/sna/sna_display.c |    7 -------
 src/sna/sna_tiling.c  |   17 +++++++++++++++--
 4 files changed, 23 insertions(+), 12 deletions(-)

New commits:
commit dcd52d0c186e8b17569335338232298fbbea2b2d
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Mar 7 23:03:52 2013 +0000

    sna: Fallback if we cannot fit the tiling copy into the aperture
    
    If we cannot fit the source/destination and a tile into the aperture,
    then we cannot perform the copy and must do it using the CPU.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_tiling.c b/src/sna/sna_tiling.c
index 5bebf00..019b50a 100644
--- a/src/sna/sna_tiling.c
+++ b/src/sna/sna_tiling.c
@@ -690,7 +690,7 @@ bool sna_tiling_blt_copy_boxes(struct sna *sna, uint8_t alu,
 {
 	RegionRec region, tile, this;
 	struct kgem_bo *bo;
-	int step;
+	int max_size, step;
 	bool ret = false;
 
 	if (!kgem_bo_can_blt(&sna->kgem, src_bo) ||
@@ -703,14 +703,27 @@ bool sna_tiling_blt_copy_boxes(struct sna *sna, uint8_t alu,
 		return false;
 	}
 
+	max_size = sna->kgem.aperture_high * PAGE_SIZE;
+	max_size -= MAX(kgem_bo_size(src_bo), kgem_bo_size(dst_bo));
+	if (max_size <= 0) {
+		DBG(("%s: tiles cannot fit into aperture\n", __FUNCTION__));
+		return false;
+	}
+	if (max_size > sna->kgem.max_copy_tile_size)
+		max_size = sna->kgem.max_copy_tile_size;
+
 	pixman_region_init_rects(&region, box, nbox);
 
 	/* Use a small step to accommodate enlargement through tile alignment */
 	step = sna->render.max_3d_size;
 	if (region.extents.x1 & (8*512 / bpp - 1) || region.extents.y1 & 63)
 		step /= 2;
-	while (step * step * 4 > sna->kgem.max_copy_tile_size)
+	while (step * step * 4 > max_size)
 		step /= 2;
+	if (step == 0) {
+		DBG(("%s: tiles cannot fit into aperture\n", __FUNCTION__));
+		return false;
+	}
 
 	DBG(("%s (alu=%d), tile.size=%d, box=%dx[(%d, %d), (%d, %d)])\n",
 	     __FUNCTION__, alu, step, nbox,
commit 50d0ea02b3908156534fc00def55cfca30bbfecc
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Mar 7 22:58:21 2013 +0000

    sna: Trim tile sizes to fit aperture constraints
    
    This is especially important with gen2 where we have no unmappable GTT
    to utilise.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 16f60bb..6933b47 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -1149,10 +1149,18 @@ void kgem_init(struct kgem *kgem, int fd, struct pci_device *dev, unsigned gen)
 		kgem->max_upload_tile_size = kgem->aperture_mappable / 4;
 	if (kgem->max_upload_tile_size > half_gpu_max)
 		kgem->max_upload_tile_size = half_gpu_max;
+	if (kgem->max_upload_tile_size > kgem->aperture_high/2)
+		kgem->max_upload_tile_size = kgem->aperture_high/2;
+	if (kgem->max_upload_tile_size > kgem->aperture_low)
+		kgem->max_upload_tile_size = kgem->aperture_low;
 
 	kgem->large_object_size = MAX_CACHE_SIZE;
 	if (kgem->large_object_size > kgem->max_gpu_size)
 		kgem->large_object_size = kgem->max_gpu_size;
+	if (kgem->max_copy_tile_size > kgem->aperture_high/2)
+		kgem->max_copy_tile_size = kgem->aperture_high/2;
+	if (kgem->max_copy_tile_size > kgem->aperture_low)
+		kgem->max_copy_tile_size = kgem->aperture_low;
 
 	if (kgem->has_llc | kgem->has_cacheing | kgem->has_userptr) {
 		if (kgem->large_object_size > kgem->max_cpu_size)
commit cd1c14b172b0794f744b304f59b4fc78f0d6f8d6
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Mar 7 10:16:19 2013 +0000

    sna: Remove the unused output and crtc lists
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna.h b/src/sna/sna.h
index 8f26be9..a244b97 100644
--- a/src/sna/sna.h
+++ b/src/sna/sna.h
@@ -239,9 +239,6 @@ struct sna {
 		DamagePtr shadow_damage;
 		struct kgem_bo *shadow;
 		int shadow_flip;
-
-		struct list outputs;
-		struct list crtcs;
 	} mode;
 
 	struct sna_dri {
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 710d783..5d14af7 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -1571,8 +1571,6 @@ sna_crtc_init(ScrnInfoPtr scrn, struct sna_mode *mode, int num)
 	DBG(("%s: created handle=%d for cursor on CRTC:%d\n",
 	     __FUNCTION__, sna_crtc->cursor, sna_crtc->id));
 
-	list_add(&sna_crtc->link, &mode->crtcs);
-
 	DBG(("%s: attached crtc[%d] id=%d, pipe=%d\n",
 	     __FUNCTION__, num, sna_crtc->id, sna_crtc->pipe));
 }
@@ -2307,8 +2305,6 @@ sna_output_init(ScrnInfoPtr scrn, struct sna_mode *mode, int num)
 	output->possible_clones = enc.possible_clones;
 	output->interlaceAllowed = TRUE;
 
-	list_add(&sna_output->link, &mode->outputs);
-
 	return;
 
 cleanup_output:
@@ -2648,9 +2644,6 @@ bool sna_mode_pre_init(ScrnInfoPtr scrn, struct sna *sna)
 	struct sna_mode *mode = &sna->mode;
 	int i;
 
-	list_init(&mode->crtcs);
-	list_init(&mode->outputs);
-
 	mode->kmode = drmModeGetResources(sna->kgem.fd);
 	if (!mode->kmode)
 		return sna_mode_fake_init(sna);


More information about the xorg-commit mailing list