From 6dbbfad741d70ddb7dd9a153942ede89d24a80e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= Date: Tue, 27 Feb 2018 14:27:59 -0800 Subject: [PATCH] WIP: drm/i915: Export tile property in SST mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is another type of tiled mode, when the same monitor/panel is driven by 2 DisplaysPorts and if the DP ports are SST only the tile property is never exported. The tile property is used by userland to properly handle both port as a single display. TODO: remove debug messages Signed-off-by: José Roberto de Souza --- drivers/gpu/drm/drm_connector.c | 1 + drivers/gpu/drm/i915/intel_dp.c | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index b3cde897cd80..6079e28e02bd 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -1345,6 +1345,7 @@ int drm_mode_connector_set_tile_property(struct drm_connector *connector) connector->num_h_tile, connector->num_v_tile, connector->tile_h_loc, connector->tile_v_loc, connector->tile_h_size, connector->tile_v_size); + DRM_DEBUG_KMS("tile prop=%s\n", tile); ret = drm_property_replace_global_blob(dev, &connector->tile_blob_ptr, diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 6d7090d12cb4..f705fd50891c 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -4685,6 +4685,7 @@ static struct edid * intel_dp_get_edid(struct intel_dp *intel_dp) { struct intel_connector *intel_connector = intel_dp->attached_connector; + struct drm_connector *connector = &intel_connector->base; /* use cached edid if we have one */ if (intel_connector->edid) { @@ -4692,10 +4693,15 @@ intel_dp_get_edid(struct intel_dp *intel_dp) if (IS_ERR(intel_connector->edid)) return NULL; + DRM_DEBUG_KMS("[CONNECTOR:%d:%s] cached\n", connector->base.id, + connector->name); return drm_edid_duplicate(intel_connector->edid); - } else + } else { + DRM_DEBUG_KMS("[CONNECTOR:%d:%s] drm_get_edid()\n", connector->base.id, + connector->name); return drm_get_edid(&intel_connector->base, &intel_dp->aux.ddc); + } } static void @@ -4707,6 +4713,7 @@ intel_dp_set_edid(struct intel_dp *intel_dp) intel_dp_unset_edid(intel_dp); edid = intel_dp_get_edid(intel_dp); intel_connector->detect_edid = edid; + drm_mode_connector_set_tile_property(&intel_connector->base); intel_dp->has_audio = drm_detect_monitor_audio(edid); } @@ -5438,7 +5445,9 @@ static void intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *connector) { struct drm_i915_private *dev_priv = to_i915(connector->dev); - enum port port = dp_to_dig_port(intel_dp)->base.port; + struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp); + struct drm_device *dev = intel_dig_port->base.base.dev; + enum port port = intel_dig_port->base.port; if (!IS_G4X(dev_priv) && port != PORT_A) intel_attach_force_audio_property(connector); @@ -5457,6 +5466,9 @@ intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *connect connector->state->scaling_mode = DRM_MODE_SCALE_ASPECT; } + + drm_object_attach_property(&connector->base, + dev->mode_config.tile_property, 0); } static void intel_dp_init_panel_power_timestamps(struct intel_dp *intel_dp) -- 2.16.2