[Intel-gfx] [PATCH 01/33] drm/i915: Convert intel_hdmi to enum port

Paulo Zanoni przanoni at gmail.com
Thu Jan 24 18:49:11 CET 2013


Hi

2013/1/24  <ville.syrjala at linux.intel.com>:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
>
> Use intel_dig_port->port rather than intel_hdmi->sdvox_erg.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>

Possible optional suggestions:
- Create macros that receive port as argument (check DDI_BUF_CTL(port)
as example): IBX_VIDEO_DIP_PORT(port), G4X_VIDEO_DIP_PORT(port),
HDMI_HOTPLUG_LIVE_STATUS(port). Since the macros would only be used
once, I'm not really sure if this change is worth making, it's just a
suggestion.
- Rename some "port" variables to "dip_port"

The patch is still an improvement, so with or without the suggestions:
Reviewed-by: Paulo Zanoni <paulo.r.zanoni at intel.com>

> ---
>  drivers/gpu/drm/i915/intel_hdmi.c | 27 +++++++++++++++------------
>  1 file changed, 15 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
> index d53b731..5b4efd6 100644
> --- a/drivers/gpu/drm/i915/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/intel_hdmi.c
> @@ -372,7 +372,8 @@ static void g4x_set_infoframes(struct drm_encoder *encoder,
>                                struct drm_display_mode *adjusted_mode)
>  {
>         struct drm_i915_private *dev_priv = encoder->dev->dev_private;
> -       struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder);
> +       struct intel_digital_port *intel_dig_port = enc_to_dig_port(encoder);
> +       struct intel_hdmi *intel_hdmi = &intel_dig_port->hdmi;
>         u32 reg = VIDEO_DIP_CTL;
>         u32 val = I915_READ(reg);
>         u32 port;
> @@ -399,11 +400,11 @@ static void g4x_set_infoframes(struct drm_encoder *encoder,
>                 return;
>         }
>
> -       switch (intel_hdmi->sdvox_reg) {
> -       case SDVOB:
> +       switch (intel_dig_port->port) {
> +       case PORT_B:
>                 port = VIDEO_DIP_PORT_B;
>                 break;
> -       case SDVOC:
> +       case PORT_C:
>                 port = VIDEO_DIP_PORT_C;
>                 break;
>         default:
> @@ -436,7 +437,8 @@ static void ibx_set_infoframes(struct drm_encoder *encoder,
>  {
>         struct drm_i915_private *dev_priv = encoder->dev->dev_private;
>         struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc);
> -       struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder);
> +       struct intel_digital_port *intel_dig_port = enc_to_dig_port(encoder);
> +       struct intel_hdmi *intel_hdmi = &intel_dig_port->hdmi;
>         u32 reg = TVIDEO_DIP_CTL(intel_crtc->pipe);
>         u32 val = I915_READ(reg);
>         u32 port;
> @@ -455,14 +457,14 @@ static void ibx_set_infoframes(struct drm_encoder *encoder,
>                 return;
>         }
>
> -       switch (intel_hdmi->sdvox_reg) {
> -       case HDMIB:
> +       switch (intel_dig_port->port) {
> +       case PORT_B:
>                 port = VIDEO_DIP_PORT_B;
>                 break;
> -       case HDMIC:
> +       case PORT_C:
>                 port = VIDEO_DIP_PORT_C;
>                 break;
> -       case HDMID:
> +       case PORT_D:
>                 port = VIDEO_DIP_PORT_D;
>                 break;
>         default:
> @@ -795,13 +797,14 @@ static bool g4x_hdmi_connected(struct intel_hdmi *intel_hdmi)
>  {
>         struct drm_device *dev = intel_hdmi_to_dev(intel_hdmi);
>         struct drm_i915_private *dev_priv = dev->dev_private;
> +       struct intel_digital_port *intel_dig_port = hdmi_to_dig_port(intel_hdmi);
>         uint32_t bit;
>
> -       switch (intel_hdmi->sdvox_reg) {
> -       case SDVOB:
> +       switch (intel_dig_port->port) {
> +       case PORT_B:
>                 bit = HDMIB_HOTPLUG_LIVE_STATUS;
>                 break;
> -       case SDVOC:
> +       case PORT_C:
>                 bit = HDMIC_HOTPLUG_LIVE_STATUS;
>                 break;
>         default:
> --
> 1.7.12.4
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx



-- 
Paulo Zanoni



More information about the Intel-gfx mailing list