Bookstore

Recent

Author Topic: A good talk on using the Linux Framebuffer (FOSDEM 2020)  (Read 791 times)

WayneSherman

  • Jr. Member
  • **
  • Posts: 70
A good talk on using the Linux Framebuffer (FOSDEM 2020)
« on: February 09, 2020, 06:46:03 am »
Back to the Linux Framebuffer!
Linux Framebuffer support in free software

https://fosdem.org/2020/schedule/event/fbdev/

WayneSherman

  • Jr. Member
  • **
  • Posts: 70
Re: A good talk on using the Linux Framebuffer (FOSDEM 2020)
« Reply #1 on: February 09, 2020, 06:53:12 am »
Related:

Framebuffer Graphics routines for Freepascal.
An EXPERIMENTAL Pascal library for direct access to the Linux Framebuffer

  https://github.com/JazzMaster/framebuffergraphics

Thaddy

  • Hero Member
  • *****
  • Posts: 9785
Re: A good talk on using the Linux Framebuffer (FOSDEM 2020)
« Reply #2 on: February 09, 2020, 02:43:00 pm »
I have actually working framebuffer code and an fb.pas translation. I will add that later today.
The code you refer to is incorrect and still contains untranslated C code.
I am more like donkey than shrek

Thaddy

  • Hero Member
  • *****
  • Posts: 9785
Re: A good talk on using the Linux Framebuffer (FOSDEM 2020)
« Reply #3 on: February 09, 2020, 04:50:56 pm »
As promised, fb.pas. Tested on Raspberry Pi.

And a simple example:
Code: Pascal  [Select]
  1. program fbinfo;
  2. {$mode delphi}{$H+}
  3. uses
  4.   BaseUnix,fb;
  5. var
  6.   fbfd:longint = 0;        // file handle
  7.   vinfo:fb_var_screeninfo; // variable screen info.
  8. begin
  9.   // Open the framebuffer device file for reading and writing
  10.   fbfd := fpopen('/dev/fb0', O_RDWR);
  11.   if fbfd = -1 then
  12.   begin
  13.     writeln('Error: cannot open framebuffer device.');
  14.     Halt(1)
  15.   end;
  16.   // get variable screen info
  17.   if fpioctl(fbfd, FBIOGET_VSCREENINFO, @vinfo) <> 0 then
  18.   begin
  19.     writeln('Error reading variable screen info.');
  20.     Halt(2);
  21.   end;
  22.   writeln('Display info ',vinfo.xres,'x',vinfo.yres,' bpp ', vinfo.bits_per_pixel);
  23.   fpclose(fbfd);  
  24. end.

I will add a wiki article with some real world examples later this week. (code needs cleaning up)

I am more like donkey than shrek

WayneSherman

  • Jr. Member
  • **
  • Posts: 70
Re: A good talk on using the Linux Framebuffer (FOSDEM 2020)
« Reply #4 on: February 09, 2020, 05:25:45 pm »
As promised, fb.pas. Tested on Raspberry Pi.

And a simple example...

Love it.  Thanks for sharing.  :)

Basile-B

  • Sr. Member
  • ****
  • Posts: 489
Re: A good talk on using the Linux Framebuffer (FOSDEM 2020)
« Reply #5 on: February 09, 2020, 07:21:27 pm »
Back to the Linux Framebuffer!
Linux Framebuffer support in free software

https://fosdem.org/2020/schedule/event/fbdev/

Is the FrameBuffer applicable for a "widgetset-agnostic" terminal emulator component ? (think piping bash essentially)
I'd like to get rid of VTE so that I could use the QT5 interface instead of GTK2. Only stopper for me right now is that I don't have an easy solution to embbed a term with the QT5 widget set.

Thaddy

  • Hero Member
  • *****
  • Posts: 9785
Re: A good talk on using the Linux Framebuffer (FOSDEM 2020)
« Reply #6 on: February 09, 2020, 08:30:41 pm »
In principle: yes. Things like font mapping, cursor etc are support by the framebuffer interface, but it takes a *lot* of bolt-ons.
I am working on the reverse: make the owner drawn widgetset use a frambuffer based canvas.
Note the framebuffer is actually legacy, but many - even new - applications still use it.
I am more like donkey than shrek

Basile-B

  • Sr. Member
  • ****
  • Posts: 489
Re: A good talk on using the Linux Framebuffer (FOSDEM 2020)
« Reply #7 on: February 17, 2020, 01:04:37 am »
Looks like what I would need, to get a "desktop-environment-agnotisc terminal emulator" is to use https://launchpad.net/libvterm and write a GUI front end for it... No need for the FrameBuffer actually, just a good old TWinControl class (and certainly some struggling ) should be enough.