Bug 1386 - Wrong code in r128_driver.c --> no modes found
Summary: Wrong code in r128_driver.c --> no modes found
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/rage128 (show other bugs)
Version: 6.7.0
Hardware: x86 (IA32) Linux (All)
: high major
Assignee: Xorg Project Team
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-15 00:33 UTC by Klaus Kusche
Modified: 2004-10-16 22:47 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Klaus Kusche 2004-09-15 00:33:40 UTC
The following piece of code in r128_driver.c does the wrong thing on my system:
(I use 6.7.0, but the code is the same in 6.8.0)

/* return TRUE is a DFP is indeed connected to a DVI port */
static Bool R128GetDFPInfo(ScrnInfoPtr pScrn)
{
  ...
    for(i=0; i<4; i++)
    {
        if(ddc->det_mon[i].type == 0)
        {
            info->PanelXRes =
                ddc->det_mon[i].section.d_timings.h_active;
            info->PanelYRes =
                ddc->det_mon[i].section.d_timings.v_active;

            info->HOverPlus =
                ddc->det_mon[i].section.d_timings.h_sync_off;
            info->HSyncWidth =
                ddc->det_mon[i].section.d_timings.h_sync_width;
            info->HBlank =
                ddc->det_mon[i].section.d_timings.h_blanking;
            info->VOverPlus =
                ddc->det_mon[i].section.d_timings.v_sync_off;
            info->VSyncWidth =
                ddc->det_mon[i].section.d_timings.v_sync_width;
            info->VBlank =
                ddc->det_mon[i].section.d_timings.v_blanking;
        }
    }
  ...
}

I've a Rage 128 Pro GL PF AGP card with a DVI flat panel (but no VGA monitor)
connected.

Of the four DDC results tested by the for loop above, the first one contains the
correct values for my display. However, the second and the third one are all 0
(including .type), and hence also get copied. The fourth has .type > 0.

Hence, after the call to this function, my info->PanelXRes and info->PanelYRes
are 0! (and all the other timings, too). Consequently, the function choosing
modes accepts only modes with XRes and YRes <= 0 and of course finds no such modes.

I fixed this by adding two more tests to the if condition:
... && (ddc->...h_active > 0) && (ddc->...v_active > 0))

I've no idea if this fix is correct and useful, but it solved the problem for me.
Comment 1 Alex Deucher 2004-10-17 15:47:39 UTC
committed


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.