Skip to contentSkip to conversation

commands: implement 'fbputs' command

RFC In review Antony Pavlov 4 participants 6 messages Jan 25, 2015 – Feb 2, 2015

lore
Share & tools
lore
#0 lore raw

RFC 1/1 commands: implement 'fbputs' command

Mainline barebox at the moment has no framebuffer
console support.
The 'fbputs' demo command displays a text string
on fb device.

This quick-n-dirty patch demonstates that barebox
framebuffer console can be easely realized.

I'm awaiting your comments!

fbputs mini-HOWTO
=================

1. compile sandbox barebox with

CONFIG_VIDEO=y
CONFIG_DRIVER_VIDEO_SDL=y
CONFIG_CMD_SPLASH=y

2. run barebox

3. test fbputs

fb0.enable=1
fbputs "Hello, world!"

Cc Sascha Hauer <[email protected]>
Cc Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
---
 commands/Makefile         |    1 +
 commands/fbputs.c         |  141 ++
 include/video_font_data.h | 4627 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 4769 insertions(+)
commands/Makefile +1 -0
index 99a65d4..0a304aa 100644
@@ -56,6 +56,7 @@ obj-$(CONFIG_CMD_HELP)		+= help.o
 obj-$(CONFIG_CMD_LSMOD)		+= lsmod.o
 obj-$(CONFIG_CMD_INSMOD)	+= insmod.o
 obj-$(CONFIG_CMD_SPLASH)	+= splash.o
+obj-$(CONFIG_CMD_SPLASH)	+= fbputs.o
 obj-$(CONFIG_USB_GADGET_DFU)	+= dfu.o
 obj-$(CONFIG_USB_GADGET_SERIAL)	+= usbserial.o
 obj-$(CONFIG_CMD_GPIO)		+= gpio.o
commands/fbputs.c new file +141 -0

141 lines not on this page · raw message

include/video_font_data.h new file +4627 -0

2,852 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 7 lines
2.1.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

Part of the diff is not shown here. View the raw message.

#1 lore raw
Quoted 9 lines · Antony Pavlov

Mainline barebox at the moment has no framebuffer
console support.
The 'fbputs' demo command displays a text string
on fb device.

This quick-n-dirty patch demonstates that barebox
framebuffer console can be easely realized.

I'm awaiting your comments!

Unfortunately real console support is not that simple, we would have to parse ANSI escape sequences up to some point to make it generally usable.

Jean Christophe has framebuffer console patches, he'll probably comment on this one aswell.
Personally I would be fine with your simple approach until real console support arrives.

commands/fbputs.c line 68

Quoted 9 lines
commands/fbputs.c new file +9 -0
+static void drawchar(struct screen *sc, int x, int y, char c)
+{
+	void *buf;
+
+	buf = gui_screen_redering_buffer(sc);
+
+	rgba_blend(&sc->info, chars[(int)c],
+		buf, VIDEO_FONT_HEIGHT, VIDEO_FONT_WIDTH,
+		VIDEO_FONT_WIDTH * x, VIDEO_FONT_HEIGHT * y, 1);

Is this performant enough? I would assume the whole character set should be prerendered for the actual framebuffer format before printing a string.

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw
Quoted 14 lines · Sascha Hauer
Quoted 9 lines · Antony Pavlov

Mainline barebox at the moment has no framebuffer
console support.
The 'fbputs' demo command displays a text string
on fb device.

This quick-n-dirty patch demonstates that barebox
framebuffer console can be easely realized.

I'm awaiting your comments!

Quoted 7 lines

Unfortunately real console support is not that simple, we would have to parse ANSI escape sequences up to some point to make it generally usable.

Jean Christophe has framebuffer console patches, he'll probably comment on this one aswell.
Personally I would be fine with your simple approach until real console support arrives.

Yes I have the framebuffer console support and yes you do need to have the ANSI support and it’s not that easy

I’m sick those days will take a look later this will when feel better

Quoted 14 lines

commands/fbputs.c line 68

Quoted 10 lines
commands/fbputs.c new file +9 -0
+static void drawchar(struct screen *sc, int x, int y, char c)
+{
+	void *buf;
+
+	buf = gui_screen_redering_buffer(sc);
+
+	rgba_blend(&sc->info, chars[(int)c],
+		buf, VIDEO_FONT_HEIGHT, VIDEO_FONT_WIDTH,
+		VIDEO_FONT_WIDTH * x, VIDEO_FONT_HEIGHT * y, 1);

Is this performant enough? I would assume the whole character set should be prerendered for the actual framebuffer format before printing a string.

no so much way too slow

Best Regards,
J.

Quoted 9 lines

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#3 lore raw
Quoted 16 lines · On Mon, 26 Jan 2015 16:55:40 +0800 Jean-Christophe PLAGNIOL-VILLARD…
Quoted 16 lines · Sascha Hauer
Quoted 9 lines · Antony Pavlov

Mainline barebox at the moment has no framebuffer
console support.
The 'fbputs' demo command displays a text string
on fb device.

This quick-n-dirty patch demonstates that barebox
framebuffer console can be easely realized.

I'm awaiting your comments!

Unfortunately real console support is not that simple, we would have to parse ANSI escape sequences up to some point to make it generally usable.

Quoted 8 lines
Quoted 4 lines

Jean Christophe has framebuffer console patches, he'll probably comment on this one aswell.
Personally I would be fine with your simple approach until real console support arrives.

Yes I have the framebuffer console support and yes you do need to have the ANSI support and it’s not that easy

Are your planning add your framebuffer console patches to mainline barebox?

--
Best regards,
  Antony Pavlov

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#4 lore raw
In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 17 lines · On Mon, 26 Jan 2015 16:55:40 +0800 Jean-Christophe PLAGNIOL-VILLARD…
Quoted 17 lines · Sascha Hauer
Quoted 9 lines · Antony Pavlov

Mainline barebox at the moment has no framebuffer
console support.
The 'fbputs' demo command displays a text string
on fb device.

This quick-n-dirty patch demonstates that barebox
framebuffer console can be easely realized.

I'm awaiting your comments!

Unfortunately real console support is not that simple, we would have to parse ANSI escape sequences up to some point to make it generally usable.

Quoted 9 lines
Quoted 4 lines

Jean Christophe has framebuffer console patches, he'll probably comment on this one aswell.
Personally I would be fine with your simple approach until real console support arrives.

Yes I have the framebuffer console support and yes you do need to have the ANSI support and it’s not that easy

Are your planning add your framebuffer console patches to mainline barebox?

What is about your raspberry-pi patchseries?

--
Best regards,
  Antony Pavlov

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#5 lore raw
In reply to Antony Pavlov

Hi,

Quoted 10 lines · Antony Pavlov

Mainline barebox at the moment has no framebuffer
console support.
The 'fbputs' demo command displays a text string
on fb device.

This quick-n-dirty patch demonstates that barebox
framebuffer console can be easely realized.

I'm awaiting your comments!

this mail is not related to your fputs implementation but I had some really nice idea if we get a console framebuffer feature.

My friend Werner Almesberger build ~4 years ago a solution for bitbanging VGA on a SD card slot and he said that this should probaly work on each SD card controller (if you have more than one or just booting from other source than sd card).

There was a hackaday article about that [0]. Some embedded boards don't have any video output but an sd card output.

So over some self builded SD to VGA cables everyone gets framebuffer support in babrebox, he makes all stuff open. See [1]. There exist also some software parts at [2] to support this interface under linux.

Maybe, we can grab some stuff there and add a generic barebox framebuffer driver to do some VGA to SD card slot connection. (Don't know how much possible that is currently).

... or I just getting into a crazy idea to support a cool framebuffer interface. I mean, we don't need fancy color stuff or doing a very fast interface, just printing some fonts stuff.

There exist also some "version 2 of this SD card slot to VGA connection" see [3].

- Alex

[0] http://hackaday.com/2011/05/10/bit-banging-vga-from-an-sd-card-slot/
[1] http://downloads.qi-hardware.com/people/werner/ubb/vga/web/
[2] http://projects.qi-hardware.com/index.php/p/ben-blinkenlights/source/tree/master/ubb-vga
[3] http://discussion.en.qi-hardware.narkive.com/XyzZEmPH/ubb-vga-version-2-first-impression

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox