if (connector->funcs->force)
connector->funcs->force(connector);
} else {
- connector->status = connector->funcs->detect(connector, false);
+ connector->status = connector->funcs->detect(connector, true);
drm_kms_helper_poll_enable(dev);
}
!(connector->polled & DRM_CONNECTOR_POLL_HPD))
continue;
- status = connector->funcs->detect(connector, true);
+ status = connector->funcs->detect(connector, false);
if (old_status != status)
changed = true;
}
}
static enum drm_connector_status
-intel_crt_detect(struct drm_connector *connector,
- bool nondestructive)
+intel_crt_detect(struct drm_connector *connector, bool force)
{
struct drm_device *dev = connector->dev;
struct drm_encoder *encoder = intel_attached_encoder(connector);
if (intel_crt_detect_ddc(encoder))
return connector_status_connected;
- if (nondestructive)
+ if (!force)
return connector->status;
/* for pre-945g platforms use load detect */
* \return false if DP port is disconnected.
*/
static enum drm_connector_status
-intel_dp_detect(struct drm_connector *connector,
- bool nondestructive)
+intel_dp_detect(struct drm_connector *connector, bool force)
{
struct drm_encoder *encoder = intel_attached_encoder(connector);
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
* Unimplemented.
*/
static enum drm_connector_status
-intel_dvo_detect(struct drm_connector *connector,
- bool nondestructive)
+intel_dvo_detect(struct drm_connector *connector, bool force)
{
struct drm_encoder *encoder = intel_attached_encoder(connector);
struct intel_dvo *intel_dvo = enc_to_intel_dvo(encoder);
}
static enum drm_connector_status
-intel_hdmi_detect(struct drm_connector *connector,
- bool nondestructive)
+intel_hdmi_detect(struct drm_connector *connector, bool force)
{
struct drm_encoder *encoder = intel_attached_encoder(connector);
struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder);
* needed, using lid status notification from the input layer.
*/
static enum drm_connector_status
-intel_lvds_detect(struct drm_connector *connector,
- bool nondestructive)
+intel_lvds_detect(struct drm_connector *connector, bool force)
{
struct drm_device *dev = connector->dev;
enum drm_connector_status status = connector_status_connected;
*/
if (connector)
connector->status = connector->funcs->detect(connector,
- true);
+ false);
/* Don't force modeset on machines where it causes a GPU lockup */
if (dmi_check_system(intel_no_modeset_on_lid))
if (!analog_connector)
return false;
- if (analog_connector->funcs->detect(analog_connector, true) ==
+ if (analog_connector->funcs->detect(analog_connector, false) ==
connector_status_disconnected)
return false;
}
static enum drm_connector_status
-intel_sdvo_detect(struct drm_connector *connector,
- bool nondestructive)
+intel_sdvo_detect(struct drm_connector *connector, bool force)
{
uint16_t response;
struct drm_encoder *encoder = intel_attached_encoder(connector);
* we have a pipe programmed in order to probe the TV.
*/
static enum drm_connector_status
-intel_tv_detect(struct drm_connector *connector,
- bool nondestructive)
+intel_tv_detect(struct drm_connector *connector, bool force)
{
struct drm_display_mode mode;
struct drm_encoder *encoder = intel_attached_encoder(connector);
if (encoder->crtc && encoder->crtc->enabled) {
type = intel_tv_detect_type(intel_tv);
- } else if (nondestructive) {
+ } else if (force) {
struct drm_crtc *crtc;
int dpms_mode;
}
static enum drm_connector_status
-nouveau_connector_detect(struct drm_connector *connector,
- bool nondestructive)
+nouveau_connector_detect(struct drm_connector *connector, bool force)
{
struct drm_device *dev = connector->dev;
struct nouveau_connector *nv_connector = nouveau_connector(connector);
}
static enum drm_connector_status
-nouveau_connector_detect_lvds(struct drm_connector *connector,
- bool nondestructive)
+nouveau_connector_detect_lvds(struct drm_connector *connector, bool force)
{
struct drm_device *dev = connector->dev;
struct drm_nouveau_private *dev_priv = dev->dev_private;
/* Try retrieving EDID via DDC */
if (!dev_priv->vbios.fp_no_ddc) {
- status = nouveau_connector_detect(connector, nondestructive);
+ status = nouveau_connector_detect(connector, force);
if (status == connector_status_connected)
goto out;
}
}
static enum drm_connector_status
-radeon_lvds_detect(struct drm_connector *connector,
- bool nondestructive)
+radeon_lvds_detect(struct drm_connector *connector, bool force)
{
struct radeon_connector *radeon_connector = to_radeon_connector(connector);
struct drm_encoder *encoder = radeon_best_single_encoder(connector);
}
static enum drm_connector_status
-radeon_vga_detect(struct drm_connector *connector,
- bool nondestructive)
+radeon_vga_detect(struct drm_connector *connector, bool force)
{
struct radeon_connector *radeon_connector = to_radeon_connector(connector);
struct drm_encoder *encoder;
}
static enum drm_connector_status
-radeon_tv_detect(struct drm_connector *connector,
- bool nondestructive)
+radeon_tv_detect(struct drm_connector *connector, bool force)
{
struct drm_encoder *encoder;
struct drm_encoder_helper_funcs *encoder_funcs;
* if its shared we have to set the other connector to disconnected.
*/
static enum drm_connector_status
-radeon_dvi_detect(struct drm_connector *connector,
- bool nondestructive)
+radeon_dvi_detect(struct drm_connector *connector, bool force)
{
struct radeon_connector *radeon_connector = to_radeon_connector(connector);
struct drm_encoder *encoder = NULL;
}
static enum drm_connector_status
-radeon_dp_detect(struct drm_connector *connector,
- bool nondestructive)
+radeon_dp_detect(struct drm_connector *connector, bool force)
{
struct radeon_connector *radeon_connector = to_radeon_connector(connector);
enum drm_connector_status ret = connector_status_disconnected;
static enum drm_connector_status
vmw_ldu_connector_detect(struct drm_connector *connector,
- bool nondestructive)
+ bool force)
{
if (vmw_connector_to_ldu(connector)->pref_active)
return connector_status_connected;
drm_connector_init(dev, connector, &vmw_legacy_connector_funcs,
DRM_MODE_CONNECTOR_LVDS);
- connector->status = vmw_ldu_connector_detect(connector);
+ connector->status = vmw_ldu_connector_detect(connector, true);
drm_encoder_init(dev, encoder, &vmw_legacy_encoder_funcs,
DRM_MODE_ENCODER_LVDS);
ldu->pref_height = 600;
ldu->pref_active = false;
}
- con->status = vmw_ldu_connector_detect(con);
+ con->status = vmw_ldu_connector_detect(con, true);
}
mutex_unlock(&dev->mode_config.mutex);
void (*dpms)(struct drm_connector *connector, int mode);
void (*save)(struct drm_connector *connector);
void (*restore)(struct drm_connector *connector);
+
+ /* Check to see if anything is attached to the connector.
+ * @force is set to false whilst polling, true when checking the
+ * connector due to user request. @force can be used by the driver
+ * to avoid expensive, destructive operations during automated
+ * probing.
+ */
enum drm_connector_status (*detect)(struct drm_connector *connector,
- bool nondestructive);
+ bool force);
int (*fill_modes)(struct drm_connector *connector, uint32_t max_width, uint32_t max_height);
int (*set_property)(struct drm_connector *connector, struct drm_property *property,
uint64_t val);