mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: "barebox@lists.infradead.org" <barebox@lists.infradead.org>,
	Andrey Gusakov <andrey.gusakov@cogentembedded.com>
Subject: Re: [PATCH 3/3] GUI: Add fbtest command
Date: Thu, 23 Jun 2016 20:21:45 -0700	[thread overview]
Message-ID: <CAHQ1cqEt6EjZ6Y1ARfJt+jnjo1J_of+0VFqUYO60_752eyMAww@mail.gmail.com> (raw)
In-Reply-To: <20160623062237.GG4750@pengutronix.de>

On Wed, Jun 22, 2016 at 11:22 PM, Sascha Hauer <s.hauer@pengutronix.de> wrote:
> On Tue, Jun 21, 2016 at 09:39:29PM -0700, Andrey Smirnov wrote:
>> Add 'fbtest' - a command to produce test patterns on a screen
>>
>> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
>> Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
>> ---
>>  commands/Kconfig  |   9 +++
>>  commands/Makefile |   1 +
>>  commands/fbtest.c | 187 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>  3 files changed, 197 insertions(+)
>>  create mode 100644 commands/fbtest.c
>>
>> diff --git a/commands/Kconfig b/commands/Kconfig
>> index 880cd45..107cc3e 100644
>> --- a/commands/Kconfig
>> +++ b/commands/Kconfig
>> @@ -1417,6 +1417,15 @@ config CMD_SPLASH
>>                 -b COLOR      background color in 0xttrrggbb
>>                 -o            render offscreen
>>
>
>> +
>> +static int do_fbtest(int argc, char *argv[])
>> +{
>> +     struct screen *sc;
>> +     int opt, i;
>> +     const char *pattern_name = NULL;
>> +     char *fbdev = "/dev/fb0";
>> +     void (*pattern) (struct screen *sc, u32 color) = NULL;
>> +     u32 color = 0xffffff;
>> +
>> +     struct {
>> +             const char *name;
>> +             void (*func) (struct screen *sc, u32 color);
>> +     } patterns[] = {
>> +             { "geometry", fbtest_pattern_geometry },
>> +             { "bars",     fbtest_pattern_bars     }
>> +     };
>> +
>> +     while((opt = getopt(argc, argv, "d:p:c:")) > 0) {
>> +             switch(opt) {
>> +             case 'd':
>> +                     fbdev = optarg;
>> +                     break;
>> +             case 'p':
>> +                     pattern_name = optarg;
>> +                     break;
>> +             case 'c':
>> +                     color = simple_strtoul(optarg, NULL, 16);
>> +                     break;
>> +             }
>> +     }
>> +
>> +     if (!pattern_name) {
>> +             printf("No pattern name specified\n");
>> +             return -EINVAL;
>> +     }
>
> Maybe we can iterate over the patterns if no pattern is given like the
> Linux variant does?
>

I like this idea, I wasn't able to find the source code of a fbtest
version that does that, so I am not sure if I'll match the behavior
exactly. I'll make it loop over patterns and wait for Ctrl-C in v2 if
no pattern is given.

Thanks,
Andrey

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

  reply	other threads:[~2016-06-24  3:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-22  4:39 [PATCH 1/3] GUI: Add a function to draw solid rectangles Andrey Smirnov
2016-06-22  4:39 ` [PATCH 2/3] GUI: Add code to draw simple graphics Andrey Smirnov
2016-06-23  7:30   ` Holger Schurig
2016-06-24  4:57     ` Andrey Smirnov
2016-06-22  4:39 ` [PATCH 3/3] GUI: Add fbtest command Andrey Smirnov
2016-06-22 10:49   ` Antony Pavlov
2016-06-24  4:50     ` Andrey Smirnov
2016-06-22 10:57   ` Antony Pavlov
2016-06-24  3:18     ` Andrey Smirnov
2016-06-23  6:22   ` Sascha Hauer
2016-06-24  3:21     ` Andrey Smirnov [this message]
2016-06-23  7:31   ` Holger Schurig
2016-06-23  9:28     ` Sascha Hauer
2016-06-24  4:49     ` Andrey Smirnov
2016-06-23  7:28 ` [PATCH 1/3] GUI: Add a function to draw solid rectangles Holger Schurig
2016-06-24  5:00   ` Andrey Smirnov

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=CAHQ1cqEt6EjZ6Y1ARfJt+jnjo1J_of+0VFqUYO60_752eyMAww@mail.gmail.com \
    --to=andrew.smirnov@gmail.com \
    --cc=andrey.gusakov@cogentembedded.com \
    --cc=barebox@lists.infradead.org \
    --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