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

Chris Wilson ickle at kemper.freedesktop.org
Wed Feb 4 03:07:50 PST 2015


 src/sna/sna_display.c              |    2 ++
 src/sna/sna_trapezoids_imprecise.c |   29 +++++++++++++++++++++++++++++
 src/sna/sna_trapezoids_precise.c   |   29 +++++++++++++++++++++++++++++
 3 files changed, 60 insertions(+)

New commits:
commit 5fad8d852762628770f70c6d2a7bcfbded609595
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Feb 4 11:05:00 2015 +0000

    sna: Mark initial output status as unknown
    
    References: https://bugs.freedesktop.org/show_bug.cgi?id=88960
    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 886b39f..a37362f 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -5673,6 +5673,7 @@ static bool sna_probe_initial_configuration(struct sna *sna)
 
 		crtc_id = (uintptr_t)output->crtc;
 		output->crtc = NULL;
+		output->status = XF86OutputStatusUnknown;
 		if (sna->flags & SNA_IS_SLAVED)
 			continue;
 
@@ -5713,6 +5714,7 @@ static bool sna_probe_initial_configuration(struct sna *sna)
 					   to_sna_crtc(crtc)->pipe);
 
 				output->crtc = crtc;
+				output->status = XF86OutputStatusConnected;
 				crtc->enabled = TRUE;
 
 				if (output->mm_width == 0 || output->mm_height == 0) {
commit d7bcb7bcbf96eae6f4cf131ac2bc166cd820b43e
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Feb 4 10:41:11 2015 +0000

    sna/trapezoids: Amalgamate adjacent lines
    
    If we have two scanlines with identical extents and coverage, we can
    amalgamate them into a set of multi-row boxes. For simplicity, we only
    compare with the last box (assuming that the majority of such cases are
    "rounded-rectangles" where we have a large vertical area with no
    variation and can coalesce into a single box). This operates as a second
    pass to the scanline converter itself coalescing pure-vertical regions.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_trapezoids_imprecise.c b/src/sna/sna_trapezoids_imprecise.c
index 92db92d..fc631f2 100644
--- a/src/sna/sna_trapezoids_imprecise.c
+++ b/src/sna/sna_trapezoids_imprecise.c
@@ -1722,7 +1722,21 @@ span_thread_box(struct sna *sna,
 		const BoxRec *box,
 		int coverage)
 {
+	struct span_thread_boxes *b = (struct span_thread_boxes *)op;
+
 	__DBG(("%s: %d -> %d @ %d\n", __FUNCTION__, box->x1, box->x2, coverage));
+	if (b->num_boxes) {
+		struct sna_opacity_box *bb = &b->boxes[b->num_boxes-1];
+		if (bb->box.x1 == box->x1 &&
+		    bb->box.x2 == box->x2 &&
+		    bb->box.y2 == box->y1 &&
+		    bb->alpha == AREA_TO_ALPHA(coverage)) {
+			bb->box.y2 = box->y2;
+			__DBG(("%s: contracted double row: %d -> %d\n", __func__, bb->box.y1, bb->box.y2));
+			return;
+		}
+	}
+
 	span_thread_add_boxes(sna, op, box, 1, AREA_TO_ALPHA(coverage));
 }
 
@@ -1741,11 +1755,26 @@ span_thread_clipped_box(struct sna *sna,
 	pixman_region_init_rects(&region, box, 1);
 	RegionIntersect(&region, &region, clip);
 	if (region_num_rects(&region)) {
+		struct span_thread_boxes *b = (struct span_thread_boxes *)op;
+
+		if (region.data == NULL && b->num_boxes) {
+			struct sna_opacity_box *bb = &b->boxes[b->num_boxes-1];
+			if (bb->box.x1 == region.extents.x1 &&
+			    bb->box.x2 == region.extents.x2 &&
+			    bb->box.y2 == region.extents.y1 &&
+			    bb->alpha == AREA_TO_ALPHA(coverage)) {
+				bb->box.y2 = region.extents.y2;
+				__DBG(("%s: contracted double row: %d -> %d\n", __func__, bb->box.y1, bb->box.y2));
+				goto out;
+			}
+		}
+
 		span_thread_add_boxes(sna, op,
 				      region_rects(&region),
 				      region_num_rects(&region),
 				      AREA_TO_ALPHA(coverage));
 	}
+out:
 	pixman_region_fini(&region);
 }
 
diff --git a/src/sna/sna_trapezoids_precise.c b/src/sna/sna_trapezoids_precise.c
index 9187ab4..53f61d1 100644
--- a/src/sna/sna_trapezoids_precise.c
+++ b/src/sna/sna_trapezoids_precise.c
@@ -1670,7 +1670,21 @@ span_thread_box(struct sna *sna,
 		const BoxRec *box,
 		int coverage)
 {
+	struct span_thread_boxes *b = (struct span_thread_boxes *)op;
+
 	__DBG(("%s: %d -> %d @ %d\n", __FUNCTION__, box->x1, box->x2, coverage));
+	if (b->num_boxes) {
+		struct sna_opacity_box *bb = &b->boxes[b->num_boxes-1];
+		if (bb->box.x1 == box->x1 &&
+		    bb->box.x2 == box->x2 &&
+		    bb->box.y2 == box->y1 &&
+		    bb->alpha == AREA_TO_FLOAT(coverage)) {
+			bb->box.y2 = box->y2;
+			__DBG(("%s: contracted double row: %d -> %d\n", __func__, bb->box.y1, bb->box.y2));
+			return;
+		}
+	}
+
 	span_thread_add_boxes(sna, op, box, 1, AREA_TO_FLOAT(coverage));
 }
 
@@ -1689,11 +1703,26 @@ span_thread_clipped_box(struct sna *sna,
 	pixman_region_init_rects(&region, box, 1);
 	RegionIntersect(&region, &region, clip);
 	if (region_num_rects(&region)) {
+		struct span_thread_boxes *b = (struct span_thread_boxes *)op;
+
+		if (region.data == NULL && b->num_boxes) {
+			struct sna_opacity_box *bb = &b->boxes[b->num_boxes-1];
+			if (bb->box.x1 == region.extents.x1 &&
+			    bb->box.x2 == region.extents.x2 &&
+			    bb->box.y2 == region.extents.y1 &&
+			    bb->alpha == AREA_TO_FLOAT(coverage)) {
+				bb->box.y2 = region.extents.y2;
+				__DBG(("%s: contracted double row: %d -> %d\n", __func__, bb->box.y1, bb->box.y2));
+				goto out;
+			}
+		}
+
 		span_thread_add_boxes(sna, op,
 				      region_rects(&region),
 				      region_num_rects(&region),
 				      AREA_TO_FLOAT(coverage));
 	}
+out:
 	pixman_region_fini(&region);
 }
 


More information about the xorg-commit mailing list