summaryrefslogtreecommitdiff
path: root/src/sna
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-03-30 20:45:55 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-03-30 22:02:08 +0100
commit6f2814db6f7b89e94e54b8d73c7e176ab7d1c469 (patch)
treee1b6cf58d444ab5a30f4c8ca8bc3ac103d55ccce /src/sna
parentee075ced844350785685a0f93f88f1dc310bcc73 (diff)
sna/traps: Align the pointer+index
It's the location of the pixels within the row that matter for alignment! Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47418 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Tested-by: Magnus Kessler <Magnus.Kessler@gmx.net>
Diffstat (limited to 'src/sna')
-rw-r--r--src/sna/sna_trapezoids.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/sna/sna_trapezoids.c b/src/sna/sna_trapezoids.c
index b6c5b653..2b4b2dbb 100644
--- a/src/sna/sna_trapezoids.c
+++ b/src/sna/sna_trapezoids.c
@@ -1490,42 +1490,42 @@ inplace_row(struct active_list *active, uint8_t *row, int width)
if (rix > ++lix) {
rix -= lix;
+ row += lix;
#if 0
if (rix == 1)
- row[lix] = 0xff;
+ *row = 0xff;
else
- memset(row+lix, 0xff, rix);
+ memset(row, 0xff, rix);
#else
if ((uintptr_t)row & 1 && rix) {
- row[lix] = 0xff;
- lix++;
+ *row++ = 0xff;
rix--;
}
if ((uintptr_t)row & 2 && rix >= 2) {
- *(uint16_t *)(row+lix) = 0xffff;
- lix += 2;
+ *(uint16_t *)row = 0xffff;
+ row += 2;
rix -= 2;
}
if ((uintptr_t)row & 4 && rix >= 4) {
- *(uint32_t *)(row+lix) = 0xffffffff;
- lix += 4;
+ *(uint32_t *)row = 0xffffffff;
+ row += 4;
rix -= 4;
}
while (rix >= 8) {
- *(uint64_t *)(row+lix) = 0xffffffffffffffff;
- lix += 8;
+ *(uint64_t *)row = 0xffffffffffffffff;
+ row += 8;
rix -= 8;
}
if (rix & 4) {
- *(uint32_t *)(row+lix) = 0xffffffff;
- lix += 4;
+ *(uint32_t *)row = 0xffffffff;
+ row += 4;
}
if (rix & 2) {
- *(uint16_t *)(row+lix) = 0xffff;
- lix += 2;
+ *(uint16_t *)row = 0xffff;
+ row += 2;
}
if (rix & 1)
- row[lix] = 0xff;
+ *row = 0xff;
#endif
}
}