graphics_get_display_size gives wrong screen height

3 posts
by LongSteve » Mon Jun 11, 2012 5:05 pm
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?


Posts: 2
Joined: Mon Jun 11, 2012 4:30 pm
by dom » Mon Jun 11, 2012 5:13 pm
This has been fixed in more recent firmware: ... g_firmware

Or you could try the "new" Debian image:
Forum Moderator
Forum Moderator
Posts: 4449
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge
by LongSteve » Mon Jun 11, 2012 5:34 pm
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,

Posts: 2
Joined: Mon Jun 11, 2012 4:30 pm