[Letux-kernel] framebuffer width + height
H. Nikolaus Schaller
hns at goldelico.com
Thu Dec 7 08:15:15 CET 2017
Hi,
> Am 07.12.2017 um 07:53 schrieb Andreas Kemnade <andreas at kemnade.info>:
>
> 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;
Ok.
I tried
root at letux:~# fbset -i -fb /dev/fb0
mode "480x640"
geometry 480 640 480 640 32
timings 0 0 0 0 0 0 0
accel true
rgba 8/16,8/8,8/0,0/0
endmode
Frame buffer device information:
Name : omapdrm
Address : 0x9e900000
Size : 1228800
Type : PACKED PIXELS
Visual : TRUECOLOR
XPanStep : 1
YPanStep : 1
YWrapStep : 0
LineLength : 1920
Accelerator : No
root at letux:~#
But it does not report that anyways.
>
> well, correct would be something like
> width = 50, height = 80
> (screen sizes in mm)
Well, AFAIK there are no screen size defs in the omapdss panel drivers
or elsewhere (except in xorg.conf). Which means you might look for information
that is not available. At least on kernel level (I have defined it in xorg.conf
so that XWidthMMOfScreen() works).
So maybe someone "fixed" FBIOGET_VSCREENINFO to report 0 instead of MAX_INT in 4.14?
There are tons of changes around Aug 2017:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/log/?h=v4.14.4&qt=grep&q=omapdrm
>
> 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.
Generally it would be nice to have screen size somehow encoded in the panel driver
so that we can get rid of in xorg.conf...
BR,
Nikolaus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.goldelico.com/pipermail/letux-kernel/attachments/20171207/aa18fc34/attachment.asc>
More information about the Letux-kernel
mailing list