[Letux-kernel] framebuffer width + height

Andreas Kemnade andreas at kemnade.info
Thu Dec 7 07:53:52 CET 2017


Hi,

On Mon, 4 Dec 2017 10:36:14 +0100
"H. Nikolaus Schaller" <hns at goldelico.com> wrote:

> Hi,
> 
> > Am 04.12.2017 um 07:28 schrieb Andreas Kemnade <andreas at kemnade.info>:
> > 
> > Hi,
> > 
> > I was just wondering why my gta04 did not show a flashing battery while booting
> > with low battery. After searching the wrong places. I found out that
> > fb_var_screeninfo.width and height is zero.  
> 
> Do you have the command to reproduce that?
> 

This piece of code:

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <linux/fb.h>
#include <sys/ioctl.h>
#include <stdio.h>

int main(int argc, char **argv)
{
  struct fb_var_screeninfo vinfo;
  int fd = open(argv[1], O_RDWR);
  if (fd < 0)
    return 1;
  if (!ioctl(fd, FBIOGET_VSCREENINFO, &vinfo)) {
    printf("xres: %d yres: %d width: %d height: %d\n", vinfo. xres,
           vinfo.yres, vinfo.width, vinfo.height);
  }
  return 0;
}

run with /dev/fb0

4.13.3 and below: width = 4294967295, height = 4294967295
4.14: width = 0, height = 0;

well, correct would be something like
width = 50, height = 80
(screen sizes in mm)

I used them for things like clipping maximum width+ height of picture,
were I correctly have to use xres and yres instead. I just had not tried
it with oversized pictures, so I did not notice my mistake.

Regards,
Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.goldelico.com/pipermail/letux-kernel/attachments/20171207/4480a8b1/attachment.asc>


More information about the Letux-kernel mailing list