search for: vga_switcheroo_set_dynamic_switch

Displaying 20 results from an estimated 22 matches for "vga_switcheroo_set_dynamic_switch".

2016 Jul 10
2
vga_switcheroo audio runpm
...be. I'm not sure if that additional (unnecessary) restriction is a problem. I've recently tried to add runtime pm for muxed laptops to vga_switcheroo, this is something that Pierre Moreau (cc:) has expressed an interest in for his MacBook Pro. I came across a major roadblock in the form of vga_switcheroo_set_dynamic_switch(). That function is called from the DRM driver when the GPU runtime suspends and resumes. It takes the vgasr_mutex. The problem is, if the user initiates a switch of the mux, that mutex is already taken in vga_switcheroo_debugfs_write(). If the GPU we're switching to is asleep, it'll wake u...
2018 Feb 18
0
[PATCH 5/7] vga_switcheroo: Use device link for HDA controller
.....ba4335fd4f65 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -720,7 +720,6 @@ static int amdgpu_pmops_runtime_suspend(struct device *dev) drm_dev->switch_power_state = DRM_SWITCH_POWER_CHANGING; drm_kms_helper_poll_disable(drm_dev); - vga_switcheroo_set_dynamic_switch(pdev, VGA_SWITCHEROO_OFF); ret = amdgpu_device_suspend(drm_dev, false, false); 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_se...
2018 Feb 11
2
[PATCH 0/5] Fix deadlock on runtime suspend in DRM drivers
...18,9 @@ static int amdgpu_pmops_runtime_suspend(struct device *dev) return -EBUSY; } + printk("waiting 12 sec\n"); + msleep(12*1000); + printk("done waiting 12 sec\n"); drm_dev->switch_power_state = DRM_SWITCH_POWER_CHANGING; drm_kms_helper_poll_disable(drm_dev); vga_switcheroo_set_dynamic_switch(pdev, VGA_SWITCHEROO_OFF); diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c index 555fbe5..ee7cf0d 100644 --- a/drivers/gpu/drm/drm_probe_helper.c +++ b/drivers/gpu/drm/drm_probe_helper.c @@ -586,6 +586,7 @@ static void output_poll_execute(struct work_struct *wor...
2018 Feb 20
2
[PATCH 5/7] vga_switcheroo: Use device link for HDA controller
...ivers/gpu/drm/amd/amdgpu/amdgpu_drv.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c > @@ -720,7 +720,6 @@ static int amdgpu_pmops_runtime_suspend(struct device *dev) > > drm_dev->switch_power_state = DRM_SWITCH_POWER_CHANGING; > drm_kms_helper_poll_disable(drm_dev); > - vga_switcheroo_set_dynamic_switch(pdev, VGA_SWITCHEROO_OFF); > > ret = amdgpu_device_suspend(drm_dev, false, false); > 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_e...
2018 Feb 18
12
[PATCH 0/7] Modernize vga_switcheroo by using device link for HDA
...st, unlike before. Under the hood things become quite a bit leaner. Also, this series gets us one step closer to supporting runtime PM on muxed laptops such as the MacBook Pro because it fixes a deadlock occurring when runtime resuming the discrete GPU on switching the mux. (The deadlock occurs in vga_switcheroo_set_dynamic_switch() and that function is obsoleted and removed by this series.) The meat of the series is in patch [5/7], read its commit message for details. The other patches contain prep and cleanup work. Patches [1/7], [2/7] and [5/7] require an ack from Bjorn (and Rafael?), patch [5/7] requires an ack from T...
2018 Feb 11
0
[PATCH 0/5] Fix deadlock on runtime suspend in DRM drivers
...19,9 @@ static int amdgpu_pmops_runtime_suspend(struct device *dev) return -EBUSY; } + printk("waiting 12 sec\n"); + msleep(12*1000); + printk("done waiting 12 sec\n"); drm_dev->switch_power_state = DRM_SWITCH_POWER_CHANGING; drm_kms_helper_poll_disable(drm_dev); vga_switcheroo_set_dynamic_switch(pdev, VGA_SWITCHEROO_OFF); diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c index 555fbe5..ee7cf0d 100644 --- a/drivers/gpu/drm/drm_probe_helper.c +++ b/drivers/gpu/drm/drm_probe_helper.c @@ -586,6 +586,7 @@ static void output_poll_execute(struct work_struct *wor...
2018 Mar 03
12
[PATCH v2 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, v2. Changes since v1: - Replace patch [1/7] to use pci_save_state() / pci_restore_state() for consistency between runtime PM code path of bound and unbound devices. (Rafael, Bjorn) - Patch [5/7]: Drop an unnecessary initialization. (Bjorn) Rephrase
2016 May 21
3
[PATCH v5] vga_switcheroo: Add helper for deferred probing
...nux/vga_switcheroo.h @@ -165,6 +165,7 @@ int vga_switcheroo_unlock_ddc(struct pci_dev *pdev); int vga_switcheroo_process_delayed_switch(void); +bool vga_switcheroo_client_probe_defer(struct pci_dev *pdev); enum vga_switcheroo_state vga_switcheroo_get_client_state(struct pci_dev *dev); void vga_switcheroo_set_dynamic_switch(struct pci_dev *pdev, enum vga_switcheroo_state dynamic); @@ -188,6 +189,7 @@ static inline enum vga_switcheroo_handler_flags_t vga_switcheroo_handler_flags(v static inline int vga_switcheroo_lock_ddc(struct pci_dev *pdev) { return -ENODEV; } static inline int vga_switcheroo_unlock_ddc(struct pci...
2017 May 15
1
[PATCH] drm/nouveau: Fix drm poll_helper handling
...-774,9 +777,6 @@ nouveau_pmops_runtime_resume(struct device *dev) ret = nouveau_do_resume(drm_dev, true); - if (!drm_dev->mode_config.poll_enabled) - drm_kms_helper_poll_enable(drm_dev); - /* do magic */ nvif_mask(&device->object, 0x088488, (1 << 25), (1 << 25)); vga_switcheroo_set_dynamic_switch(pdev, VGA_SWITCHEROO_ON); -- 2.12.2
2014 Mar 19
2
[PATCH] drm: compute runpm on load, don't register autosuspend for non-runpm
...L; - /* are we optimus enabled? */ - if (nouveau_runtime_pm == -1 && !nouveau_is_optimus() && !nouveau_is_v1_dsm()) { - DRM_DEBUG_DRIVER("failing to power off - not optimus\n"); - return -EINVAL; - } - nv_debug_level(SILENT); drm_kms_helper_poll_disable(drm_dev); vga_switcheroo_set_dynamic_switch(pdev, VGA_SWITCHEROO_OFF); @@ -951,12 +949,6 @@ static int nouveau_pmops_runtime_idle(struct device *dev) if (nouveau_runtime_pm == 0) return -EBUSY; - /* are we optimus enabled? */ - if (nouveau_runtime_pm == -1 && !nouveau_is_optimus() && !nouveau_is_v1_dsm()) { - DRM_DEBU...
2016 May 23
0
[Intel-gfx] [PATCH v5] vga_switcheroo: Add helper for deferred probing
...,7 @@ int vga_switcheroo_unlock_ddc(struct pci_dev *pdev); > > int vga_switcheroo_process_delayed_switch(void); > > +bool vga_switcheroo_client_probe_defer(struct pci_dev *pdev); > enum vga_switcheroo_state vga_switcheroo_get_client_state(struct pci_dev *dev); > > void vga_switcheroo_set_dynamic_switch(struct pci_dev *pdev, enum vga_switcheroo_state dynamic); > @@ -188,6 +189,7 @@ static inline enum vga_switcheroo_handler_flags_t vga_switcheroo_handler_flags(v > static inline int vga_switcheroo_lock_ddc(struct pci_dev *pdev) { return -ENODEV; } > static inline int vga_switcheroo_unlock...
2016 May 19
2
[PATCH v4] vga_switcheroo: Add helper for deferred probing
...nux/vga_switcheroo.h @@ -165,6 +165,7 @@ int vga_switcheroo_unlock_ddc(struct pci_dev *pdev); int vga_switcheroo_process_delayed_switch(void); +bool vga_switcheroo_client_probe_defer(struct pci_dev *pdev); enum vga_switcheroo_state vga_switcheroo_get_client_state(struct pci_dev *dev); void vga_switcheroo_set_dynamic_switch(struct pci_dev *pdev, enum vga_switcheroo_state dynamic); @@ -188,6 +189,7 @@ static inline enum vga_switcheroo_handler_flags_t vga_switcheroo_handler_flags(v static inline int vga_switcheroo_lock_ddc(struct pci_dev *pdev) { return -ENODEV; } static inline int vga_switcheroo_unlock_ddc(struct pci...
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.
2017 Jan 24
1
[PATCH 2/2] drm/nouveau: Queue hpd_work on (runtime) resume
...ng suspend */ > + schedule_work(&nouveau_drm(drm_dev)->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; > } > >
2016 Nov 16
0
[PATCH] drm/nouveau: Don't enabling polling twice on runtime resume
...will have + * already enabled polling. As such, make sure we don't enable it twice + * and deadlock + */ + if (!drm_dev->mode_config.poll_enabled) + drm_kms_helper_poll_enable(drm_dev); + /* do magic */ nvif_mask(&device->object, 0x088488, (1 << 25), (1 << 25)); vga_switcheroo_set_dynamic_switch(pdev, VGA_SWITCHEROO_ON); -- 2.7.4
2016 Nov 21
0
[PATCH 2/2] drm/nouveau: Queue hpd_work on (runtime) resume
...may have been connected / disconnected during suspend */ + schedule_work(&nouveau_drm(drm_dev)->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
2013 Dec 12
1
[PATCH] drm/nouveau: only runtime suspend by default in optimus configuration
...L; + /* are we optimus enabled? */ + if (nouveau_runtime_pm == -1 && !nouveau_is_optimus() && !nouveau_is_v1_dsm()) { + DRM_DEBUG_DRIVER("failing to power off - not optimus\n"); + return -EINVAL; + } + nv_debug_level(SILENT); drm_kms_helper_poll_disable(drm_dev); vga_switcheroo_set_dynamic_switch(pdev, VGA_SWITCHEROO_OFF); -- 1.8.3.2
2014 Mar 19
0
[PATCH] drm: compute runpm on load, don't register autosuspend for non-runpm
...au_is_optimus() && !nouveau_is_v1_dsm()) { > - DRM_DEBUG_DRIVER("failing to power off - not optimus\n"); > - return -EINVAL; > - } > - > nv_debug_level(SILENT); > drm_kms_helper_poll_disable(drm_dev); > vga_switcheroo_set_dynamic_switch(pdev, VGA_SWITCHEROO_OFF); > @@ -951,12 +949,6 @@ static int nouveau_pmops_runtime_idle(struct device *dev) > if (nouveau_runtime_pm == 0) > return -EBUSY; > > - /* are we optimus enabled? */ > - if (nouveau_runtime_pm == -1 && !nouveau_...
2016 May 31
2
[PATCH v6 1/2] vga_switcheroo: Add helper for deferred probing
...nux/vga_switcheroo.h @@ -165,6 +165,7 @@ int vga_switcheroo_unlock_ddc(struct pci_dev *pdev); int vga_switcheroo_process_delayed_switch(void); +bool vga_switcheroo_client_probe_defer(struct pci_dev *pdev); enum vga_switcheroo_state vga_switcheroo_get_client_state(struct pci_dev *dev); void vga_switcheroo_set_dynamic_switch(struct pci_dev *pdev, enum vga_switcheroo_state dynamic); @@ -188,6 +189,7 @@ static inline enum vga_switcheroo_handler_flags_t vga_switcheroo_handler_flags(v static inline int vga_switcheroo_lock_ddc(struct pci_dev *pdev) { return -ENODEV; } static inline int vga_switcheroo_unlock_ddc(struct pci...
2015 Jan 17
0
[PATCH RFC] nouveau: Add support for Gmux _DSM method
...y needs some more work, but I'd like to get some comments. Not sure if it is really related to the gmux or if it is a different Optimus _DSM version. I tested it on my laptop (MCP79/7A + G96) and the G96 successfully goes to sleep, however it is still marked as PWR in vga_switcheroo, despite `vga_switcheroo_set_dynamic_switch(pdev, VGA_SWITCHEROO_OFF)` being called. --- drm/nouveau_acpi.c | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++--- drm/nouveau_acpi.h | 2 ++ drm/nouveau_drm.c | 4 +-- 3 files changed, 94 insertions(+), 6 deletions(-) diff --git a/drm/nouveau_acpi.c b/drm/nouveau_acpi.c index 622424...