# HG changeset patch # User Paul Boddie # Date 1456588767 -3600 # Node ID bbc1b33982e05be2cc4ac7b2068ecd41bf49938f # Parent ca013d9f19c1806943016345d8678e73141549ed Permit different test patterns. diff -r ca013d9f19c1 -r bbc1b33982e0 stage2/irq.c --- a/stage2/irq.c Sat Feb 27 16:53:47 2016 +0100 +++ b/stage2/irq.c Sat Feb 27 16:59:27 2016 +0100 @@ -62,7 +62,7 @@ { while (1) { if (pixel_type) - test_pixel(x, y); + test_pixel(x, y, pixel_type); else clear_pixel(x, y); next_pixel(&x, &y); @@ -108,7 +108,7 @@ void start_task(unsigned short task) { - u32 args[] = {1, 0, (task - 1) * 120}; + u32 args[] = {task, 0, (task - 1) * 60}; u32 virtual, physical; /* diff -r ca013d9f19c1 -r bbc1b33982e0 stage2/lcd.c --- a/stage2/lcd.c Sat Feb 27 16:53:47 2016 +0100 +++ b/stage2/lcd.c Sat Feb 27 16:59:27 2016 +0100 @@ -69,72 +69,72 @@ return (div(r, 255, rmax) << rshift) | (div(g, 255, gmax) << gshift) | (div(b, 255, bmax) << bshift); } -static void get_colour(unsigned short h, unsigned short v, u8 rgb[]) +static void get_colour(unsigned short h, unsigned short v, u8 rgb[], unsigned short pixel_type) { unsigned short v_max = panel_info.vl_row; unsigned short h_max = panel_info.vl_col; - rgb[0] = div(h, h_max, 255); - rgb[1] = div(v, v_max, 255); - rgb[2] = (rgb[0] + rgb[1]) / 2; + rgb[(pixel_type - 1) % 3] = div(h, h_max, 255); + rgb[pixel_type % 3] = div(v, v_max, 255); + rgb[(pixel_type + 1) % 3] = (rgb[0] + rgb[1]) / 2; } -static void test_pixel32(unsigned short h, unsigned short v) +static void test_pixel32(unsigned short h, unsigned short v, unsigned short pixel_type) { u32 *pix = get_pixel32(h, v); u8 rgb[3]; - get_colour(h, v, rgb); + get_colour(h, v, rgb, pixel_type); *pix = (u32) pixel(rgb[0], rgb[1], rgb[2], 255, 255, 255, 16, 8, 0); } -static void test_pixel16_565(unsigned short h, unsigned short v) +static void test_pixel16_565(unsigned short h, unsigned short v, unsigned short pixel_type) { u16 *pix = get_pixel16(h, v); u8 rgb[3]; - get_colour(h, v, rgb); + get_colour(h, v, rgb, pixel_type); *pix = (u16) pixel(rgb[0], rgb[1], rgb[2], 31, 63, 31, 11, 5, 0); } -static void test_pixel8(unsigned short h, unsigned short v) +static void test_pixel8(unsigned short h, unsigned short v, unsigned short pixel_type) { u8 *pix = get_pixel8(h, v); u8 rgb[3]; - get_colour(h, v, rgb); + get_colour(h, v, rgb, pixel_type); *pix = (u8) pixel(rgb[0], rgb[1], rgb[2], 7, 7, 3, 5, 2, 0); } -static void test_pixel4(unsigned short h, unsigned short v) +static void test_pixel4(unsigned short h, unsigned short v, unsigned short pixel_type) { u8 *pix = get_pixel4(h, v); u8 mask = h & 1 ? 0xf0 : 0x0f; u8 rgb[3]; - get_colour(h, v, rgb); + get_colour(h, v, rgb, pixel_type); *pix = (*pix & mask) | ((u8) pixel(rgb[0], rgb[1], rgb[2], 1, 2, 1, 3, 1, 0) << (h & 1 ? 0 : 4)); } -void test_pixel(unsigned short h, unsigned short v) +void test_pixel(unsigned short h, unsigned short v, unsigned short pixel_type) { switch (panel_info.vl_bpix) { case LCD_COLOR32: - test_pixel32(h, v); + test_pixel32(h, v, pixel_type); break; case LCD_COLOR8: - test_pixel8(h, v); + test_pixel8(h, v, pixel_type); break; case LCD_COLOR4: - test_pixel4(h, v); + test_pixel4(h, v, pixel_type); break; case LCD_COLOR16: default: - test_pixel16_565(h, v); + test_pixel16_565(h, v, pixel_type); break; } } @@ -195,7 +195,7 @@ for (v = 0; v < v_max; v += 1) { for (h = 0; h < h_max; h += 1) { - test_pixel(h, v); + test_pixel(h, v, 1); } } } diff -r ca013d9f19c1 -r bbc1b33982e0 stage2/lcd.h --- a/stage2/lcd.h Sat Feb 27 16:53:47 2016 +0100 +++ b/stage2/lcd.h Sat Feb 27 16:59:27 2016 +0100 @@ -7,7 +7,7 @@ /* Output functions. */ -void test_pixel(unsigned short h, unsigned short v); +void test_pixel(unsigned short h, unsigned short v, unsigned short pixel_type); void clear_pixel(unsigned short h, unsigned short v); void test_pattern();