|
@@ -115,25 +115,28 @@ static int drm_helper_probe_add_cmdline_mode(struct drm_connector *connector)
|
|
|
|
|
|
#define DRM_OUTPUT_POLL_PERIOD (10*HZ)
|
|
#define DRM_OUTPUT_POLL_PERIOD (10*HZ)
|
|
/**
|
|
/**
|
|
- * drm_kms_helper_poll_enable_locked - re-enable output polling.
|
|
|
|
|
|
+ * drm_kms_helper_poll_enable - re-enable output polling.
|
|
* @dev: drm_device
|
|
* @dev: drm_device
|
|
*
|
|
*
|
|
- * This function re-enables the output polling work without
|
|
|
|
- * locking the mode_config mutex.
|
|
|
|
|
|
+ * This function re-enables the output polling work, after it has been
|
|
|
|
+ * temporarily disabled using drm_kms_helper_poll_disable(), for example over
|
|
|
|
+ * suspend/resume.
|
|
*
|
|
*
|
|
- * This is like drm_kms_helper_poll_enable() however it is to be
|
|
|
|
- * called from a context where the mode_config mutex is locked
|
|
|
|
- * already.
|
|
|
|
|
|
+ * Drivers can call this helper from their device resume implementation. It is
|
|
|
|
+ * an error to call this when the output polling support has not yet been set
|
|
|
|
+ * up.
|
|
|
|
+ *
|
|
|
|
+ * Note that calls to enable and disable polling must be strictly ordered, which
|
|
|
|
+ * is automatically the case when they're only call from suspend/resume
|
|
|
|
+ * callbacks.
|
|
*/
|
|
*/
|
|
-void drm_kms_helper_poll_enable_locked(struct drm_device *dev)
|
|
|
|
|
|
+void drm_kms_helper_poll_enable(struct drm_device *dev)
|
|
{
|
|
{
|
|
bool poll = false;
|
|
bool poll = false;
|
|
struct drm_connector *connector;
|
|
struct drm_connector *connector;
|
|
struct drm_connector_list_iter conn_iter;
|
|
struct drm_connector_list_iter conn_iter;
|
|
unsigned long delay = DRM_OUTPUT_POLL_PERIOD;
|
|
unsigned long delay = DRM_OUTPUT_POLL_PERIOD;
|
|
|
|
|
|
- WARN_ON(!mutex_is_locked(&dev->mode_config.mutex));
|
|
|
|
-
|
|
|
|
if (!dev->mode_config.poll_enabled || !drm_kms_helper_poll)
|
|
if (!dev->mode_config.poll_enabled || !drm_kms_helper_poll)
|
|
return;
|
|
return;
|
|
|
|
|
|
@@ -163,7 +166,7 @@ void drm_kms_helper_poll_enable_locked(struct drm_device *dev)
|
|
if (poll)
|
|
if (poll)
|
|
schedule_delayed_work(&dev->mode_config.output_poll_work, delay);
|
|
schedule_delayed_work(&dev->mode_config.output_poll_work, delay);
|
|
}
|
|
}
|
|
-EXPORT_SYMBOL(drm_kms_helper_poll_enable_locked);
|
|
|
|
|
|
+EXPORT_SYMBOL(drm_kms_helper_poll_enable);
|
|
|
|
|
|
static enum drm_connector_status
|
|
static enum drm_connector_status
|
|
drm_connector_detect(struct drm_connector *connector, bool force)
|
|
drm_connector_detect(struct drm_connector *connector, bool force)
|
|
@@ -290,7 +293,7 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
|
|
|
|
|
|
/* Re-enable polling in case the global poll config changed. */
|
|
/* Re-enable polling in case the global poll config changed. */
|
|
if (drm_kms_helper_poll != dev->mode_config.poll_running)
|
|
if (drm_kms_helper_poll != dev->mode_config.poll_running)
|
|
- drm_kms_helper_poll_enable_locked(dev);
|
|
|
|
|
|
+ drm_kms_helper_poll_enable(dev);
|
|
|
|
|
|
dev->mode_config.poll_running = drm_kms_helper_poll;
|
|
dev->mode_config.poll_running = drm_kms_helper_poll;
|
|
|
|
|
|
@@ -484,8 +487,12 @@ out:
|
|
* This function disables the output polling work.
|
|
* This function disables the output polling work.
|
|
*
|
|
*
|
|
* Drivers can call this helper from their device suspend implementation. It is
|
|
* Drivers can call this helper from their device suspend implementation. It is
|
|
- * not an error to call this even when output polling isn't enabled or arlready
|
|
|
|
- * disabled.
|
|
|
|
|
|
+ * not an error to call this even when output polling isn't enabled or already
|
|
|
|
+ * disabled. Polling is re-enabled by calling drm_kms_helper_poll_enable().
|
|
|
|
+ *
|
|
|
|
+ * Note that calls to enable and disable polling must be strictly ordered, which
|
|
|
|
+ * is automatically the case when they're only call from suspend/resume
|
|
|
|
+ * callbacks.
|
|
*/
|
|
*/
|
|
void drm_kms_helper_poll_disable(struct drm_device *dev)
|
|
void drm_kms_helper_poll_disable(struct drm_device *dev)
|
|
{
|
|
{
|
|
@@ -495,24 +502,6 @@ void drm_kms_helper_poll_disable(struct drm_device *dev)
|
|
}
|
|
}
|
|
EXPORT_SYMBOL(drm_kms_helper_poll_disable);
|
|
EXPORT_SYMBOL(drm_kms_helper_poll_disable);
|
|
|
|
|
|
-/**
|
|
|
|
- * drm_kms_helper_poll_enable - re-enable output polling.
|
|
|
|
- * @dev: drm_device
|
|
|
|
- *
|
|
|
|
- * This function re-enables the output polling work.
|
|
|
|
- *
|
|
|
|
- * Drivers can call this helper from their device resume implementation. It is
|
|
|
|
- * an error to call this when the output polling support has not yet been set
|
|
|
|
- * up.
|
|
|
|
- */
|
|
|
|
-void drm_kms_helper_poll_enable(struct drm_device *dev)
|
|
|
|
-{
|
|
|
|
- mutex_lock(&dev->mode_config.mutex);
|
|
|
|
- drm_kms_helper_poll_enable_locked(dev);
|
|
|
|
- mutex_unlock(&dev->mode_config.mutex);
|
|
|
|
-}
|
|
|
|
-EXPORT_SYMBOL(drm_kms_helper_poll_enable);
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* drm_kms_helper_poll_init - initialize and enable output polling
|
|
* drm_kms_helper_poll_init - initialize and enable output polling
|
|
* @dev: drm_device
|
|
* @dev: drm_device
|