Message ID | 1253524724-23349-1-git-send-email-yakui.zhao@intel.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
On 2009.09.21 17:18:40 +0800, yakui.zhao@intel.com wrote: > From: Zhao Yakui <yakui.zhao@intel.com> > > Now the actual refresh rate is returned by the function of drm_mode_vrefresh. > So multiply the refresh rate by 1000 in TV mode validation. > > At the same time the error is expanded from 10 to 1000. > > Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> > --- > drivers/gpu/drm/i915/intel_tv.c | 3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) > > diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c > index a6c686c..b8bff39 100644 > --- a/drivers/gpu/drm/i915/intel_tv.c > +++ b/drivers/gpu/drm/i915/intel_tv.c > @@ -1082,7 +1082,8 @@ intel_tv_mode_valid(struct drm_connector *connector, struct drm_display_mode *mo > const struct tv_mode *tv_mode = intel_tv_mode_find(intel_output); > > /* Ensure TV refresh is close to desired refresh */ > - if (tv_mode && abs(tv_mode->refresh - drm_mode_vrefresh(mode)) < 10) > + if (tv_mode && abs(tv_mode->refresh - drm_mode_vrefresh(mode) * 1000) > + < 1000) > return MODE_OK; > return MODE_CLOCK_RANGE; > } Looks wrong to me, drm_mode_vrefresh() should return milli-hz already.
On Tue, 2009-09-22 at 14:54 +0800, Zhenyu Wang wrote: > On 2009.09.21 17:18:40 +0800, yakui.zhao@intel.com wrote: > > From: Zhao Yakui <yakui.zhao@intel.com> > > > > Now the actual refresh rate is returned by the function of drm_mode_vrefresh. > > So multiply the refresh rate by 1000 in TV mode validation. > > > > At the same time the error is expanded from 10 to 1000. > > > > Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> > > --- > > drivers/gpu/drm/i915/intel_tv.c | 3 ++- > > 1 files changed, 2 insertions(+), 1 deletions(-) > > > > diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c > > index a6c686c..b8bff39 100644 > > --- a/drivers/gpu/drm/i915/intel_tv.c > > +++ b/drivers/gpu/drm/i915/intel_tv.c > > @@ -1082,7 +1082,8 @@ intel_tv_mode_valid(struct drm_connector *connector, struct drm_display_mode *mo > > const struct tv_mode *tv_mode = intel_tv_mode_find(intel_output); > > > > /* Ensure TV refresh is close to desired refresh */ > > - if (tv_mode && abs(tv_mode->refresh - drm_mode_vrefresh(mode)) < 10) > > + if (tv_mode && abs(tv_mode->refresh - drm_mode_vrefresh(mode) * 1000) > > + < 1000) > > return MODE_OK; > > return MODE_CLOCK_RANGE; > > } > > Looks wrong to me, drm_mode_vrefresh() should return milli-hz already. The drm_mode_vrefresh will return the actual refresh rate instead of milli-hz after the following commit is shipped. >commit 559ee21d261a54c42594ef9405d27e9008eedf44 Author: Zhao Yakui <yakui.zhao@intel.com> Date: Thu Sep 3 09:33:47 2009 +0800 drm/kms: try to find the std mode in DMT table When the calculated value is 84.9, then the fresh_rate is 85. When the calculated value is 70.02, then the fresh_rate is 70. Thanks. >
diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c index a6c686c..b8bff39 100644 --- a/drivers/gpu/drm/i915/intel_tv.c +++ b/drivers/gpu/drm/i915/intel_tv.c @@ -1082,7 +1082,8 @@ intel_tv_mode_valid(struct drm_connector *connector, struct drm_display_mode *mo const struct tv_mode *tv_mode = intel_tv_mode_find(intel_output); /* Ensure TV refresh is close to desired refresh */ - if (tv_mode && abs(tv_mode->refresh - drm_mode_vrefresh(mode)) < 10) + if (tv_mode && abs(tv_mode->refresh - drm_mode_vrefresh(mode) * 1000) + < 1000) return MODE_OK; return MODE_CLOCK_RANGE; }