[Intel-gfx] [PATCH 5/9] drm/i915: Use intel_attached_encoder()
Ville Syrjälä
ville.syrjala at linux.intel.com
Mon Dec 9 15:52:53 UTC 2019
On Thu, Dec 05, 2019 at 04:29:37PM +0530, Ramalingam C wrote:
> On 2019-12-04 at 20:05:45 +0200, Ville Syrjala wrote:
> > diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c
> > index af7f6d670e07..1a7d69843c12 100644
> > --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
> > +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
> > @@ -503,9 +503,9 @@ static const struct drm_encoder_funcs intel_dp_mst_enc_funcs = {
> >
> > static bool intel_dp_mst_get_hw_state(struct intel_connector *connector)
> > {
> > - if (connector->encoder && connector->base.state->crtc) {
> > + if (intel_attached_encoder(connector) && connector->base.state->crtc) {
> > enum pipe pipe;
> > - if (!connector->encoder->get_hw_state(connector->encoder, &pipe))
> > + if (!intel_attached_encoder(connector)->get_hw_state(intel_attached_encoder(connector), &pipe))
> Do we prefer this way or with local var for attached encoder restricting
> line to 80char?
Can't be bothered too much about this half baked code. One day we
need to write a proper implementation of this.
> > return false;
> > return true;
> > }
> > diff --git a/drivers/gpu/drm/i915/display/intel_dsi_dcs_backlight.c b/drivers/gpu/drm/i915/display/intel_dsi_dcs_backlight.c
> > index c87838843d0b..ac3eff26df12 100644
> > --- a/drivers/gpu/drm/i915/display/intel_dsi_dcs_backlight.c
> > +++ b/drivers/gpu/drm/i915/display/intel_dsi_dcs_backlight.c
> > @@ -45,7 +45,7 @@
> >
> > static u32 dcs_get_backlight(struct intel_connector *connector)
> > {
> > - struct intel_encoder *encoder = connector->encoder;
> > + struct intel_encoder *encoder = intel_attached_encoder(connector);
> > struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
> > struct mipi_dsi_device *dsi_device;
> > u8 data = 0;
> > @@ -160,7 +160,7 @@ int intel_dsi_dcs_init_backlight_funcs(struct intel_connector *intel_connector)
> > {
> > struct drm_device *dev = intel_connector->base.dev;
> > struct drm_i915_private *dev_priv = to_i915(dev);
> > - struct intel_encoder *encoder = intel_connector->encoder;
> > + struct intel_encoder *encoder = intel_attached_encoder(intel_connector);
> s/intel_connector/connector ?
> > struct intel_panel *panel = &intel_connector->panel;
> >
> > if (dev_priv->vbt.backlight.type != INTEL_BACKLIGHT_DSI_DCS)
> > diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c
> > index 0fdbd39f6641..2859230671ae 100644
> > --- a/drivers/gpu/drm/i915/display/intel_hdcp.c
> > +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c
> > @@ -1527,7 +1527,7 @@ static int hdcp2_enable_encryption(struct intel_connector *connector)
> > struct intel_digital_port *intel_dig_port = conn_to_dig_port(connector);
> > struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
> > struct intel_hdcp *hdcp = &connector->hdcp;
> > - enum port port = connector->encoder->port;
> > + enum port port = intel_attached_encoder(connector)->port;
> > enum transcoder cpu_transcoder = hdcp->cpu_transcoder;
> > int ret;
> >
> > @@ -1565,7 +1565,7 @@ static int hdcp2_disable_encryption(struct intel_connector *connector)
> > struct intel_digital_port *intel_dig_port = conn_to_dig_port(connector);
> > struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
> > struct intel_hdcp *hdcp = &connector->hdcp;
> > - enum port port = connector->encoder->port;
> > + enum port port = intel_attached_encoder(connector)->port;
> > enum transcoder cpu_transcoder = hdcp->cpu_transcoder;
> > int ret;
> >
> > @@ -1676,7 +1676,7 @@ static int intel_hdcp2_check_link(struct intel_connector *connector)
> > struct intel_digital_port *intel_dig_port = conn_to_dig_port(connector);
> > struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
> > struct intel_hdcp *hdcp = &connector->hdcp;
> > - enum port port = connector->encoder->port;
> > + enum port port = intel_attached_encoder(connector)->port;
> > enum transcoder cpu_transcoder;
> > int ret = 0;
> >
> > @@ -1830,7 +1830,7 @@ static inline int initialize_hdcp_port_data(struct intel_connector *connector,
> >
> > if (INTEL_GEN(dev_priv) < 12)
> > data->fw_ddi =
> > - intel_get_mei_fw_ddi_index(connector->encoder->port);
> > + intel_get_mei_fw_ddi_index(intel_attached_encoder(connector)->port);
> could we wrap at 80char with var encoder?
Not in a cocci patch.
--
Ville Syrjälä
Intel
More information about the Intel-gfx
mailing list