Merge remote branch 'anholt/drm-intel-next' into drm-next
* anholt/drm-intel-next: (515 commits) drm/i915: Fix out of tree builds drm/i915: move fence lru to struct drm_i915_fence_reg drm/i915: don't allow tiling changes on pinned buffers v2 drm/i915: Be extra careful about A/D matching for multifunction SDVO drm/i915: Fix DDC bus selection for multifunction SDVO drm/i915: cleanup mode setting before unmapping registers drm/i915: Make fbc control wrapper functions drm/i915: Wait for the GPU whilst shrinking, if truly desperate. drm/i915: Use spatio-temporal dithering on PCH [MTD] Remove zero-length files mtdbdi.c and internal.ho pata_pcmcia / ide-cs: Fix bad hashes for Transcend and kingston IDs libata: Fix several inaccuracies in developer's guide slub: Fix bad boundary check in init_kmem_cache_nodes() raid6: fix recovery performance regression KEYS: call_sbin_request_key() must write lock keyrings before modifying them KEYS: Use RCU dereference wrappers in keyring key type code KEYS: find_keyring_by_name() can gain access to a freed keyring ALSA: hda: Fix 0 dB for Packard Bell models using Conexant CX20549 (Venice) ALSA: hda - Add quirk for Dell Inspiron 19T using a Conexant CX20582 ALSA: take tu->qlock with irqs disabled ...
This commit is contained in:
@ -1504,16 +1504,17 @@ intel_analog_is_connected(struct drm_device *dev)
|
||||
}
|
||||
|
||||
enum drm_connector_status
|
||||
intel_sdvo_hdmi_sink_detect(struct drm_connector *connector, u16 response)
|
||||
intel_sdvo_hdmi_sink_detect(struct drm_connector *connector)
|
||||
{
|
||||
struct drm_encoder *encoder = intel_attached_encoder(connector);
|
||||
struct intel_encoder *intel_encoder = enc_to_intel_encoder(encoder);
|
||||
struct intel_sdvo_priv *sdvo_priv = intel_encoder->dev_priv;
|
||||
struct intel_connector *intel_connector = to_intel_connector(connector);
|
||||
struct intel_sdvo_connector *sdvo_connector = intel_connector->dev_priv;
|
||||
enum drm_connector_status status = connector_status_connected;
|
||||
struct edid *edid = NULL;
|
||||
|
||||
edid = drm_get_edid(connector,
|
||||
intel_encoder->ddc_bus);
|
||||
edid = drm_get_edid(connector, intel_encoder->ddc_bus);
|
||||
|
||||
/* This is only applied to SDVO cards with multiple outputs */
|
||||
if (edid == NULL && intel_sdvo_multifunc_encoder(intel_encoder)) {
|
||||
@ -1526,8 +1527,7 @@ intel_sdvo_hdmi_sink_detect(struct drm_connector *connector, u16 response)
|
||||
*/
|
||||
while(temp_ddc > 1) {
|
||||
sdvo_priv->ddc_bus = temp_ddc;
|
||||
edid = drm_get_edid(connector,
|
||||
intel_encoder->ddc_bus);
|
||||
edid = drm_get_edid(connector, intel_encoder->ddc_bus);
|
||||
if (edid) {
|
||||
/*
|
||||
* When we can get the EDID, maybe it is the
|
||||
@ -1544,28 +1544,25 @@ intel_sdvo_hdmi_sink_detect(struct drm_connector *connector, u16 response)
|
||||
/* when there is no edid and no monitor is connected with VGA
|
||||
* port, try to use the CRT ddc to read the EDID for DVI-connector
|
||||
*/
|
||||
if (edid == NULL &&
|
||||
sdvo_priv->analog_ddc_bus &&
|
||||
if (edid == NULL && sdvo_priv->analog_ddc_bus &&
|
||||
!intel_analog_is_connected(connector->dev))
|
||||
edid = drm_get_edid(connector,
|
||||
sdvo_priv->analog_ddc_bus);
|
||||
edid = drm_get_edid(connector, sdvo_priv->analog_ddc_bus);
|
||||
|
||||
if (edid != NULL) {
|
||||
/* Don't report the output as connected if it's a DVI-I
|
||||
* connector with a non-digital EDID coming out.
|
||||
*/
|
||||
if (response & (SDVO_OUTPUT_TMDS0 | SDVO_OUTPUT_TMDS1)) {
|
||||
if (edid->input & DRM_EDID_INPUT_DIGITAL)
|
||||
sdvo_priv->is_hdmi =
|
||||
drm_detect_hdmi_monitor(edid);
|
||||
else
|
||||
status = connector_status_disconnected;
|
||||
}
|
||||
bool is_digital = !!(edid->input & DRM_EDID_INPUT_DIGITAL);
|
||||
bool need_digital = !!(sdvo_connector->output_flag & SDVO_TMDS_MASK);
|
||||
|
||||
/* DDC bus is shared, match EDID to connector type */
|
||||
if (is_digital && need_digital)
|
||||
sdvo_priv->is_hdmi = drm_detect_hdmi_monitor(edid);
|
||||
else if (is_digital != need_digital)
|
||||
status = connector_status_disconnected;
|
||||
|
||||
kfree(edid);
|
||||
connector->display_info.raw_edid = NULL;
|
||||
|
||||
} else if (response & (SDVO_OUTPUT_TMDS0 | SDVO_OUTPUT_TMDS1))
|
||||
} else
|
||||
status = connector_status_disconnected;
|
||||
|
||||
kfree(edid);
|
||||
|
||||
return status;
|
||||
}
|
||||
@ -1601,8 +1598,8 @@ static enum drm_connector_status intel_sdvo_detect(struct drm_connector *connect
|
||||
|
||||
if ((sdvo_connector->output_flag & response) == 0)
|
||||
ret = connector_status_disconnected;
|
||||
else if (response & (SDVO_OUTPUT_TMDS0 | SDVO_OUTPUT_TMDS1))
|
||||
ret = intel_sdvo_hdmi_sink_detect(connector, response);
|
||||
else if (response & SDVO_TMDS_MASK)
|
||||
ret = intel_sdvo_hdmi_sink_detect(connector);
|
||||
else
|
||||
ret = connector_status_connected;
|
||||
|
||||
@ -2054,40 +2051,17 @@ static const struct drm_encoder_funcs intel_sdvo_enc_funcs = {
|
||||
* outputs, then LVDS outputs.
|
||||
*/
|
||||
static void
|
||||
intel_sdvo_select_ddc_bus(struct intel_sdvo_priv *dev_priv)
|
||||
intel_sdvo_select_ddc_bus(struct drm_i915_private *dev_priv,
|
||||
struct intel_sdvo_priv *sdvo, u32 reg)
|
||||
{
|
||||
uint16_t mask = 0;
|
||||
unsigned int num_bits;
|
||||
struct sdvo_device_mapping *mapping;
|
||||
|
||||
/* Make a mask of outputs less than or equal to our own priority in the
|
||||
* list.
|
||||
*/
|
||||
switch (dev_priv->controlled_output) {
|
||||
case SDVO_OUTPUT_LVDS1:
|
||||
mask |= SDVO_OUTPUT_LVDS1;
|
||||
case SDVO_OUTPUT_LVDS0:
|
||||
mask |= SDVO_OUTPUT_LVDS0;
|
||||
case SDVO_OUTPUT_TMDS1:
|
||||
mask |= SDVO_OUTPUT_TMDS1;
|
||||
case SDVO_OUTPUT_TMDS0:
|
||||
mask |= SDVO_OUTPUT_TMDS0;
|
||||
case SDVO_OUTPUT_RGB1:
|
||||
mask |= SDVO_OUTPUT_RGB1;
|
||||
case SDVO_OUTPUT_RGB0:
|
||||
mask |= SDVO_OUTPUT_RGB0;
|
||||
break;
|
||||
}
|
||||
if (IS_SDVOB(reg))
|
||||
mapping = &(dev_priv->sdvo_mappings[0]);
|
||||
else
|
||||
mapping = &(dev_priv->sdvo_mappings[1]);
|
||||
|
||||
/* Count bits to find what number we are in the priority list. */
|
||||
mask &= dev_priv->caps.output_flags;
|
||||
num_bits = hweight16(mask);
|
||||
if (num_bits > 3) {
|
||||
/* if more than 3 outputs, default to DDC bus 3 for now */
|
||||
num_bits = 3;
|
||||
}
|
||||
|
||||
/* Corresponds to SDVO_CONTROL_BUS_DDCx */
|
||||
dev_priv->ddc_bus = 1 << num_bits;
|
||||
sdvo->ddc_bus = 1 << ((mapping->ddc_pin & 0xf0) >> 4);
|
||||
}
|
||||
|
||||
static bool
|
||||
@ -2866,7 +2840,7 @@ bool intel_sdvo_init(struct drm_device *dev, int sdvo_reg)
|
||||
goto err_i2c;
|
||||
}
|
||||
|
||||
intel_sdvo_select_ddc_bus(sdvo_priv);
|
||||
intel_sdvo_select_ddc_bus(dev_priv, sdvo_priv, sdvo_reg);
|
||||
|
||||
/* Set the input timing to the screen. Assume always input 0. */
|
||||
intel_sdvo_set_target_input(intel_encoder, true, false);
|
||||
|
Reference in New Issue
Block a user