On Wed, Sep 11, 2013 at 06:02:51PM -0300, Paulo Zanoni wrote:
> From: Paulo Zanoni <[email protected]>
> 
> There's no reason to init a DP connector if the encoder just supports
> HDMI: we'll just waste hundreds and hundreds of cycles trying to do DP
> AUX transactions to detect if there's something there. Same goes for a
> DP connector that doesn't support HDMI, but I'm not sure these
> actually exist.
> 
> Signed-off-by: Paulo Zanoni <[email protected]>
> Reviewed-by: Rodrigo Vivi <[email protected]>
> ---
>  drivers/gpu/drm/i915/i915_drv.h   |  3 +++
>  drivers/gpu/drm/i915/intel_bios.c | 13 ++++++++++++-
>  drivers/gpu/drm/i915/intel_ddi.c  | 30 ++++++++++++++++++++++--------
>  3 files changed, 37 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 298c671..8533bf1 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1054,6 +1054,9 @@ enum modeset_restore {
>  
>  struct ddi_vbt_port_info {
>       uint8_t hdmi_level_shift;
> +     bool supports_dvi;
> +     bool supports_hdmi;
> +     bool supports_dp;

Might as well make these uint8_t:1;

> -     if (!intel_dp_init_connector(intel_dig_port, dp_connector)) {
> -             drm_encoder_cleanup(encoder);
> -             kfree(intel_dig_port);
> -             kfree(dp_connector);
> -             return;
> +     if (init_dp) {
> +             if (!intel_dp_init_connector(intel_dig_port, dp_connector)) {
> +                     drm_encoder_cleanup(encoder);
> +                     kfree(intel_dig_port);
> +                     kfree(dp_connector);
> +                     return;
> +             }
>       }

You are mixing styles here. Elsewhere with init_hdmi you have, thankfully,
opted to eliminated the extra level of useless indentation. So please
use if (init_dp && !intel_dp_init_connector()).
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to