Message ID | 1251941629-6694-4-git-send-email-yakui.zhao@intel.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
On Thu, 2009-09-03 at 09:39 +0800, Dave Airlie wrote: > On Thu, 2009-09-03 at 09:33 +0800, yakui.zhao@intel.com wrote: > > From: Zhao Yakui <yakui.zhao@intel.com> > > > > Add the default mode for the CRT output without EDID. But we only add the mode > > which visible part is equal to or less than 1024x768. > > Use 800x600 as the default mode for consistency with X sake, this case > should be handled by the main drm code when it finds no modes anyways, > it possibly should be done in a helper Your propose seems better. When one output device is connected but there is no mode, we can add some default modes for it. How about the following patch? If so, we will add the default mode for every output device when there is no mode for it. --- drivers/gpu/drm/drm_crtc_helper.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) Index: linux-2.6/drivers/gpu/drm/drm_crtc_helper.c =================================================================== --- linux-2.6.orig/drivers/gpu/drm/drm_crtc_helper.c 2009-09-03 14:25:16.000000000 +0800 +++ linux-2.6/drivers/gpu/drm/drm_crtc_helper.c 2009-09-03 14:27:51.000000000 +0800 @@ -109,8 +109,11 @@ } count = (*connector_funcs->get_modes)(connector); - if (!count) - return 0; + if (!count) { + count = drm_add_modes_noedid(connector, 800, 600); + if (!count) + return 0; + } drm_mode_connector_list_update(connector); > > Dave. > > > > > Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> > > --- > > drivers/gpu/drm/i915/intel_crt.c | 8 ++++++++ > > 1 file changed, 8 insertions(+) > > > > Index: linux-2.6/drivers/gpu/drm/i915/intel_crt.c > > =================================================================== > > --- linux-2.6.orig/drivers/gpu/drm/i915/intel_crt.c 2009-09-03 08:56:50.000000000 +0800 > > +++ linux-2.6/drivers/gpu/drm/i915/intel_crt.c 2009-09-03 09:28:35.000000000 +0800 > > @@ -458,6 +458,14 @@ > > intel_i2c_destroy(ddcbus); > > > > end: > > + if (!ret) { > > + /* > > + * when there is no EDID, add some default modes. > > + * But the hdisplay should not be greater than 1024. > > + * the vdisplay should not be greater than 768 > > + */ > > + ret = drm_add_modes_noedid(connector, 1024, 768); > > + } > > return ret; > > > > } >
Index: linux-2.6/drivers/gpu/drm/i915/intel_crt.c =================================================================== --- linux-2.6.orig/drivers/gpu/drm/i915/intel_crt.c 2009-09-03 08:56:50.000000000 +0800 +++ linux-2.6/drivers/gpu/drm/i915/intel_crt.c 2009-09-03 09:28:35.000000000 +0800 @@ -458,6 +458,14 @@ intel_i2c_destroy(ddcbus); end: + if (!ret) { + /* + * when there is no EDID, add some default modes. + * But the hdisplay should not be greater than 1024. + * the vdisplay should not be greater than 768 + */ + ret = drm_add_modes_noedid(connector, 1024, 768); + } return ret; }