[Intel-gfx] [PATCH v2 05/18] drm/i915/audio: pass intel_encoder on to platform specific ELD functions

Rodrigo Vivi rodrigo.vivi at gmail.com
Wed Oct 29 22:48:28 CET 2014


Oh, I was going to review the rest... but based on this comment I
guess I might wait for a new v2 series right?

On Tue, Oct 28, 2014 at 12:30 AM, Daniel Vetter <daniel at ffwll.ch> wrote:
> On Mon, Oct 27, 2014 at 10:52:00AM -0700, Rodrigo Vivi wrote:
>> On Mon, Oct 27, 2014 at 7:26 AM, Jani Nikula <jani.nikula at intel.com> wrote:
>> > This will simplify things later on. No functional changes.
>> >
>> > Signed-off-by: Jani Nikula <jani.nikula at intel.com>
>> > ---
>> >  drivers/gpu/drm/i915/i915_drv.h    |  4 ++--
>> >  drivers/gpu/drm/i915/intel_audio.c | 22 ++++++++++------------
>> >  2 files changed, 12 insertions(+), 14 deletions(-)
>> >
>> > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
>> > index 627b7e71f168..6a73803482cb 100644
>> > --- a/drivers/gpu/drm/i915/i915_drv.h
>> > +++ b/drivers/gpu/drm/i915/i915_drv.h
>> > @@ -434,6 +434,7 @@ struct drm_i915_error_state {
>> >  };
>> >
>> >  struct intel_connector;
>> > +struct intel_encoder;
>> >  struct intel_crtc_config;
>> >  struct intel_plane_config;
>> >  struct intel_crtc;
>> > @@ -483,7 +484,7 @@ struct drm_i915_display_funcs {
>> >         void (*crtc_disable)(struct drm_crtc *crtc);
>> >         void (*off)(struct drm_crtc *crtc);
>> >         void (*write_eld)(struct drm_connector *connector,
>> > -                         struct drm_crtc *crtc,
>> > +                         struct intel_encoder *encoder,
>> >                           struct drm_display_mode *mode);
>> >         void (*fdi_link_train)(struct drm_crtc *crtc);
>> >         void (*init_clock_gating)(struct drm_device *dev);
>> > @@ -2798,7 +2799,6 @@ static inline bool intel_gmbus_is_forced_bit(struct i2c_adapter *adapter)
>> >  extern void intel_i2c_reset(struct drm_device *dev);
>> >
>> >  /* intel_opregion.c */
>> > -struct intel_encoder;
>> >  #ifdef CONFIG_ACPI
>> >  extern int intel_opregion_setup(struct drm_device *dev);
>> >  extern void intel_opregion_init(struct drm_device *dev);
>> > diff --git a/drivers/gpu/drm/i915/intel_audio.c b/drivers/gpu/drm/i915/intel_audio.c
>> > index 829afd5305d1..4a384d780b20 100644
>> > --- a/drivers/gpu/drm/i915/intel_audio.c
>> > +++ b/drivers/gpu/drm/i915/intel_audio.c
>> > @@ -97,7 +97,7 @@ static bool intel_eld_uptodate(struct drm_connector *connector,
>> >  }
>> >
>> >  static void g4x_write_eld(struct drm_connector *connector,
>> > -                         struct drm_crtc *crtc,
>> > +                         struct intel_encoder *encoder,
>> >                           struct drm_display_mode *mode)
>> >  {
>> >         struct drm_i915_private *dev_priv = connector->dev->dev_private;
>> > @@ -137,16 +137,16 @@ static void g4x_write_eld(struct drm_connector *connector,
>> >  }
>> >
>> >  static void haswell_write_eld(struct drm_connector *connector,
>> > -                             struct drm_crtc *crtc,
>> > +                             struct intel_encoder *encoder,
>> >                               struct drm_display_mode *mode)
>> >  {
>> >         struct drm_i915_private *dev_priv = connector->dev->dev_private;
>> > -       struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
>> > +       struct intel_crtc *intel_crtc = to_intel_crtc(encoder->base.crtc);
>> >         uint8_t *eld = connector->eld;
>> >         uint32_t eldv;
>> >         uint32_t tmp;
>> >         int len, i;
>> > -       enum pipe pipe = to_intel_crtc(crtc)->pipe;
>> > +       enum pipe pipe = intel_crtc->pipe;
>> >         enum port port;
>> >         int hdmiw_hdmiedid = HSW_AUD_EDID_DATA(pipe);
>> >         int aud_cntl_st = HSW_AUD_DIP_ELD_CTRL(pipe);
>> > @@ -160,7 +160,7 @@ static void haswell_write_eld(struct drm_connector *connector,
>> >         I915_WRITE(aud_cntrl_st2, tmp);
>> >         POSTING_READ(aud_cntrl_st2);
>> >
>> > -       assert_pipe_disabled(dev_priv, to_intel_crtc(crtc)->pipe);
>> > +       assert_pipe_disabled(dev_priv, pipe);
>> maybe this line could be on previous patch, but nevermind
>>
>> Reviewed-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
>
> Merged up to this patch. Later patches with r-b don't apply any more due
> to some in-between that are still under discussion. So I've stopped here.
>
> Thanks, Daniel
>> >
>> >         /* Set ELD valid state */
>> >         tmp = I915_READ(aud_cntrl_st2);
>> > @@ -219,11 +219,11 @@ static void haswell_write_eld(struct drm_connector *connector,
>> >  }
>> >
>> >  static void ironlake_write_eld(struct drm_connector *connector,
>> > -                              struct drm_crtc *crtc,
>> > +                              struct intel_encoder *encoder,
>> >                                struct drm_display_mode *mode)
>> >  {
>> >         struct drm_i915_private *dev_priv = connector->dev->dev_private;
>> > -       struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
>> > +       struct intel_crtc *intel_crtc = to_intel_crtc(encoder->base.crtc);
>> >         uint8_t *eld = connector->eld;
>> >         uint32_t eldv;
>> >         uint32_t tmp;
>> > @@ -232,7 +232,7 @@ static void ironlake_write_eld(struct drm_connector *connector,
>> >         int aud_config;
>> >         int aud_cntl_st;
>> >         int aud_cntrl_st2;
>> > -       enum pipe pipe = to_intel_crtc(crtc)->pipe;
>> > +       enum pipe pipe = intel_crtc->pipe;
>> >         enum port port;
>> >
>> >         if (HAS_PCH_IBX(connector->dev)) {
>> > @@ -255,11 +255,9 @@ static void ironlake_write_eld(struct drm_connector *connector,
>> >         DRM_DEBUG_DRIVER("ELD on pipe %c\n", pipe_name(pipe));
>> >
>> >         if (IS_VALLEYVIEW(connector->dev))  {
>> > -               struct intel_encoder *intel_encoder;
>> >                 struct intel_digital_port *intel_dig_port;
>> >
>> > -               intel_encoder = intel_attached_encoder(connector);
>> > -               intel_dig_port = enc_to_dig_port(&intel_encoder->base);
>> > +               intel_dig_port = enc_to_dig_port(&encoder->base);
>> >                 port = intel_dig_port->port;
>> >         } else {
>> >                 tmp = I915_READ(aud_cntl_st);
>> > @@ -335,7 +333,7 @@ void intel_write_eld(struct intel_encoder *intel_encoder)
>> >         connector->eld[6] = drm_av_sync_delay(connector, mode) / 2;
>> >
>> >         if (dev_priv->display.write_eld)
>> > -               dev_priv->display.write_eld(connector, encoder->crtc, mode);
>> > +               dev_priv->display.write_eld(connector, intel_encoder, mode);
>> >  }
>> >
>> >  /**
>> > --
>> > 2.1.1
>> >
>> > _______________________________________________
>> > Intel-gfx mailing list
>> > Intel-gfx at lists.freedesktop.org
>> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
>>
>>
>>
>> --
>> Rodrigo Vivi
>> Blog: http://blog.vivi.eng.br
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> +41 (0) 79 365 57 48 - http://blog.ffwll.ch



-- 
Rodrigo Vivi
Blog: http://blog.vivi.eng.br



More information about the Intel-gfx mailing list