Commit 81280d0e authored by Hans de Goede's avatar Hans de Goede Committed by Ben Skeggs

drm/nouveau: Rename acpi_work to hpd_work

We need to call drm_helper_hpd_irq_event() on resume to properly detect
monitor connection / disconnection on some laptops. For runtime-resume
(which gets called on resume from normal suspend too) we must call
drm_helper_hpd_irq_event() from a workqueue to avoid a deadlock.

Rename acpi_work to hpd_work, and move it out of the #ifdef CONFIG_ACPI
blocks to make it suitable for generic work.
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent bd9f6605
...@@ -349,21 +349,10 @@ static struct nouveau_drm_prop_enum_list dither_depth[] = { ...@@ -349,21 +349,10 @@ static struct nouveau_drm_prop_enum_list dither_depth[] = {
} \ } \
} while(0) } while(0)
#ifdef CONFIG_ACPI
/*
* Hans de Goede: This define belongs in acpi/video.h, I've submitted a patch
* to the acpi subsys to move it there from drivers/acpi/acpi_video.c .
* This should be dropped once that is merged.
*/
#ifndef ACPI_VIDEO_NOTIFY_PROBE
#define ACPI_VIDEO_NOTIFY_PROBE 0x81
#endif
static void static void
nouveau_display_acpi_work(struct work_struct *work) nouveau_display_hpd_work(struct work_struct *work)
{ {
struct nouveau_drm *drm = container_of(work, typeof(*drm), acpi_work); struct nouveau_drm *drm = container_of(work, typeof(*drm), hpd_work);
pm_runtime_get_sync(drm->dev->dev); pm_runtime_get_sync(drm->dev->dev);
...@@ -373,6 +362,17 @@ nouveau_display_acpi_work(struct work_struct *work) ...@@ -373,6 +362,17 @@ nouveau_display_acpi_work(struct work_struct *work)
pm_runtime_put_sync(drm->dev->dev); pm_runtime_put_sync(drm->dev->dev);
} }
#ifdef CONFIG_ACPI
/*
* Hans de Goede: This define belongs in acpi/video.h, I've submitted a patch
* to the acpi subsys to move it there from drivers/acpi/acpi_video.c .
* This should be dropped once that is merged.
*/
#ifndef ACPI_VIDEO_NOTIFY_PROBE
#define ACPI_VIDEO_NOTIFY_PROBE 0x81
#endif
static int static int
nouveau_display_acpi_ntfy(struct notifier_block *nb, unsigned long val, nouveau_display_acpi_ntfy(struct notifier_block *nb, unsigned long val,
void *data) void *data)
...@@ -385,9 +385,9 @@ nouveau_display_acpi_ntfy(struct notifier_block *nb, unsigned long val, ...@@ -385,9 +385,9 @@ nouveau_display_acpi_ntfy(struct notifier_block *nb, unsigned long val,
/* /*
* This may be the only indication we receive of a * This may be the only indication we receive of a
* connector hotplug on a runtime suspended GPU, * connector hotplug on a runtime suspended GPU,
* schedule acpi_work to check. * schedule hpd_work to check.
*/ */
schedule_work(&drm->acpi_work); schedule_work(&drm->hpd_work);
/* acpi-video should not generate keypresses for this */ /* acpi-video should not generate keypresses for this */
return NOTIFY_BAD; return NOTIFY_BAD;
...@@ -582,8 +582,8 @@ nouveau_display_create(struct drm_device *dev) ...@@ -582,8 +582,8 @@ nouveau_display_create(struct drm_device *dev)
} }
nouveau_backlight_init(dev); nouveau_backlight_init(dev);
INIT_WORK(&drm->hpd_work, nouveau_display_hpd_work);
#ifdef CONFIG_ACPI #ifdef CONFIG_ACPI
INIT_WORK(&drm->acpi_work, nouveau_display_acpi_work);
drm->acpi_nb.notifier_call = nouveau_display_acpi_ntfy; drm->acpi_nb.notifier_call = nouveau_display_acpi_ntfy;
register_acpi_notifier(&drm->acpi_nb); register_acpi_notifier(&drm->acpi_nb);
#endif #endif
......
...@@ -163,9 +163,9 @@ struct nouveau_drm { ...@@ -163,9 +163,9 @@ struct nouveau_drm {
struct nvbios vbios; struct nvbios vbios;
struct nouveau_display *display; struct nouveau_display *display;
struct backlight_device *backlight; struct backlight_device *backlight;
struct work_struct hpd_work;
#ifdef CONFIG_ACPI #ifdef CONFIG_ACPI
struct notifier_block acpi_nb; struct notifier_block acpi_nb;
struct work_struct acpi_work;
#endif #endif
/* power management */ /* power management */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment