static int nouveau_pmops_runtime_suspend(struct device *dev) { struct pci_dev *pdev = to_pci_dev(dev); struct drm_device *drm_dev = pci_get_drvdata(pdev); int ret; if (nouveau_runtime_pm == 0) { pm_runtime_forbid(dev); return -EBUSY; } /* 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"); pm_runtime_forbid(dev); return -EBUSY; } nv_debug_level(SILENT); drm_kms_helper_poll_disable(drm_dev); vga_switcheroo_set_dynamic_switch(pdev, VGA_SWITCHEROO_OFF); nouveau_switcheroo_optimus_dsm(); ret = nouveau_do_suspend(drm_dev, true); pci_save_state(pdev); pci_disable_device(pdev); pci_set_power_state(pdev, PCI_D3cold); drm_dev->switch_power_state = DRM_SWITCH_POWER_DYNAMIC_OFF; return ret; } 0000000000000855 : 855: e8 00 00 00 00 callq 85a 856: R_X86_64_PC32 __fentry__-0x4 85a: 55 push %rbp 85b: 48 89 e5 mov %rsp,%rbp 85e: 41 55 push %r13 860: 41 54 push %r12 862: 4c 8d a7 68 ff ff ff lea -0x98(%rdi),%r12 869: 53 push %rbx 86a: 48 89 fb mov %rdi,%rbx 86d: 51 push %rcx 86e: 8b 05 00 00 00 00 mov 0x0(%rip),%eax # 874 870: R_X86_64_PC32 nouveau_runtime_pm-0x4 874: 4c 8b af a0 00 00 00 mov 0xa0(%rdi),%r13 87b: 85 c0 test %eax,%eax 87d: 75 12 jne 891 +-> 87f: 48 89 df mov %rbx,%rdi | ############### ############### | 882: e8 00 00 00 00 callq 887 | 883: R_X86_64_PC32 pm_runtime_forbid-0x4 ############### ############### | 887: b8 f0 ff ff ff mov $0xfffffff0,%eax | 88c: e9 8e 00 00 00 jmpq 91f ^ 891: ff c0 inc %eax | 893: 75 30 jne 8c5 | 895: e8 00 00 00 00 callq 89a 896: R_X86_64_PC32 nouveau_is_optimus-0x4 89a: 84 c0 test %al,%al 89c: 75 27 jne 8c5 89e: e8 00 00 00 00 callq 8a3 89f: R_X86_64_PC32 nouveau_is_v1_dsm-0x4 8a3: 84 c0 test %al,%al 8a5: 75 1e jne 8c5 8a7: f6 05 00 00 00 00 02 testb $0x2,0x0(%rip) # 8ae 8a9: R_X86_64_PC32 drm_debug-0x5 8ae: 74 cf je 87f 8b0: 48 c7 c6 00 00 00 00 mov $0x0,%rsi ^ 8b3: R_X86_64_32S .rodata.str1.1+0x135 | 8b7: 48 c7 c7 00 00 00 00 mov $0x0,%rdi | 8ba: R_X86_64_32S .rodata+0x20 | 8be: e8 00 00 00 00 callq 8c3 | 8bf: R_X86_64_PC32 drm_ut_debug_printk-0x4 ^- 8c3: eb ba jmp 87f 8c5: c7 05 00 00 00 00 04 movl $0x4,0x0(%rip) # 8cf 8cc: 00 00 00 8c7: R_X86_64_PC32 nv_info_debug_level-0x8 8cf: 4c 89 ef mov %r13,%rdi 8d2: e8 00 00 00 00 callq 8d7 8d3: R_X86_64_PC32 drm_kms_helper_poll_disable-0x4 8d7: 31 f6 xor %esi,%esi 8d9: 4c 89 e7 mov %r12,%rdi 8dc: e8 00 00 00 00 callq 8e1 8dd: R_X86_64_PC32 vga_switcheroo_set_dynamic_switch-0x4 8e1: e8 00 00 00 00 callq 8e6 8e2: R_X86_64_PC32 nouveau_switcheroo_optimus_dsm-0x4 8e6: be 01 00 00 00 mov $0x1,%esi 8eb: 4c 89 ef mov %r13,%rdi 8ee: e8 f4 f7 ff ff callq e7 8f3: 4c 89 e7 mov %r12,%rdi 8f6: 89 c3 mov %eax,%ebx 8f6: 89 c3 mov %eax,%ebx 8f8: e8 00 00 00 00 callq 8fd 8f9: R_X86_64_PC32 pci_save_state-0x4 8fd: 4c 89 e7 mov %r12,%rdi 900: e8 00 00 00 00 callq 905 901: R_X86_64_PC32 pci_disable_device-0x4 905: be 04 00 00 00 mov $0x4,%esi 90a: 4c 89 e7 mov %r12,%rdi 90d: e8 00 00 00 00 callq 912 90e: R_X86_64_PC32 pci_set_power_state-0x4 912: 89 d8 mov %ebx,%eax 914: 41 c7 85 60 05 00 00 movl $0x3,0x560(%r13) 91b: 03 00 00 00 91f: 5a pop %rdx 920: 5b pop %rbx 921: 41 5c pop %r12 923: 41 5d pop %r13 925: 5d pop %rbp 926: c3 retq