From c881616cfbbd8c20d67f469d363254b2c56a12b7 Mon Sep 17 00:00:00 2001
From: Vito Caputo <vcaputo@pengaru.com>
Date: Wed, 27 Apr 2022 13:46:04 -0700
Subject: til_fb: til_fb_fragment_t.{pitch,stride} uint32_t units

Originally it seemed sensible to make these units of bytes, for
flexibility reasons.

But it's advantageous for everything to be able to assume pixels
are always 4-byte/32-bit aligned.  Having the stride/pitch be in
bytes of units made it theoretically possible to produce
unaligned rows of pixels, which would break that assumption.

I don't think anything was ever actually producing such things,
and I've added some asserts to the {sdl,drm}_fb.c page
acquisition code to go fatal on such pages.

This change required going through all the modules and get rid of
their uint32_t vs. void* dances and other such 1-byte vs. 4-byte
scaling arithmetic.

Code is simpler now, and probably faster in some cases.  And now
allows future work to just assume things cna always occur 4-bytes
at a time without concern for unaligned accesses.
---
 src/modules/roto/roto.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

(limited to 'src/modules/roto')

diff --git a/src/modules/roto/roto.c b/src/modules/roto/roto.c
index 5409970..65b3400 100644
--- a/src/modules/roto/roto.c
+++ b/src/modules/roto/roto.c
@@ -240,11 +240,10 @@ static void roto_render_fragment(void *context, unsigned ticks, unsigned cpu, ti
 			x_sin_r += sin_r;
 		}
 
-		buf = ((void *)buf) + fragment->stride;
+		buf += fragment->stride;
 		y_cos_r += cos_r;
 		y_sin_r += sin_r;
 	}
-
 }
 
 
-- 
cgit v1.2.3