Displaying 20 results from an estimated 37 matches for "drm_switch_power_on".
2019 Jun 18
1
[PATCH] hwmon: return EINVAL if the GPU is powered down for sensors reads
...eau/nouveau_hwmon.c
index 618d8b780..d445c6f3f 100644
--- a/drm/nouveau/nouveau_hwmon.c
+++ b/drm/nouveau/nouveau_hwmon.c
@@ -426,6 +426,8 @@ nouveau_temp_read(struct device *dev, u32 attr, int channel, long *val)
switch (attr) {
case hwmon_temp_input:
+ if (drm_dev->switch_power_state != DRM_SWITCH_POWER_ON)
+ return -EINVAL;
ret = nvkm_therm_temp_get(therm);
*val = ret < 0 ? ret : (ret * 1000);
break;
@@ -472,6 +474,8 @@ nouveau_fan_read(struct device *dev, u32 attr, int channel, long *val)
switch (attr) {
case hwmon_fan_input:
+ if (drm_dev->switch_power_state != DRM_SWITCH_P...
2016 Nov 21
2
[PATCH 1/2] 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.
2019 Apr 04
4
[PATCH] pci/quirks: Add quirk to reset nvgpu at boot for the Lenovo ThinkPad P50
...bfbd9..48da72caa017 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -946,9 +946,6 @@ nouveau_pmops_runtime_resume(struct device *dev)
nvif_mask(&device->object, 0x088488, (1 << 25), (1 << 25));
drm_dev->switch_power_state = DRM_SWITCH_POWER_ON;
- /* Monitors may have been connected / disconnected during suspend */
- schedule_work(&nouveau_drm(drm_dev)->hpd_work);
-
return ret;
}
2020 Aug 12
6
[PATCH] drm/nouveau: Add fine-grain temperature reporting
...u_hwmon.c
index 1c3104d20571..e96355f93ce5 100644
--- a/drivers/gpu/drm/nouveau/nouveau_hwmon.c
+++ b/drivers/gpu/drm/nouveau/nouveau_hwmon.c
@@ -428,8 +428,8 @@ nouveau_temp_read(struct device *dev, u32 attr, int channel, long *val)
case hwmon_temp_input:
if (drm_dev->switch_power_state != DRM_SWITCH_POWER_ON)
return -EINVAL;
- ret = nvkm_therm_temp_get(therm);
- *val = ret < 0 ? ret : (ret * 1000);
+ ret = nvkm_therm_temp_millidegree_get(therm);
+ *val = ret;
break;
case hwmon_temp_max:
*val = therm->attr_get(therm, NVKM_THERM_ATTR_THRS_DOWN_CLK)
diff --git a/drivers/gpu/drm/nouve...
2017 Jan 24
1
[PATCH 2/2] drm/nouveau: Queue hpd_work on (runtime) resume
...;
> }
>
> static int
> @@ -766,6 +771,10 @@ nouveau_pmops_runtime_resume(struct device *dev)
> nvif_mask(&device->object, 0x088488, (1 << 25), (1 << 25));
> vga_switcheroo_set_dynamic_switch(pdev, VGA_SWITCHEROO_ON);
> drm_dev->switch_power_state = DRM_SWITCH_POWER_ON;
> +
> + /* Monitors may have been connected / disconnected during suspend */
> + schedule_work(&nouveau_drm(drm_dev)->hpd_work);
> +
> return ret;
> }
>
>
2018 Feb 18
0
[PATCH 5/7] vga_switcheroo: Use device link for HDA controller
...lse);
pci_save_state(pdev);
@@ -757,7 +756,6 @@ static int amdgpu_pmops_runtime_resume(struct device *dev)
ret = amdgpu_device_resume(drm_dev, false, false);
drm_kms_helper_poll_enable(drm_dev);
- vga_switcheroo_set_dynamic_switch(pdev, VGA_SWITCHEROO_ON);
drm_dev->switch_power_state = DRM_SWITCH_POWER_ON;
return 0;
}
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
index 3e293029e3a6..6959951d45d6 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -856,7 +856,6 @@ nouveau_pmops_runtime_suspend(struct device...
2016 Nov 21
0
[PATCH 2/2] drm/nouveau: Queue hpd_work on (runtime) resume
...ev)->hpd_work);
+
+ return ret;
}
static int
@@ -766,6 +771,10 @@ nouveau_pmops_runtime_resume(struct device *dev)
nvif_mask(&device->object, 0x088488, (1 << 25), (1 << 25));
vga_switcheroo_set_dynamic_switch(pdev, VGA_SWITCHEROO_ON);
drm_dev->switch_power_state = DRM_SWITCH_POWER_ON;
+
+ /* Monitors may have been connected / disconnected during suspend */
+ schedule_work(&nouveau_drm(drm_dev)->hpd_work);
+
return ret;
}
--
2.9.3
2018 Aug 15
0
[PATCH v3 1/3] drm/nouveau: Remove useless poll_enable() call in switcheroo_set_state()
...-46,7 +46,6 @@ nouveau_switcheroo_set_state(struct pci_dev *pdev,
pr_err("VGA switcheroo: switched nouveau on\n");
dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
nouveau_pmops_resume(&pdev->dev);
- drm_kms_helper_poll_enable(dev);
dev->switch_power_state = DRM_SWITCH_POWER_ON;
} else {
pr_err("VGA switcheroo: switched nouveau off\n");
--
2.17.1
2018 Aug 13
3
[PATCH 0/3] Cleanup drm_kms_helper_poll_enable/disable() calls
Does what it says on the label, a lot of these calls are already handled
somewhere else and don't appear to be here for a legitimate reason
anymore.
Lyude Paul (3):
drm/nouveau: Remove useless poll_enable() call in
switcheroo_set_state()
drm/nouveau: Remove useless poll_disable() call in
switcheroo_set_state()
drm/nouveau: Remove useless poll_enable() call in drm_load()
2018 Aug 15
3
[PATCH v3 0/3] Cleanup drm_kms_helper_poll_enable/disable() calls
Next version of https://patchwork.freedesktop.org/series/48131/
Only changes are new A-Bs and R-Bs
Lyude Paul (3):
drm/nouveau: Remove useless poll_enable() call in
switcheroo_set_state()
drm/nouveau: Remove useless poll_disable() call in
switcheroo_set_state()
drm/nouveau: Remove useless poll_enable() call in drm_load()
drivers/gpu/drm/nouveau/nouveau_drm.c | 4 +---
2012 Apr 25
5
[PATCH v2 4/4] drm/nouveau: gpu lockup recovery
...ureset_in_progress);
+ intr_rwsem_down_write(&dev_priv->ioctls_rwsem);
+
+ dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
+ if (nouveau_pci_suspend(pdev, pmm))
+ goto fail;
+
+ dev->switch_power_state = DRM_SWITCH_POWER_OFF;
+ return true;
+
+fail:
+ dev->switch_power_state = DRM_SWITCH_POWER_ON;
+ intr_rwsem_up_write(&dev_priv->ioctls_rwsem);
+ return false;
+}
+
+static void on(struct drm_device *dev)
+{
+ struct pci_dev *pdev = dev->pdev;
+ struct drm_nouveau_private *dev_priv = dev->dev_private;
+
+ dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
+ atomic_dec(&...
2018 Feb 20
2
[PATCH 5/7] vga_switcheroo: Use device link for HDA controller
...> @@ -757,7 +756,6 @@ static int amdgpu_pmops_runtime_resume(struct device *dev)
>
> ret = amdgpu_device_resume(drm_dev, false, false);
> drm_kms_helper_poll_enable(drm_dev);
> - vga_switcheroo_set_dynamic_switch(pdev, VGA_SWITCHEROO_ON);
> drm_dev->switch_power_state = DRM_SWITCH_POWER_ON;
> return 0;
> }
> diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
> index 3e293029e3a6..6959951d45d6 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_drm.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
> @@ -856,7 +856,6 @@ nouveau_p...
2012 Apr 22
2
[RFC PATCH 5/5] drm/nouveau: gpu lockup recovery
...;dev_priv->gpureset_in_progress);
+ down_write(&dev->ioctls_rwsem);
+
+ dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
+ if (nouveau_pci_suspend(pdev, pmm))
+ goto fail;
+
+ dev->switch_power_state = DRM_SWITCH_POWER_OFF;
+ return true;
+
+fail:
+ dev->switch_power_state = DRM_SWITCH_POWER_ON;
+ up_write(&dev->ioctls_rwsem);
+ return false;
+}
+
+static void on(struct drm_device *dev)
+{
+ struct pci_dev *pdev = dev->pdev;
+ struct drm_nouveau_private *dev_priv = dev->dev_private;
+
+ dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
+ atomic_dec(&dev_priv->gpu...
2013 Jul 24
4
[PATCH] [RFC] drm/nouveau: bring back hdmi audio device after switcheroo power down
...heroo_state state)
{
@@ -37,6 +53,7 @@ nouveau_switcheroo_set_state(struct pci_dev *pdev,
dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
nouveau_pmops_resume(&pdev->dev);
drm_kms_helper_poll_enable(dev);
+ nouveau_reenable_hdmi_device(dev);
dev->switch_power_state = DRM_SWITCH_POWER_ON;
} else {
printk(KERN_ERR "VGA switcheroo: switched nouveau off\n");
--
1.8.2.1
2020 Sep 09
0
[PATCH] drm/nouveau: Add fine-grain temperature reporting
...00644
> --- a/drivers/gpu/drm/nouveau/nouveau_hwmon.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_hwmon.c
> @@ -428,8 +428,8 @@ nouveau_temp_read(struct device *dev, u32 attr, int channel, long *val)
> case hwmon_temp_input:
> if (drm_dev->switch_power_state != DRM_SWITCH_POWER_ON)
> return -EINVAL;
> - ret = nvkm_therm_temp_get(therm);
> - *val = ret < 0 ? ret : (ret * 1000);
> + ret = nvkm_therm_temp_millidegree_get(therm);
> + *val = ret;
> break;
>...
2019 Apr 15
0
[PATCH] pci/quirks: Add quirk to reset nvgpu at boot for the Lenovo ThinkPad P50
...4
> --- a/drivers/gpu/drm/nouveau/nouveau_drm.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
> @@ -946,9 +946,6 @@ nouveau_pmops_runtime_resume(struct device *dev)
> nvif_mask(&device->object, 0x088488, (1 << 25), (1 << 25));
> drm_dev->switch_power_state = DRM_SWITCH_POWER_ON;
>
> - /* Monitors may have been connected / disconnected during suspend */
> - schedule_work(&nouveau_drm(drm_dev)->hpd_work);
> -
> return ret;
> }
>
--
Cheers,
Lyude Paul
2018 Feb 18
12
[PATCH 0/7] Modernize vga_switcheroo by using device link for HDA
Modernize vga_switcheroo by using a "device link" to enforce a runtime PM
dependency from an HDA controller to the GPU it's integrated into.
Remove thereby obsoleted code and fix a bunch of bugs.
Device links were introduced in v4.10.
Users might see a small power saving if the discrete GPU is in use and
its HDA controller is not, because the HDA controller is now allowed
to runtime
2020 Sep 16
2
[PATCH v2 1/2] drm/nouveau: return temperatures in temp_get() via parameter
...therm = nvxx_therm(&drm->client.device);
- int ret;
+ int ret = 0, temp;
if (!therm || !therm->attr_get)
return -EOPNOTSUPP;
@@ -428,8 +428,8 @@ nouveau_temp_read(struct device *dev, u32 attr, int channel, long *val)
case hwmon_temp_input:
if (drm_dev->switch_power_state != DRM_SWITCH_POWER_ON)
return -EINVAL;
- ret = nvkm_therm_temp_get(therm);
- *val = ret < 0 ? ret : (ret * 1000);
+ ret = nvkm_therm_temp_get(therm, &temp);
+ *val = temp * 1000;
break;
case hwmon_temp_max:
*val = therm->attr_get(therm, NVKM_THERM_ATTR_THRS_DOWN_CLK)
@@ -459,7 +459,7 @@ nouveau...
2020 Sep 16
2
[PATCH v2 1/2] drm/nouveau: return temperatures in temp_get() via parameter
...gt; if (!therm || !therm->attr_get)
> > return -EOPNOTSUPP;
> > @@ -428,8 +428,8 @@ nouveau_temp_read(struct device *dev, u32 attr, int channel, long *val)
> > case hwmon_temp_input:
> > if (drm_dev->switch_power_state != DRM_SWITCH_POWER_ON)
> > return -EINVAL;
> > - ret = nvkm_therm_temp_get(therm);
> > - *val = ret < 0 ? ret : (ret * 1000);
> > + ret = nvkm_therm_temp_get(therm, &temp);
> > + *val = temp * 1000;
>...
2020 Sep 09
2
[PATCH] drm/nouveau: Add fine-grain temperature reporting
...vers/gpu/drm/nouveau/nouveau_hwmon.c
> > +++ b/drivers/gpu/drm/nouveau/nouveau_hwmon.c
> > @@ -428,8 +428,8 @@ nouveau_temp_read(struct device *dev, u32 attr, int channel, long *val)
> > case hwmon_temp_input:
> > if (drm_dev->switch_power_state != DRM_SWITCH_POWER_ON)
> > return -EINVAL;
> > - ret = nvkm_therm_temp_get(therm);
> > - *val = ret < 0 ? ret : (ret * 1000);
> > + ret = nvkm_therm_temp_millidegree_get(therm);
> > + *val = ret;
> >...