mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Andrey Smirnov <andrew.smirnov@gmail.com>,
	barebox@lists.infradead.org, Chris Healy <cphealy@gmail.com>,
	Nikita Yushchenko <nikita.yoush@cogentembedded.com>
Subject: [PATCH 2/3] fbtest: add solid pattern
Date: Thu, 12 Oct 2017 20:52:27 +0300	[thread overview]
Message-ID: <20171012175228.16710-2-nikita.yoush@cogentembedded.com> (raw)
In-Reply-To: <20171012175228.16710-1-nikita.yoush@cogentembedded.com>

This just fills entire screen with single color, as passed in -c
argument in RRGGBB format.

Suggested-by: Chris Healy <cphealy@gmail.com>
Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
---
 commands/fbtest.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/commands/fbtest.c b/commands/fbtest.c
index ca6ec2199..9981c1319 100644
--- a/commands/fbtest.c
+++ b/commands/fbtest.c
@@ -9,6 +9,15 @@
 #include <linux/gcd.h>
 #include <int_sqrt.h>
 
+static void fbtest_pattern_solid(struct screen *sc, u32 color)
+{
+	const u8 r = (color >> 16) & 0xff;
+	const u8 g = (color >>  8) & 0xff;
+	const u8 b = (color >>  0) & 0xff;
+
+	gu_fill_rectangle(sc, 0, 0, -1, -1, r, g, b, 0xff);
+}
+
 static void fbtest_pattern_bars(struct screen *sc, u32 unused)
 {
 	int i;
@@ -122,6 +131,7 @@ static int do_fbtest(int argc, char *argv[])
 		const char *name;
 		void (*func) (struct screen *sc, u32 color);
 	} patterns[] = {
+		{ "solid",    fbtest_pattern_solid    },
 		{ "geometry", fbtest_pattern_geometry },
 		{ "bars",     fbtest_pattern_bars     }
 	};
@@ -191,8 +201,8 @@ BAREBOX_CMD_HELP_TEXT("This command displays a test pattern on a screen")
 BAREBOX_CMD_HELP_TEXT("")
 BAREBOX_CMD_HELP_TEXT("Options:")
 BAREBOX_CMD_HELP_OPT ("-d <fbdev>\t",    "framebuffer device (default /dev/fb0)")
-BAREBOX_CMD_HELP_OPT ("-c color\t", "color")
-BAREBOX_CMD_HELP_OPT ("-p pattern\t", "pattern name (geometry, bars)")
+BAREBOX_CMD_HELP_OPT ("-c color\t", "color, in hex RRGGBB format")
+BAREBOX_CMD_HELP_OPT ("-p pattern\t", "pattern name (solid, geometry, bars)")
 BAREBOX_CMD_HELP_END
 
 BAREBOX_CMD_START(fbtest)
-- 
2.11.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2017-10-12 17:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-12 17:52 [PATCH 1/3] 2d-primitives: fix missing pixel in gu_draw_line() Nikita Yushchenko
2017-10-12 17:52 ` Nikita Yushchenko [this message]
2017-10-12 17:52 ` [PATCH 3/3] fbtest: add gradients pattern Nikita Yushchenko
2017-10-13 13:20   ` Sam Ravnborg
2017-10-16  7:20     ` Sascha Hauer
2017-10-12 18:30 ` [PATCH 1/3] 2d-primitives: fix missing pixel in gu_draw_line() Chris Healy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171012175228.16710-2-nikita.yoush@cogentembedded.com \
    --to=nikita.yoush@cogentembedded.com \
    --cc=andrew.smirnov@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=cphealy@gmail.com \
    --cc=s.hauer@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox