xf86-video-intel: 2 commits - src/sna/sna_dri.c
Chris Wilson
ickle at kemper.freedesktop.org
Fri Jun 29 09:24:04 PDT 2012
src/sna/sna_dri.c | 66 ++++++++++++++++++++++++++----------------------------
1 file changed, 32 insertions(+), 34 deletions(-)
New commits:
commit abd7be1cee6f2f494a11cd9d2e7888c3043ffc02
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Fri Jun 29 15:32:10 2012 +0100
sna/dri: Prefer GPU rendering if no more CPU damage on a DRI bo
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
index 87ddba0..f01de17 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -397,21 +397,16 @@ static void damage(PixmapPtr pixmap, RegionPtr region)
if (region == NULL) {
damage_all:
- sna_damage_all(&priv->gpu_damage,
- pixmap->drawable.width,
- pixmap->drawable.height);
+ priv->gpu_damage = _sna_damage_all(priv->gpu_damage,
+ pixmap->drawable.width,
+ pixmap->drawable.height);
sna_damage_destroy(&priv->cpu_damage);
priv->undamaged = false;
} else {
- BoxPtr box = RegionExtents(region);
- if (region->data == NULL &&
- box->x1 <= 0 && box->y1 <= 0 &&
- box->x2 >= pixmap->drawable.width &&
- box->y2 >= pixmap->drawable.height)
+ sna_damage_subtract(&priv->cpu_damage, region);
+ if (priv->cpu_damage == NULL)
goto damage_all;
-
sna_damage_add(&priv->gpu_damage, region);
- sna_damage_subtract(&priv->cpu_damage, region);
}
}
commit 67b87e4f7cf6c3ab9cfccc9fe43a824bfe84f393
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Fri Jun 29 15:03:12 2012 +0100
sna/dri: Optimise clip reduction with copy-to-front to an unclipped Window
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
index dddcc73..87ddba0 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -451,18 +451,18 @@ sna_dri_copy_to_front(struct sna *sna, DrawablePtr draw, RegionPtr region,
struct kgem_bo *bo = NULL;
bool flush = false;
xf86CrtcPtr crtc;
- BoxRec box, *boxes;
+ BoxRec *boxes;
int16_t dx, dy;
int n;
- box.x1 = draw->x;
- box.y1 = draw->y;
- box.x2 = draw->x + draw->width;
- box.y2 = draw->y + draw->height;
+ clip.extents.x1 = draw->x;
+ clip.extents.y1 = draw->y;
+ clip.extents.x2 = draw->x + draw->width;
+ clip.extents.y2 = draw->y + draw->height;
+ clip.data = NULL;
if (region) {
pixman_region_translate(region, draw->x, draw->y);
- pixman_region_init_rects(&clip, &box, 1);
pixman_region_intersect(&clip, &clip, region);
region = &clip;
@@ -476,28 +476,32 @@ sna_dri_copy_to_front(struct sna *sna, DrawablePtr draw, RegionPtr region,
if (draw->type != DRAWABLE_PIXMAP) {
WindowPtr win = (WindowPtr)draw;
- DBG(("%s: draw=(%d, %d), delta=(%d, %d), clip.extents=(%d, %d), (%d, %d)\n",
- __FUNCTION__, draw->x, draw->y,
- get_drawable_dx(draw), get_drawable_dy(draw),
- win->clipList.extents.x1, win->clipList.extents.y1,
- win->clipList.extents.x2, win->clipList.extents.y2));
+ if (win->clipList.data ||
+ win->clipList.extents.x2 - win->clipList.extents.x1 != draw->width ||
+ win->clipList.extents.y2 - win->clipList.extents.y1 != draw->height) {
+ DBG(("%s: draw=(%d, %d), delta=(%d, %d), clip.extents=(%d, %d), (%d, %d)\n",
+ __FUNCTION__, draw->x, draw->y,
+ get_drawable_dx(draw), get_drawable_dy(draw),
+ win->clipList.extents.x1, win->clipList.extents.y1,
+ win->clipList.extents.x2, win->clipList.extents.y2));
+
+ if (region == NULL)
+ region = &clip;
+
+ pixman_region_intersect(&clip, &win->clipList, region);
+ if (!pixman_region_not_empty(&clip)) {
+ DBG(("%s: all clipped\n", __FUNCTION__));
+ return NULL;
+ }
- if (region == NULL) {
- pixman_region_init_rects(&clip, &box, 1);
region = &clip;
}
- pixman_region_intersect(region, &win->clipList, region);
- if (!pixman_region_not_empty(region)) {
- DBG(("%s: all clipped\n", __FUNCTION__));
- return NULL;
- }
-
if (sync && sna_pixmap_is_scanout(sna, pixmap)) {
- crtc = sna_covering_crtc(sna->scrn, ®ion->extents, NULL);
+ crtc = sna_covering_crtc(sna->scrn, &clip.extents, NULL);
if (crtc)
flush = sna_wait_for_scanline(sna, pixmap, crtc,
- ®ion->extents);
+ &clip.extents);
}
get_drawable_deltas(draw, pixmap, &dx, &dy);
@@ -525,9 +529,8 @@ sna_dri_copy_to_front(struct sna *sna, DrawablePtr draw, RegionPtr region,
n = REGION_NUM_RECTS(region);
assert(n);
} else {
- pixman_region_init_rects(&clip, &box, 1);
region = &clip;
- boxes = &box;
+ boxes = &clip.extents;
n = 1;
}
sna->render.copy_boxes(sna, GXcopy,
@@ -546,7 +549,7 @@ sna_dri_copy_to_front(struct sna *sna, DrawablePtr draw, RegionPtr region,
DamageRegionAppend(&pixmap->drawable, region);
DamageRegionProcessPending(&pixmap->drawable);
- if (region == &clip)
+ if (clip.data)
pixman_region_fini(&clip);
return bo;
More information about the xorg-commit
mailing list