diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-06-16 12:53:22 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-06-16 12:53:22 +0100 |
commit | dd4ad11e0d432f3a8eff4574a241c16f8463278d (patch) | |
tree | c57d78178f62baf6760ba181a2dc6699a245edd8 | |
parent | 2ff36af7e1841a82fd43a9317d07b3229a309df5 (diff) |
sna: compile fix.
A pox on all those who write trivial patches, attempt to compile on a
system not having dri2proto and just assume that all is good.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_accel.c | 90 | ||||
-rw-r--r-- | src/sna/sna_dri.c | 2 |
2 files changed, 46 insertions, 46 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 0a0cd8fb..e28ce46a 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -800,6 +800,51 @@ static void sna_gc_move_to_cpu(GCPtr gc) sna_drawable_move_to_cpu(&gc->tile.pixmap->drawable, false); } +#define TRIM_BOX(box, d) do { \ + if (box.x1 < 0) box.x1 = 0; \ + if (box.x2 > d->width) box.x2 = d->width; \ + if (box.y1 < 0) box.y1 = 0; \ + if (box.y2 > d->height) box.y2 = d->height; \ +} while (0) + +#define CLIP_BOX(box, gc) \ + if (gc->pCompositeClip) { \ + BoxPtr extents = &gc->pCompositeClip->extents;\ + if (box.x1 < extents->x1) box.x1 = extents->x1; \ + if (box.x2 > extents->x2) box.x2 = extents->x2; \ + if (box.y1 < extents->y1) box.y1 = extents->y1; \ + if (box.y2 > extents->y2) box.y2 = extents->y2; \ + } + +#define TRANSLATE_BOX(box, d) do { \ + box.x1 += d->x; \ + box.x2 += d->x; \ + box.y1 += d->y; \ + box.y2 += d->y; \ +} while (0) + +#define TRIM_AND_TRANSLATE_BOX(box, d, gc) do { \ + TRIM_BOX(box, d); \ + TRANSLATE_BOX(box, d); \ + CLIP_BOX(box, gc); \ +} while (0) + +#define BOX_ADD_PT(box, x, y) do { \ + if (box.x1 > x) box.x1 = x; \ + else if (box.x2 < x) box.x2 = x; \ + if (box.y1 > y) box.y1 = y; \ + else if (box.y2 < y) box.y2 = y; \ +} while (0) + +#define BOX_ADD_RECT(box, x, y, w, h) do { \ + if (box.x1 > x) box.x1 = x; \ + else if (box.x2 < x + w) box.x2 = x + w; \ + if (box.y1 > y) box.y1 = y; \ + else if (box.y2 < y + h) box.y2 = y + h; \ +} while (0) + +#define BOX_EMPTY(box) (box.x2 <= box.x1 || box.y2 <= box.y1) + static Bool sna_put_image_upload_blt(DrawablePtr drawable, GCPtr gc, RegionPtr region, int x, int y, int w, int h, char *bits, int stride) @@ -1306,51 +1351,6 @@ sna_copy_area(DrawablePtr src, DrawablePtr dst, GCPtr gc, sna_copy_boxes, 0, NULL); } -#define TRIM_BOX(box, d) do { \ - if (box.x1 < 0) box.x1 = 0; \ - if (box.x2 > d->width) box.x2 = d->width; \ - if (box.y1 < 0) box.y1 = 0; \ - if (box.y2 > d->height) box.y2 = d->height; \ -} while (0) - -#define CLIP_BOX(box, gc) \ - if (gc->pCompositeClip) { \ - BoxPtr extents = &gc->pCompositeClip->extents;\ - if (box.x1 < extents->x1) box.x1 = extents->x1; \ - if (box.x2 > extents->x2) box.x2 = extents->x2; \ - if (box.y1 < extents->y1) box.y1 = extents->y1; \ - if (box.y2 > extents->y2) box.y2 = extents->y2; \ - } - -#define TRANSLATE_BOX(box, d) do { \ - box.x1 += d->x; \ - box.x2 += d->x; \ - box.y1 += d->y; \ - box.y2 += d->y; \ -} while (0) - -#define TRIM_AND_TRANSLATE_BOX(box, d, gc) do { \ - TRIM_BOX(box, d); \ - TRANSLATE_BOX(box, d); \ - CLIP_BOX(box, gc); \ -} while (0) - -#define BOX_ADD_PT(box, x, y) do { \ - if (box.x1 > x) box.x1 = x; \ - else if (box.x2 < x) box.x2 = x; \ - if (box.y1 > y) box.y1 = y; \ - else if (box.y2 < y) box.y2 = y; \ -} while (0) - -#define BOX_ADD_RECT(box, x, y, w, h) do { \ - if (box.x1 > x) box.x1 = x; \ - else if (box.x2 < x + w) box.x2 = x + w; \ - if (box.y1 > y) box.y1 = y; \ - else if (box.y2 < y + h) box.y2 = y + h; \ -} while (0) - -#define BOX_EMPTY(box) (box.x2 <= box.x1 || box.y2 <= box.y1) - static Bool box_intersect(BoxPtr a, const BoxPtr b) { diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c index 7516fe98..20b323e6 100644 --- a/src/sna/sna_dri.c +++ b/src/sna/sna_dri.c @@ -145,7 +145,7 @@ static struct kgem_bo *sna_pixmap_set_dri(struct sna *sna, list_add(&priv->list, &sna->dirty_pixmaps); /* The bo is outside of our control, so presume it is written to */ - priv->gpu_bo->need_flush = 1; + priv->gpu_bo->needs_flush = 1; /* We need to submit any modifications to and reads from this * buffer before we send any reply to the Client. |