Re: [PATCH] drm: Disable all the possibles output/crtcs before entering KMS mode
On Fri, 4 Dec 2009 23:22:51 +0100, Rafał Miłecki zaj...@gmail.com wrote: 2009/12/4 Dave Airlie airl...@redhat.com: On Fri, 2009-12-04 at 20:05 +0800, yakui.z...@intel.com wrote: From: Zhao Yakui yakui.z...@intel.com Disable all the possible outputs/crtcs before entering KMS mode. We need a bit more info than this for such a large change? At one point we wanted to do smooth startup for LVDS panels, so that we read back the mode and avoided reconfiguring them this sort of change would totally go against it. Also I thought Arjan wanted to avoid slowdowns on startup, which I would expect this to add to. We have something like drm_disable_unused_functions. Isn't that supposed to make what you introduce there? At least at KMS booting when we don't have encoders/crtcs/outputs configured it should work for that. Am I wrong? Yeah, drm_helper_disable_unused_functions with everything set to disconnected should do this. And if we want to get flicker-free transitions, then we could read out current state for some outputs and set our current state accordingly before calling that. It's something I've wanted to do since the original UMS work. But it is true that if we aren't reading current state out, we do need to turn everything off before modesetting. The clocks can get very angry at you otherwise, and you get things worse than a flicker at boot. (So, my review of this patch is: close, but just use drm_helper_disable_unused_functions instead of making a new function) pgpyjh6Th0l7V.pgp Description: PGP signature -- Return on Information: Google Enterprise Search pays you back Get the facts. http://p.sf.net/sfu/google-dev2dev -- ___ Dri-devel mailing list Dri-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dri-devel
Re: [PATCH] drm: Disable all the possibles output/crtcs before entering KMS mode
On Sat, 2009-12-05 at 06:22 +0800, Rafał Miłecki wrote: 2009/12/4 Dave Airlie airl...@redhat.com: On Fri, 2009-12-04 at 20:05 +0800, yakui.z...@intel.com wrote: From: Zhao Yakui yakui.z...@intel.com Disable all the possible outputs/crtcs before entering KMS mode. We need a bit more info than this for such a large change? At one point we wanted to do smooth startup for LVDS panels, so that we read back the mode and avoided reconfiguring them this sort of change would totally go against it. Also I thought Arjan wanted to avoid slowdowns on startup, which I would expect this to add to. We have something like drm_disable_unused_functions. Isn't that supposed to make what you introduce there? At least at KMS booting when we don't have encoders/crtcs/outputs configured it should work for that. Am I wrong? Yes. Your are right. The main purpose of this function is to put all the outputs/crtcs into the known state. In fact this function can also be called in course of suspend/resume. Before we have the encoder/crts/output configuration, the drm_helper_disable_unused_functions can also put all the outputs/crtcs into the known state. But after we build the connection between encoder/crtcs/output, the function of drm_helper_disable_unused_functions can only disable the unused crtc/output. Thanks. -- Join us December 9, 2009 for the Red Hat Virtual Experience, a free event focused on virtualization and cloud computing. Attend in-depth sessions from your desk. Your couch. Anywhere. http://p.sf.net/sfu/redhat-sfdev2dev -- ___ Dri-devel mailing list Dri-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dri-devel
Re: [PATCH] drm: Disable all the possibles output/crtcs before entering KMS mode
On Fri, 2009-12-04 at 20:05 +0800, yakui.z...@intel.com wrote: From: Zhao Yakui yakui.z...@intel.com Disable all the possible outputs/crtcs before entering KMS mode. We need a bit more info than this for such a large change? At one point we wanted to do smooth startup for LVDS panels, so that we read back the mode and avoided reconfiguring them this sort of change would totally go against it. Also I thought Arjan wanted to avoid slowdowns on startup, which I would expect this to add to. Dave. Signed-off-by: Zhao Yakui yakui.z...@intel.com --- drivers/gpu/drm/drm_crtc_helper.c | 32 include/drm/drm_crtc_helper.h |2 ++ 2 files changed, 34 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index 3963b3c..b49028f 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c @@ -1020,6 +1020,9 @@ bool drm_helper_initial_config(struct drm_device *dev) { int count = 0; + /* Disable all the possible outputs/crtc before entering KMS mode */ + drm_helper_disable_connector_crtc(dev); + drm_fb_helper_parse_command_line(dev); count = drm_helper_probe_connector_modes(dev, @@ -1067,6 +1070,35 @@ static int drm_helper_choose_crtc_dpms(struct drm_crtc *crtc) } /** + * drm_helper_disable_connector_crtc + * @dev: drm_device + * + * Disable all the possible outputs Crtcs + */ +void drm_helper_disable_connector_crtc(struct drm_device *dev) +{ + struct drm_encoder *encoder; + struct drm_crtc *crtc; + + list_for_each_entry(encoder, dev-mode_config.encoder_list, head) { + struct drm_encoder_helper_funcs *encoder_funcs = + encoder-helper_private; + if (encoder_funcs encoder_funcs-dpms) + (*encoder_funcs-dpms)(encoder, DRM_MODE_DPMS_OFF); + } + + list_for_each_entry(crtc, dev-mode_config.crtc_list, head) { + struct drm_crtc_helper_funcs *crtc_funcs = crtc-helper_private; + if (crtc_funcs crtc_funcs-dpms) + (*crtc_funcs-dpms)(crtc, DRM_MODE_DPMS_OFF); + } + + return; +} + +EXPORT_SYMBOL(drm_helper_disable_connector_crtc); + +/** * drm_helper_connector_dpms * @connector affected connector * @mode DPMS mode diff --git a/include/drm/drm_crtc_helper.h b/include/drm/drm_crtc_helper.h index b29e201..007bbba 100644 --- a/include/drm/drm_crtc_helper.h +++ b/include/drm/drm_crtc_helper.h @@ -131,4 +131,6 @@ static inline int drm_connector_helper_add(struct drm_connector *connector, } extern int drm_helper_resume_force_mode(struct drm_device *dev); +/* disable all the possible outputs crtcs for one drm_device */ +extern void drm_helper_disable_connector_crtc(struct drm_device *dev); #endif -- Join us December 9, 2009 for the Red Hat Virtual Experience, a free event focused on virtualization and cloud computing. Attend in-depth sessions from your desk. Your couch. Anywhere. http://p.sf.net/sfu/redhat-sfdev2dev -- ___ Dri-devel mailing list Dri-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dri-devel
Re: [PATCH] drm: Disable all the possibles output/crtcs before entering KMS mode
2009/12/4 Dave Airlie airl...@redhat.com: On Fri, 2009-12-04 at 20:05 +0800, yakui.z...@intel.com wrote: From: Zhao Yakui yakui.z...@intel.com Disable all the possible outputs/crtcs before entering KMS mode. We need a bit more info than this for such a large change? At one point we wanted to do smooth startup for LVDS panels, so that we read back the mode and avoided reconfiguring them this sort of change would totally go against it. Also I thought Arjan wanted to avoid slowdowns on startup, which I would expect this to add to. We have something like drm_disable_unused_functions. Isn't that supposed to make what you introduce there? At least at KMS booting when we don't have encoders/crtcs/outputs configured it should work for that. Am I wrong? -- Rafał -- Join us December 9, 2009 for the Red Hat Virtual Experience, a free event focused on virtualization and cloud computing. Attend in-depth sessions from your desk. Your couch. Anywhere. http://p.sf.net/sfu/redhat-sfdev2dev -- ___ Dri-devel mailing list Dri-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dri-devel