@@ -293,14 +293,17 @@ static void reschedule_output_poll_work(struct drm_device *dev)
293
293
* Drivers can call this helper from their device resume implementation. It is
294
294
* not an error to call this even when output polling isn't enabled.
295
295
*
296
+ * If device polling was never initialized before, this call will trigger a
297
+ * warning and return.
298
+ *
296
299
* Note that calls to enable and disable polling must be strictly ordered, which
297
300
* is automatically the case when they're only call from suspend/resume
298
301
* callbacks.
299
302
*/
300
303
void drm_kms_helper_poll_enable (struct drm_device * dev )
301
304
{
302
- if (!dev -> mode_config .poll_enabled || ! drm_kms_helper_poll ||
303
- dev -> mode_config .poll_running )
305
+ if (drm_WARN_ON_ONCE ( dev , !dev -> mode_config .poll_enabled ) ||
306
+ ! drm_kms_helper_poll || dev -> mode_config .poll_running )
304
307
return ;
305
308
306
309
if (drm_kms_helper_enable_hpd (dev ) ||
@@ -871,12 +874,18 @@ EXPORT_SYMBOL(drm_kms_helper_is_poll_worker);
871
874
* not an error to call this even when output polling isn't enabled or already
872
875
* disabled. Polling is re-enabled by calling drm_kms_helper_poll_enable().
873
876
*
877
+ * If however, the polling was never initialized, this call will trigger a
878
+ * warning and return
879
+ *
874
880
* Note that calls to enable and disable polling must be strictly ordered, which
875
881
* is automatically the case when they're only call from suspend/resume
876
882
* callbacks.
877
883
*/
878
884
void drm_kms_helper_poll_disable (struct drm_device * dev )
879
885
{
886
+ if (drm_WARN_ON (dev , !dev -> mode_config .poll_enabled ))
887
+ return ;
888
+
880
889
if (dev -> mode_config .poll_running )
881
890
drm_kms_helper_disable_hpd (dev );
882
891
0 commit comments