Message ID | 3323fbefe77239808e9abba90929bf2a02d916a3.1493951798.git.lv.zheng@intel.com (mailing list archive) |
---|---|
State | Superseded, archived |
Headers | show |
On 05.05.2017 04:40, Lv Zheng wrote: > Since notification side has been changed to always notify kernel listeners > using _LID returning value. Now listeners needn't invoke invoke > acpi_lid_open(), it should use a spec suggested control method lid device > usage model: register lid notification and use the notified value instead, > which is the only way to ensure the value is correct. > > This patch fixes i915 driver to drop acpi_lid_open() user. It's not > possible to change nouveau_connector.c user using a simple way now. So this > patch only marks acpi_lid_open() as deprecated to accelerate this process > by indicating this change to the nouveau developers. > Resend with intel-gfx@lists.freedesktop.org and nouveau@lists.freedesktop.org on cc? > Signed-off-by: Lv Zheng <lv.zheng@intel.com> > --- > drivers/acpi/button.c | 7 ++++++- > drivers/gpu/drm/i915/intel_lvds.c | 2 +- > 2 files changed, 7 insertions(+), 2 deletions(-) > > diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c > index 7ff3a75..50d7898 100644 > --- a/drivers/acpi/button.c > +++ b/drivers/acpi/button.c > @@ -348,7 +348,12 @@ int acpi_lid_notifier_unregister(struct notifier_block *nb) > } > EXPORT_SYMBOL(acpi_lid_notifier_unregister); > > -int acpi_lid_open(void) > +/* > + * The intentional usage model is to register a lid notifier and use the > + * notified value instead. Directly evaluating _LID without seeing a > + * Notify(lid, 0x80) is not reliable. > + */ > +int __deprecated acpi_lid_open(void) > { > if (!lid_device) > return -ENODEV; > diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c > index 9ca4dc4..8ca9080 100644 > --- a/drivers/gpu/drm/i915/intel_lvds.c > +++ b/drivers/gpu/drm/i915/intel_lvds.c > @@ -548,7 +548,7 @@ static int intel_lid_notify(struct notifier_block *nb, unsigned long val, > /* Don't force modeset on machines where it causes a GPU lockup */ > if (dmi_check_system(intel_no_modeset_on_lid)) > goto exit; > - if (!acpi_lid_open()) { > + if (!val) { > /* do modeset on next lid open event */ > dev_priv->modeset_restore = MODESET_ON_LID_OPEN; > goto exit; > -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi, Julian > From: Julian Wiedmann [mailto:julian.wiedmann@jwi.name] > Subject: Re: [PATCH 5/5] ACPI: button: Obselete acpi_lid_open() invocations > > On 05.05.2017 04:40, Lv Zheng wrote: > > Since notification side has been changed to always notify kernel listeners > > using _LID returning value. Now listeners needn't invoke invoke > > acpi_lid_open(), it should use a spec suggested control method lid device > > usage model: register lid notification and use the notified value instead, > > which is the only way to ensure the value is correct. > > > > This patch fixes i915 driver to drop acpi_lid_open() user. It's not > > possible to change nouveau_connector.c user using a simple way now. So this > > patch only marks acpi_lid_open() as deprecated to accelerate this process > > by indicating this change to the nouveau developers. > > > Resend with intel-gfx@lists.freedesktop.org and nouveau@lists.freedesktop.org > on cc? Sure. I'll add it to see if there could be objections. Thanks Lv > > > Signed-off-by: Lv Zheng <lv.zheng@intel.com> > > --- > > drivers/acpi/button.c | 7 ++++++- > > drivers/gpu/drm/i915/intel_lvds.c | 2 +- > > 2 files changed, 7 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c > > index 7ff3a75..50d7898 100644 > > --- a/drivers/acpi/button.c > > +++ b/drivers/acpi/button.c > > @@ -348,7 +348,12 @@ int acpi_lid_notifier_unregister(struct notifier_block *nb) > > } > > EXPORT_SYMBOL(acpi_lid_notifier_unregister); > > > > -int acpi_lid_open(void) > > +/* > > + * The intentional usage model is to register a lid notifier and use the > > + * notified value instead. Directly evaluating _LID without seeing a > > + * Notify(lid, 0x80) is not reliable. > > + */ > > +int __deprecated acpi_lid_open(void) > > { > > if (!lid_device) > > return -ENODEV; > > diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c > > index 9ca4dc4..8ca9080 100644 > > --- a/drivers/gpu/drm/i915/intel_lvds.c > > +++ b/drivers/gpu/drm/i915/intel_lvds.c > > @@ -548,7 +548,7 @@ static int intel_lid_notify(struct notifier_block *nb, unsigned long val, > > /* Don't force modeset on machines where it causes a GPU lockup */ > > if (dmi_check_system(intel_no_modeset_on_lid)) > > goto exit; > > - if (!acpi_lid_open()) { > > + if (!val) { > > /* do modeset on next lid open event */ > > dev_priv->modeset_restore = MODESET_ON_LID_OPEN; > > goto exit; > >
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c index 7ff3a75..50d7898 100644 --- a/drivers/acpi/button.c +++ b/drivers/acpi/button.c @@ -348,7 +348,12 @@ int acpi_lid_notifier_unregister(struct notifier_block *nb) } EXPORT_SYMBOL(acpi_lid_notifier_unregister); -int acpi_lid_open(void) +/* + * The intentional usage model is to register a lid notifier and use the + * notified value instead. Directly evaluating _LID without seeing a + * Notify(lid, 0x80) is not reliable. + */ +int __deprecated acpi_lid_open(void) { if (!lid_device) return -ENODEV; diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index 9ca4dc4..8ca9080 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c @@ -548,7 +548,7 @@ static int intel_lid_notify(struct notifier_block *nb, unsigned long val, /* Don't force modeset on machines where it causes a GPU lockup */ if (dmi_check_system(intel_no_modeset_on_lid)) goto exit; - if (!acpi_lid_open()) { + if (!val) { /* do modeset on next lid open event */ dev_priv->modeset_restore = MODESET_ON_LID_OPEN; goto exit;
Since notification side has been changed to always notify kernel listeners using _LID returning value. Now listeners needn't invoke invoke acpi_lid_open(), it should use a spec suggested control method lid device usage model: register lid notification and use the notified value instead, which is the only way to ensure the value is correct. This patch fixes i915 driver to drop acpi_lid_open() user. It's not possible to change nouveau_connector.c user using a simple way now. So this patch only marks acpi_lid_open() as deprecated to accelerate this process by indicating this change to the nouveau developers. Signed-off-by: Lv Zheng <lv.zheng@intel.com> --- drivers/acpi/button.c | 7 ++++++- drivers/gpu/drm/i915/intel_lvds.c | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-)