Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

vgaarb: remove the unused irq_set_state argument to vga_client_register

All callers pass NULL as the irq_set_state argument, so remove it and
the ->irq_set_state member in struct vga_device.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20210716061634.2446357-7-hch@lst.de
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>

authored by

Christoph Hellwig and committed by
Christian König
f6b1772b b8779475

+7 -30
+1 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
··· 3679 3679 /* this will fail for cards that aren't VGA class devices, just 3680 3680 * ignore it */ 3681 3681 if ((adev->pdev->class >> 8) == PCI_CLASS_DISPLAY_VGA) 3682 - vga_client_register(adev->pdev, adev, NULL, amdgpu_device_vga_set_decode); 3682 + vga_client_register(adev->pdev, adev, amdgpu_device_vga_set_decode); 3683 3683 3684 3684 if (amdgpu_device_supports_px(ddev)) { 3685 3685 px = true;
+1 -1
drivers/gpu/drm/i915/display/intel_vga.c
··· 147 147 * then we do not take part in VGA arbitration and the 148 148 * vga_client_register() fails with -ENODEV. 149 149 */ 150 - ret = vga_client_register(pdev, i915, NULL, intel_vga_set_decode); 150 + ret = vga_client_register(pdev, i915, intel_vga_set_decode); 151 151 if (ret && ret != -ENODEV) 152 152 return ret; 153 153
+1 -1
drivers/gpu/drm/nouveau/nouveau_vga.c
··· 94 94 return; 95 95 pdev = to_pci_dev(dev->dev); 96 96 97 - vga_client_register(pdev, dev, NULL, nouveau_vga_set_decode); 97 + vga_client_register(pdev, dev, nouveau_vga_set_decode); 98 98 99 99 /* don't register Thunderbolt eGPU with vga_switcheroo */ 100 100 if (pci_is_thunderbolt_attached(pdev))
+1 -1
drivers/gpu/drm/radeon/radeon_device.c
··· 1434 1434 /* if we have > 1 VGA cards, then disable the radeon VGA resources */ 1435 1435 /* this will fail for cards that aren't VGA class devices, just 1436 1436 * ignore it */ 1437 - vga_client_register(rdev->pdev, rdev, NULL, radeon_vga_set_decode); 1437 + vga_client_register(rdev->pdev, rdev, radeon_vga_set_decode); 1438 1438 1439 1439 if (rdev->flags & RADEON_IS_PX) 1440 1440 runtime = true;
+1 -22
drivers/gpu/vga/vgaarb.c
··· 72 72 unsigned int io_norm_cnt; /* normal IO count */ 73 73 unsigned int mem_norm_cnt; /* normal MEM count */ 74 74 bool bridge_has_one_vga; 75 - /* allow IRQ enable/disable hook */ 76 75 void *cookie; 77 - void (*irq_set_state)(void *cookie, bool enable); 78 76 unsigned int (*set_vga_decode)(void *cookie, bool decode); 79 77 }; 80 78 ··· 216 218 #endif 217 219 EXPORT_SYMBOL(vga_remove_vgacon); 218 220 219 - static inline void vga_irq_set_state(struct vga_device *vgadev, bool state) 220 - { 221 - if (vgadev->irq_set_state) 222 - vgadev->irq_set_state(vgadev->cookie, state); 223 - } 224 - 225 - 226 221 /* If we don't ever use VGA arb we should avoid 227 222 turning off anything anywhere due to old X servers getting 228 223 confused about the boot device not being VGA */ ··· 316 325 if ((match & conflict->decodes) & VGA_RSRC_LEGACY_IO) 317 326 pci_bits |= PCI_COMMAND_IO; 318 327 319 - if (pci_bits) { 320 - vga_irq_set_state(conflict, false); 328 + if (pci_bits) 321 329 flags |= PCI_VGA_STATE_CHANGE_DECODES; 322 - } 323 330 } 324 331 325 332 if (change_bridge) ··· 353 364 flags |= PCI_VGA_STATE_CHANGE_BRIDGE; 354 365 355 366 pci_set_vga_state(vgadev->pdev, true, pci_bits, flags); 356 - 357 - if (!vgadev->bridge_has_one_vga) 358 - vga_irq_set_state(vgadev, true); 359 367 360 368 vgadev->owns |= wants; 361 369 lock_them: ··· 841 855 * vga_client_register - register or unregister a VGA arbitration client 842 856 * @pdev: pci device of the VGA client 843 857 * @cookie: client cookie to be used in callbacks 844 - * @irq_set_state: irq state change callback 845 858 * @set_vga_decode: vga decode change callback 846 859 * 847 860 * Clients have two callback mechanisms they can use. 848 - * 849 - * @irq_set_state callback: If a client can't disable its GPUs VGA 850 - * resources, then we need to be able to ask it to turn off its irqs when we 851 - * turn off its mem and io decoding. 852 861 * 853 862 * @set_vga_decode callback: If a client can disable its GPU VGA resource, it 854 863 * will get a callback from this to set the encode/decode state. ··· 863 882 * Returns: 0 on success, -1 on failure 864 883 */ 865 884 int vga_client_register(struct pci_dev *pdev, void *cookie, 866 - void (*irq_set_state)(void *cookie, bool state), 867 885 unsigned int (*set_vga_decode)(void *cookie, 868 886 bool decode)) 869 887 { ··· 875 895 if (!vgadev) 876 896 goto bail; 877 897 878 - vgadev->irq_set_state = irq_set_state; 879 898 vgadev->set_vga_decode = set_vga_decode; 880 899 vgadev->cookie = cookie; 881 900 ret = 0;
+1 -1
drivers/vfio/pci/vfio_pci.c
··· 1951 1951 if (!vfio_pci_is_vga(pdev)) 1952 1952 return 0; 1953 1953 1954 - ret = vga_client_register(pdev, vdev, NULL, vfio_pci_set_vga_decode); 1954 + ret = vga_client_register(pdev, vdev, vfio_pci_set_vga_decode); 1955 1955 if (ret) 1956 1956 return ret; 1957 1957 vga_set_legacy_decoding(pdev, vfio_pci_set_vga_decode(vdev, false));
+1 -3
include/linux/vgaarb.h
··· 52 52 void vga_set_default_device(struct pci_dev *pdev); 53 53 int vga_remove_vgacon(struct pci_dev *pdev); 54 54 int vga_client_register(struct pci_dev *pdev, void *cookie, 55 - void (*irq_set_state)(void *cookie, bool state), 56 55 unsigned int (*set_vga_decode)(void *cookie, bool state)); 57 56 #else /* CONFIG_VGA_ARB */ 58 57 static inline void vga_set_legacy_decoding(struct pci_dev *pdev, ··· 78 79 return 0; 79 80 } 80 81 static inline int vga_client_register(struct pci_dev *pdev, void *cookie, 81 - void (*irq_set_state)(void *cookie, bool state), 82 82 unsigned int (*set_vga_decode)(void *cookie, bool state)) 83 83 { 84 84 return 0; ··· 116 118 117 119 static inline void vga_client_unregister(struct pci_dev *pdev) 118 120 { 119 - vga_client_register(pdev, NULL, NULL, NULL); 121 + vga_client_register(pdev, NULL, NULL); 120 122 } 121 123 122 124 #endif /* LINUX_VGA_H */