diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2014-09-22 12:09:13 +0200 |
---|---|---|
committer | Thomas Hellstrom <thellstrom@vmware.com> | 2014-09-24 11:59:06 +0200 |
commit | 8e1c4e5bd521ec2d4f1a21da432f110c606b3fde (patch) | |
tree | 6f61d62d6a12f696290450caf42b8a7d63679667 /saa | |
parent | c23fd33d8ce8491891255d93c04e053bf333bd4e (diff) |
vmware/saa: Fix saa_check_poly_fill_rect_noreadback v2
We were not clipping the dirty region correctly, Fix this.
Also actually do what the comment in the function says: If there are more than
an ad-hoc number of rectangles to read back, then revert to the default
saa_check_poly_fill_rect function that reads back the whole damage region.
v2: Fix commit log message.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Diffstat (limited to 'saa')
-rw-r--r-- | saa/saa_unaccel.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/saa/saa_unaccel.c b/saa/saa_unaccel.c index 08a64b0..cff0587 100644 --- a/saa/saa_unaccel.c +++ b/saa/saa_unaccel.c @@ -421,17 +421,20 @@ saa_check_poly_fill_rect_noreadback(DrawablePtr pDrawable, GCPtr pGC, if (!region) goto out_no_region; - REGION_TRANSLATE(pGC->pScreen, region, xoff + pDrawable->x, - yoff + pDrawable->y); - + REGION_TRANSLATE(pGC->pScreen, region, pDrawable->x, pDrawable->y); + REGION_INTERSECT(pGC->pScreen, region, fbGetCompositeClip(pGC), region); + REGION_TRANSLATE(pGC->pScreen, region, xoff, yoff); access = SAA_ACCESS_W; if (saa_gc_reads_destination(pDrawable, pGC)) { /* * We need to do a readback anyway. In case of more than an - * ad hoc number of say 10 rectangles, we might as well do a + * ad hoc number of say 4 rectangles, we might as well do a * readback of the whole damage area to avoid fragmentation. */ + if (REGION_NUM_RECTS(region) > 4) + goto out_no_access; + access |= SAA_ACCESS_R; ret = saa_prepare_access_pixmap(pPixmap, access, region); } else @@ -451,13 +454,8 @@ saa_check_poly_fill_rect_noreadback(DrawablePtr pDrawable, GCPtr pGC, saa_finish_access_pixmap(pPixmap, access); if (spix->damage) { - /* - * Not sure why the region can be larger than the pending damage region - * at this point, (happens on clipped-away drawables). To avoid potential - * rendering problems, we clip to the pending damage region. - */ - REGION_INTERSECT(pGC->pScreen, region, region, saa_pix_damage_pending(spix)); - + REGION_INTERSECT(pGC->pScreen, region, region, + saa_pix_damage_pending(spix)); saa_pixmap_dirty(pPixmap, FALSE, region); } |