>-----Original Message----- >From: Nikula, Jani >Sent: Wednesday, August 19, 2015 6:01 PM >To: intel-gfx@xxxxxxxxxxxxxxxxxxxxx >Cc: R, Durgadoss; Nikula, Jani >Subject: [PATCH 1/5] drm/i915: move ibx_digital_port_connected to intel_dp.c > >The function can be made static there. No functional changes. > This clean up series looks good to me. Reviewed-by: Durgadoss R <durgadoss.r@xxxxxxxxx> Thanks, Durga >Signed-off-by: Jani Nikula <jani.nikula@xxxxxxxxx> >--- > drivers/gpu/drm/i915/intel_display.c | 45 -------------------------- > drivers/gpu/drm/i915/intel_dp.c | 61 +++++++++++++++++++++++++++++++----- > drivers/gpu/drm/i915/intel_drv.h | 2 -- > 3 files changed, 53 insertions(+), 55 deletions(-) > >diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c >index f604ce1c528b..1a0670259cdf 100644 >--- a/drivers/gpu/drm/i915/intel_display.c >+++ b/drivers/gpu/drm/i915/intel_display.c >@@ -1061,51 +1061,6 @@ static void intel_wait_for_pipe_off(struct intel_crtc *crtc) > } > } > >-/* >- * ibx_digital_port_connected - is the specified port connected? >- * @dev_priv: i915 private structure >- * @port: the port to test >- * >- * Returns true if @port is connected, false otherwise. >- */ >-bool ibx_digital_port_connected(struct drm_i915_private *dev_priv, >- struct intel_digital_port *port) >-{ >- u32 bit; >- >- if (HAS_PCH_IBX(dev_priv->dev)) { >- switch (port->port) { >- case PORT_B: >- bit = SDE_PORTB_HOTPLUG; >- break; >- case PORT_C: >- bit = SDE_PORTC_HOTPLUG; >- break; >- case PORT_D: >- bit = SDE_PORTD_HOTPLUG; >- break; >- default: >- return true; >- } >- } else { >- switch (port->port) { >- case PORT_B: >- bit = SDE_PORTB_HOTPLUG_CPT; >- break; >- case PORT_C: >- bit = SDE_PORTC_HOTPLUG_CPT; >- break; >- case PORT_D: >- bit = SDE_PORTD_HOTPLUG_CPT; >- break; >- default: >- return true; >- } >- } >- >- return I915_READ(SDEISR) & bit; >-} >- > static const char *state_string(bool enabled) > { > return enabled ? "on" : "off"; >diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c >index d32ce4841654..4aa3d664765b 100644 >--- a/drivers/gpu/drm/i915/intel_dp.c >+++ b/drivers/gpu/drm/i915/intel_dp.c >@@ -4473,17 +4473,49 @@ edp_detect(struct intel_dp *intel_dp) > return status; > } > >-static enum drm_connector_status >-ironlake_dp_detect(struct intel_dp *intel_dp) >+/* >+ * ibx_digital_port_connected - is the specified port connected? >+ * @dev_priv: i915 private structure >+ * @port: the port to test >+ * >+ * Returns true if @port is connected, false otherwise. >+ */ >+static bool ibx_digital_port_connected(struct drm_i915_private *dev_priv, >+ struct intel_digital_port *port) > { >- struct drm_device *dev = intel_dp_to_dev(intel_dp); >- struct drm_i915_private *dev_priv = dev->dev_private; >- struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp); >+ u32 bit; > >- if (!ibx_digital_port_connected(dev_priv, intel_dig_port)) >- return connector_status_disconnected; >+ if (HAS_PCH_IBX(dev_priv->dev)) { >+ switch (port->port) { >+ case PORT_B: >+ bit = SDE_PORTB_HOTPLUG; >+ break; >+ case PORT_C: >+ bit = SDE_PORTC_HOTPLUG; >+ break; >+ case PORT_D: >+ bit = SDE_PORTD_HOTPLUG; >+ break; >+ default: >+ return true; >+ } >+ } else { >+ switch (port->port) { >+ case PORT_B: >+ bit = SDE_PORTB_HOTPLUG_CPT; >+ break; >+ case PORT_C: >+ bit = SDE_PORTC_HOTPLUG_CPT; >+ break; >+ case PORT_D: >+ bit = SDE_PORTD_HOTPLUG_CPT; >+ break; >+ default: >+ return true; >+ } >+ } > >- return intel_dp_detect_dpcd(intel_dp); >+ return I915_READ(SDEISR) & bit; > } > > static int g4x_digital_port_connected(struct drm_device *dev, >@@ -4528,6 +4560,19 @@ static int g4x_digital_port_connected(struct drm_device *dev, > } > > static enum drm_connector_status >+ironlake_dp_detect(struct intel_dp *intel_dp) >+{ >+ struct drm_device *dev = intel_dp_to_dev(intel_dp); >+ struct drm_i915_private *dev_priv = dev->dev_private; >+ struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp); >+ >+ if (!ibx_digital_port_connected(dev_priv, intel_dig_port)) >+ return connector_status_disconnected; >+ >+ return intel_dp_detect_dpcd(intel_dp); >+} >+ >+static enum drm_connector_status > g4x_dp_detect(struct intel_dp *intel_dp) > { > struct drm_device *dev = intel_dp_to_dev(intel_dp); >diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h >index 81b7d77a3c8b..a9e6c2789ea9 100644 >--- a/drivers/gpu/drm/i915/intel_drv.h >+++ b/drivers/gpu/drm/i915/intel_drv.h >@@ -1001,8 +1001,6 @@ void intel_encoder_destroy(struct drm_encoder *encoder); > int intel_connector_init(struct intel_connector *); > struct intel_connector *intel_connector_alloc(void); > bool intel_connector_get_hw_state(struct intel_connector *connector); >-bool ibx_digital_port_connected(struct drm_i915_private *dev_priv, >- struct intel_digital_port *port); > void intel_connector_attach_encoder(struct intel_connector *connector, > struct intel_encoder *encoder); > struct drm_encoder *intel_best_encoder(struct drm_connector *connector); >-- >2.1.4 _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/intel-gfx