[PATCH 11/11] HACK: i915: avoid with fbdev init warning doesn't seem to matter

Dave Airlie airlied at gmail.com
Wed Jun 4 21:01:38 PDT 2014


From: Dave Airlie <airlied at redhat.com>

---
 drivers/gpu/drm/i915/intel_dp_mst.c | 10 ++++++++++
 drivers/gpu/drm/i915/intel_fbdev.c  |  2 +-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c
index a7db741..ddac87f 100644
--- a/drivers/gpu/drm/i915/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/intel_dp_mst.c
@@ -346,6 +346,16 @@ struct drm_encoder *intel_mst_best_encoder(struct drm_connector *connector)
 {
 	struct intel_connector *intel_connector = to_intel_connector(connector);
 	struct intel_dp *intel_dp = intel_connector->mst_port;
+	int i;
+
+	/* try and pick the enabled one if there is one -
+	   stops intel_fbdev getting confused */
+	for (i = 0; i < I915_MAX_PIPES; i++) {
+		struct intel_dp_mst_encoder *mst_enc = intel_dp->mst_encoders[i];
+		if (mst_enc->base.base.crtc) {
+			return &intel_dp->mst_encoders[i]->base.base;
+		}
+	}
 	return &intel_dp->mst_encoders[0]->base.base;
 }
 
diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c
index 1949350..289c72a 100644
--- a/drivers/gpu/drm/i915/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/intel_fbdev.c
@@ -354,7 +354,7 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper,
 			connector_funcs = connector->helper_private;
 			encoder = connector_funcs->best_encoder(connector);
 		}
-		if (!encoder || WARN_ON(!encoder->crtc)) {
+		if (!encoder || !encoder->crtc) {
 			DRM_DEBUG_KMS("connector %s has no encoder or crtc, skipping\n",
 				      connector->name);
 			enabled[i] = false;
-- 
1.9.3



More information about the dri-devel mailing list