diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2018-03-20 12:56:18 +0300 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2018-03-20 12:56:18 +0300 |
commit | edc39c9b4589a4ce9a69273b5a27a1459c3423d4 (patch) | |
tree | e5850fe4a533579b0de12c02e48f7dcdd60e8e38 /drivers/gpu/drm/drm_probe_helper.c | |
parent | a06cc94f3f8dfab74fe7fac3a6e9f15d77566d00 (diff) | |
parent | 1b5f3ba415fe4cf8b8b39c8d104ed44cde330658 (diff) | |
download | linux-edc39c9b4589a4ce9a69273b5a27a1459c3423d4.tar.xz |
Merge branch 'linus' into x86/build to pick up dependencies
Diffstat (limited to 'drivers/gpu/drm/drm_probe_helper.c')
-rw-r--r-- | drivers/gpu/drm/drm_probe_helper.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c index 555fbe54d6e2..00b8445ba819 100644 --- a/drivers/gpu/drm/drm_probe_helper.c +++ b/drivers/gpu/drm/drm_probe_helper.c @@ -654,6 +654,26 @@ out: } /** + * drm_kms_helper_is_poll_worker - is %current task an output poll worker? + * + * Determine if %current task is an output poll worker. This can be used + * to select distinct code paths for output polling versus other contexts. + * + * One use case is to avoid a deadlock between the output poll worker and + * the autosuspend worker wherein the latter waits for polling to finish + * upon calling drm_kms_helper_poll_disable(), while the former waits for + * runtime suspend to finish upon calling pm_runtime_get_sync() in a + * connector ->detect hook. + */ +bool drm_kms_helper_is_poll_worker(void) +{ + struct work_struct *work = current_work(); + + return work && work->func == output_poll_execute; +} +EXPORT_SYMBOL(drm_kms_helper_is_poll_worker); + +/** * drm_kms_helper_poll_disable - disable output polling * @dev: drm_device * |