View Single Post
Old 08-03-12, 08:35 PM   #1
earache
Registered User
 
Join Date: Jul 2012
Posts: 2
Default XRRConfigCurrentRate() problem in 304.XX series

I find that in the 304 series drivers querying the refresh via XRRGetScreenInfo - XRRConfigCurrentRate always returns 50hz. Example code (working in 302 and earlier) attached.
the xrandr command line returns the correct result.

Code:
#include <stdio.h>
#include <X11/extensions/Xrandr.h>

int
main(void)
{
  int RefreshRate;
  XRRScreenConfiguration *CurrInfo;
  Display* m_Dpy;


  m_Dpy = XOpenDisplay(NULL);
  CurrInfo = XRRGetScreenInfo(m_Dpy, DefaultRootWindow(m_Dpy));
  RefreshRate = XRRConfigCurrentRate(CurrInfo);
  XRRFreeScreenConfigInfo(CurrInfo);

  fprintf(stdout, "RefreshRate: %d\n", RefreshRate);
}
xrandr command-line seems to work, yet above always returns 50Hz:
Quote:
media:~ $ DISPLAY=:0
media:~ $ xrandr
Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 8192 x 8192
DVI-D-0 disconnected (normal left inverted right x axis y axis)
HDMI-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
800x600 60.3 +
1920x1080 60.0 50.0* 24.0 24.0
media:~ $ xrandr --output HDMI-0 --mode 0x1c9
media:~ $ xrandr
Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 8192 x 8192
DVI-D-0 disconnected (normal left inverted right x axis y axis)
HDMI-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
800x600 60.3 +
1920x1080 60.0 50.0 24.0 24.0*
media:~ $ ./getrefresh
RefreshRate: 50
media:~ $ xrandr --output HDMI-0 --mode 0x1c6
media:~ $ xrandr
Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 8192 x 8192
DVI-D-0 disconnected (normal left inverted right x axis y axis)
HDMI-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
800x600 60.3 +
1920x1080 60.0* 50.0 24.0 24.0
media:~ $ ./getrefresh
RefreshRate: 50
earache is offline   Reply With Quote