[PATCH 3.16 005/306] drm/i915/vlv: Make intel_crt_reset() per-encoder

From: Ben Hutchings
Date: Wed Feb 15 2017 - 18:55:08 EST


3.16.40-rc1 review patch. If anyone has any objections, please let me know.

------------------

From: Lyude <cpaul@xxxxxxxxxx>

commit 28cf71ce3e206db1c3f30b3da31e7b48b2269e4c upstream.

This lets call intel_crt_reset() in contexts where IRQs are disabled and
as such, can't hold the locks required to work with the connectors.

Cc: Ville SyrjÃlà <ville.syrjala@xxxxxxxxxxxxxxx>
Acked-by: Daniel Vetter <daniel.vetter@xxxxxxxx>
Signed-off-by: Lyude <cpaul@xxxxxxxxxx>
Signed-off-by: Daniel Vetter <daniel.vetter@xxxxxxxx>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <ben@xxxxxxxxxxxxxxx>
---
drivers/gpu/drm/i915/intel_crt.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

--- a/drivers/gpu/drm/i915/intel_crt.c
+++ b/drivers/gpu/drm/i915/intel_crt.c
@@ -742,11 +742,11 @@ static int intel_crt_set_property(struct
return 0;
}

-static void intel_crt_reset(struct drm_connector *connector)
+static void intel_crt_reset(struct drm_encoder *encoder)
{
- struct drm_device *dev = connector->dev;
+ struct drm_device *dev = encoder->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
- struct intel_crt *crt = intel_attached_crt(connector);
+ struct intel_crt *crt = intel_encoder_to_crt(to_intel_encoder(encoder));

if (INTEL_INFO(dev)->gen >= 5) {
u32 adpa;
@@ -768,7 +768,6 @@ static void intel_crt_reset(struct drm_c
*/

static const struct drm_connector_funcs intel_crt_connector_funcs = {
- .reset = intel_crt_reset,
.dpms = intel_crt_dpms,
.detect = intel_crt_detect,
.fill_modes = drm_helper_probe_single_connector_modes,
@@ -783,6 +782,7 @@ static const struct drm_connector_helper
};

static const struct drm_encoder_funcs intel_crt_enc_funcs = {
+ .reset = intel_crt_reset,
.destroy = intel_encoder_destroy,
};

@@ -902,5 +902,5 @@ void intel_crt_init(struct drm_device *d
dev_priv->fdi_rx_config = I915_READ(_FDI_RXA_CTL) & fdi_config;
}

- intel_crt_reset(connector);
+ intel_crt_reset(&crt->base.base);
}