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 <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2013-01-30 09:04:10 +00:00
parent de28027ffc
commit bc8b191ef6
1 changed files with 5 additions and 0 deletions

View File

@ -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;