From 7db08a73d497862ebd5c5cc5b209ff4e178fe805 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Mon, 25 Apr 2022 15:41:04 -0700 Subject: modules/swarm: use put_pixel_checked() to stop segfaulting During rtv runs we'd occasionally segfault in the unchecked line drawing. This needs to be fixed, but for now just go slower. --- src/modules/swarm/swarm.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/modules/swarm') diff --git a/src/modules/swarm/swarm.c b/src/modules/swarm/swarm.c index cc27c36..0271693 100644 --- a/src/modules/swarm/swarm.c +++ b/src/modules/swarm/swarm.c @@ -338,6 +338,7 @@ static void swarm_draw_as_points(swarm_context_t *ctxt, til_fb_fragment_t *fragm } +/* though this is called _unchecked(), it's temporarily _checked() due to random segfaults. */ static void draw_line_unchecked(til_fb_fragment_t *fragment, int x1, int y1, int x2, int y2, uint32_t color) { int x_delta = x2 - x1; @@ -355,8 +356,8 @@ static void draw_line_unchecked(til_fb_fragment_t *fragment, int x1, int y1, int y1 += sdy; minor -= x_delta; } - - til_fb_fragment_put_pixel_unchecked(fragment, x1, y1, color); + /* XXX FIXME: segfaults occasionally when _unchecked !!! */ + til_fb_fragment_put_pixel_checked(fragment, x1, y1, color); } } else { /* Y-major */ @@ -366,7 +367,8 @@ static void draw_line_unchecked(til_fb_fragment_t *fragment, int x1, int y1, int minor -= y_delta; } - til_fb_fragment_put_pixel_unchecked(fragment, x1, y1, color); + /* XXX FIXME: segfaults occasionally when _unchecked !!! */ + til_fb_fragment_put_pixel_checked(fragment, x1, y1, color); } } } -- cgit v1.2.3