[patch1/2] xf86modes: fix max clock unit

Hong Liu hong.liu at intel.com
Fri Feb 1 17:44:50 PST 2008


On Fri, 2008-02-01 at 17:14 -0800, Eric Anholt wrote:
> On Mon, 2008-01-28 at 14:16 +0800, Hong Liu wrote:
> > max clock from EDID data is in MHz, while we need KHz to validate modes.
> > 
> > Thanks,
> > Hong
> > 
> > diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
> > index 10db862..890d055 100644
> > --- a/hw/xfree86/modes/xf86Crtc.c
> > +++ b/hw/xfree86/modes/xf86Crtc.c
> > @@ -1363,7 +1363,7 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY)
> >  			    sync_source = sync_edid;
> >  		    }
> >  		    if (ranges->max_clock > max_clock)
> > -			max_clock = ranges->max_clock;
> > +			max_clock = ranges->max_clock * 1000;
> >  		}
> >  	    }
> >  	}
> 
> What about the line just above the line you changed?
> 

max_clock is 0 at that time...
Yeah, unifying the unit seems to make more sense.

Here is the 2nd patch.

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 10db862..4ecf4b3 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -1362,8 +1362,8 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY)
 			if (sync_source == sync_default)
 			    sync_source = sync_edid;
 		    }
-		    if (ranges->max_clock > max_clock)
-			max_clock = ranges->max_clock;
+		    if (ranges->max_clock * 1000 > max_clock)
+			max_clock = ranges->max_clock * 1000;
 		}
 	    }
 	}





More information about the xorg mailing list