Page 1 of 1

graphics_get_display_size gives wrong screen height

Posted: Mon Jun 11, 2012 5:05 pm
by LongSteve
Hi all,

Just got my Raspberry Pi the other day and have been looking around at things. I've compiled the hello_triangle sample that comes with the Debian distro and it works great, but the function call to:

Code: Select all

graphics_get_display_size(0 /* LCD */, &state->screen_width, &state->screen_height);
gives a screen size of 1920x1080, however my monitor (a HP ZR24w with HDMI->DVI cable) is 1920x1200. When I run tvservice -s I get the correct size output. The console (no X started) doesn't display completely full screen, but my monitor does report it's being driven at 1920x1200@60Hz.

If I hard code state->screen_height to 1200, hello_triangle displays properly at full screen, and this isn't too much of a bother really since any programs I write would have an option for resolution switch anyway.

I was just wondering if I'd missed anything?

Cheers,

Steve

Re: graphics_get_display_size gives wrong screen height

Posted: Mon Jun 11, 2012 5:13 pm
by dom
This has been fixed in more recent firmware:
http://elinux.org/R-Pi_Troubleshooting# ... g_firmware

Or you could try the "new" Debian image:
http://www.raspberrypi.org/phpBB3/viewt ... =50&t=8071

Re: graphics_get_display_size gives wrong screen height

Posted: Mon Jun 11, 2012 5:34 pm
by LongSteve
Awesome, thanks for the quick reply.

I'd not even gotten around to looking at firmware updating and things yet, but following those instructions fixed my issue.

Thanks again,

Steve