From bc8b191ef6f5030d17a3b6497d1fd7556756c1ff Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 30 Jan 2013 09:04:10 +0000 Subject: [PATCH] sna: Return early if the Drawable box exactly matches one CRTC If we are trying to find the best coverage, then by definition if the drawable is an exact match for one CRTC, we can stop looking. Signed-off-by: Chris Wilson --- src/sna/sna_display.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index 307e7637..e7eeb44d 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -2739,6 +2739,11 @@ sna_covering_crtc(ScrnInfoPtr scrn, __FUNCTION__, c, crtc->bounds.x1, crtc->bounds.y1, crtc->bounds.x2, crtc->bounds.y2)); + if (*(const uint64_t *)box == *(uint64_t *)&crtc->bounds) { + DBG(("%s: box exactly matches crtc [%d]\n", + __FUNCTION__, c)); + return crtc; + } if (!sna_box_intersect(&cover_box, &crtc->bounds, box)) continue;