Commit f6b1772b authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Christian König

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: default avatarChristoph Hellwig <hch@lst.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20210716061634.2446357-7-hch@lst.deAcked-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
parent b8779475
...@@ -3679,7 +3679,7 @@ int amdgpu_device_init(struct amdgpu_device *adev, ...@@ -3679,7 +3679,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,
/* this will fail for cards that aren't VGA class devices, just /* this will fail for cards that aren't VGA class devices, just
* ignore it */ * ignore it */
if ((adev->pdev->class >> 8) == PCI_CLASS_DISPLAY_VGA) if ((adev->pdev->class >> 8) == PCI_CLASS_DISPLAY_VGA)
vga_client_register(adev->pdev, adev, NULL, amdgpu_device_vga_set_decode); vga_client_register(adev->pdev, adev, amdgpu_device_vga_set_decode);
if (amdgpu_device_supports_px(ddev)) { if (amdgpu_device_supports_px(ddev)) {
px = true; px = true;
......
...@@ -147,7 +147,7 @@ int intel_vga_register(struct drm_i915_private *i915) ...@@ -147,7 +147,7 @@ int intel_vga_register(struct drm_i915_private *i915)
* then we do not take part in VGA arbitration and the * then we do not take part in VGA arbitration and the
* vga_client_register() fails with -ENODEV. * vga_client_register() fails with -ENODEV.
*/ */
ret = vga_client_register(pdev, i915, NULL, intel_vga_set_decode); ret = vga_client_register(pdev, i915, intel_vga_set_decode);
if (ret && ret != -ENODEV) if (ret && ret != -ENODEV)
return ret; return ret;
......
...@@ -94,7 +94,7 @@ nouveau_vga_init(struct nouveau_drm *drm) ...@@ -94,7 +94,7 @@ nouveau_vga_init(struct nouveau_drm *drm)
return; return;
pdev = to_pci_dev(dev->dev); pdev = to_pci_dev(dev->dev);
vga_client_register(pdev, dev, NULL, nouveau_vga_set_decode); vga_client_register(pdev, dev, nouveau_vga_set_decode);
/* don't register Thunderbolt eGPU with vga_switcheroo */ /* don't register Thunderbolt eGPU with vga_switcheroo */
if (pci_is_thunderbolt_attached(pdev)) if (pci_is_thunderbolt_attached(pdev))
......
...@@ -1434,7 +1434,7 @@ int radeon_device_init(struct radeon_device *rdev, ...@@ -1434,7 +1434,7 @@ int radeon_device_init(struct radeon_device *rdev,
/* if we have > 1 VGA cards, then disable the radeon VGA resources */ /* if we have > 1 VGA cards, then disable the radeon VGA resources */
/* this will fail for cards that aren't VGA class devices, just /* this will fail for cards that aren't VGA class devices, just
* ignore it */ * ignore it */
vga_client_register(rdev->pdev, rdev, NULL, radeon_vga_set_decode); vga_client_register(rdev->pdev, rdev, radeon_vga_set_decode);
if (rdev->flags & RADEON_IS_PX) if (rdev->flags & RADEON_IS_PX)
runtime = true; runtime = true;
......
...@@ -72,9 +72,7 @@ struct vga_device { ...@@ -72,9 +72,7 @@ struct vga_device {
unsigned int io_norm_cnt; /* normal IO count */ unsigned int io_norm_cnt; /* normal IO count */
unsigned int mem_norm_cnt; /* normal MEM count */ unsigned int mem_norm_cnt; /* normal MEM count */
bool bridge_has_one_vga; bool bridge_has_one_vga;
/* allow IRQ enable/disable hook */
void *cookie; void *cookie;
void (*irq_set_state)(void *cookie, bool enable);
unsigned int (*set_vga_decode)(void *cookie, bool decode); unsigned int (*set_vga_decode)(void *cookie, bool decode);
}; };
...@@ -218,13 +216,6 @@ int vga_remove_vgacon(struct pci_dev *pdev) ...@@ -218,13 +216,6 @@ int vga_remove_vgacon(struct pci_dev *pdev)
#endif #endif
EXPORT_SYMBOL(vga_remove_vgacon); EXPORT_SYMBOL(vga_remove_vgacon);
static inline void vga_irq_set_state(struct vga_device *vgadev, bool state)
{
if (vgadev->irq_set_state)
vgadev->irq_set_state(vgadev->cookie, state);
}
/* If we don't ever use VGA arb we should avoid /* If we don't ever use VGA arb we should avoid
turning off anything anywhere due to old X servers getting turning off anything anywhere due to old X servers getting
confused about the boot device not being VGA */ confused about the boot device not being VGA */
...@@ -325,10 +316,8 @@ static struct vga_device *__vga_tryget(struct vga_device *vgadev, ...@@ -325,10 +316,8 @@ static struct vga_device *__vga_tryget(struct vga_device *vgadev,
if ((match & conflict->decodes) & VGA_RSRC_LEGACY_IO) if ((match & conflict->decodes) & VGA_RSRC_LEGACY_IO)
pci_bits |= PCI_COMMAND_IO; pci_bits |= PCI_COMMAND_IO;
if (pci_bits) { if (pci_bits)
vga_irq_set_state(conflict, false);
flags |= PCI_VGA_STATE_CHANGE_DECODES; flags |= PCI_VGA_STATE_CHANGE_DECODES;
}
} }
if (change_bridge) if (change_bridge)
...@@ -365,9 +354,6 @@ static struct vga_device *__vga_tryget(struct vga_device *vgadev, ...@@ -365,9 +354,6 @@ static struct vga_device *__vga_tryget(struct vga_device *vgadev,
pci_set_vga_state(vgadev->pdev, true, pci_bits, flags); pci_set_vga_state(vgadev->pdev, true, pci_bits, flags);
if (!vgadev->bridge_has_one_vga)
vga_irq_set_state(vgadev, true);
vgadev->owns |= wants; vgadev->owns |= wants;
lock_them: lock_them:
vgadev->locks |= (rsrc & VGA_RSRC_LEGACY_MASK); vgadev->locks |= (rsrc & VGA_RSRC_LEGACY_MASK);
...@@ -855,15 +841,10 @@ EXPORT_SYMBOL(vga_set_legacy_decoding); ...@@ -855,15 +841,10 @@ EXPORT_SYMBOL(vga_set_legacy_decoding);
* vga_client_register - register or unregister a VGA arbitration client * vga_client_register - register or unregister a VGA arbitration client
* @pdev: pci device of the VGA client * @pdev: pci device of the VGA client
* @cookie: client cookie to be used in callbacks * @cookie: client cookie to be used in callbacks
* @irq_set_state: irq state change callback
* @set_vga_decode: vga decode change callback * @set_vga_decode: vga decode change callback
* *
* Clients have two callback mechanisms they can use. * Clients have two callback mechanisms they can use.
* *
* @irq_set_state callback: If a client can't disable its GPUs VGA
* resources, then we need to be able to ask it to turn off its irqs when we
* turn off its mem and io decoding.
*
* @set_vga_decode callback: If a client can disable its GPU VGA resource, it * @set_vga_decode callback: If a client can disable its GPU VGA resource, it
* will get a callback from this to set the encode/decode state. * will get a callback from this to set the encode/decode state.
* *
...@@ -882,7 +863,6 @@ EXPORT_SYMBOL(vga_set_legacy_decoding); ...@@ -882,7 +863,6 @@ EXPORT_SYMBOL(vga_set_legacy_decoding);
* Returns: 0 on success, -1 on failure * Returns: 0 on success, -1 on failure
*/ */
int vga_client_register(struct pci_dev *pdev, void *cookie, int vga_client_register(struct pci_dev *pdev, void *cookie,
void (*irq_set_state)(void *cookie, bool state),
unsigned int (*set_vga_decode)(void *cookie, unsigned int (*set_vga_decode)(void *cookie,
bool decode)) bool decode))
{ {
...@@ -895,7 +875,6 @@ int vga_client_register(struct pci_dev *pdev, void *cookie, ...@@ -895,7 +875,6 @@ int vga_client_register(struct pci_dev *pdev, void *cookie,
if (!vgadev) if (!vgadev)
goto bail; goto bail;
vgadev->irq_set_state = irq_set_state;
vgadev->set_vga_decode = set_vga_decode; vgadev->set_vga_decode = set_vga_decode;
vgadev->cookie = cookie; vgadev->cookie = cookie;
ret = 0; ret = 0;
......
...@@ -1951,7 +1951,7 @@ static int vfio_pci_vga_init(struct vfio_pci_device *vdev) ...@@ -1951,7 +1951,7 @@ static int vfio_pci_vga_init(struct vfio_pci_device *vdev)
if (!vfio_pci_is_vga(pdev)) if (!vfio_pci_is_vga(pdev))
return 0; return 0;
ret = vga_client_register(pdev, vdev, NULL, vfio_pci_set_vga_decode); ret = vga_client_register(pdev, vdev, vfio_pci_set_vga_decode);
if (ret) if (ret)
return ret; return ret;
vga_set_legacy_decoding(pdev, vfio_pci_set_vga_decode(vdev, false)); vga_set_legacy_decoding(pdev, vfio_pci_set_vga_decode(vdev, false));
......
...@@ -52,7 +52,6 @@ struct pci_dev *vga_default_device(void); ...@@ -52,7 +52,6 @@ struct pci_dev *vga_default_device(void);
void vga_set_default_device(struct pci_dev *pdev); void vga_set_default_device(struct pci_dev *pdev);
int vga_remove_vgacon(struct pci_dev *pdev); int vga_remove_vgacon(struct pci_dev *pdev);
int vga_client_register(struct pci_dev *pdev, void *cookie, int vga_client_register(struct pci_dev *pdev, void *cookie,
void (*irq_set_state)(void *cookie, bool state),
unsigned int (*set_vga_decode)(void *cookie, bool state)); unsigned int (*set_vga_decode)(void *cookie, bool state));
#else /* CONFIG_VGA_ARB */ #else /* CONFIG_VGA_ARB */
static inline void vga_set_legacy_decoding(struct pci_dev *pdev, static inline void vga_set_legacy_decoding(struct pci_dev *pdev,
...@@ -79,7 +78,6 @@ static inline int vga_remove_vgacon(struct pci_dev *pdev) ...@@ -79,7 +78,6 @@ static inline int vga_remove_vgacon(struct pci_dev *pdev)
return 0; return 0;
} }
static inline int vga_client_register(struct pci_dev *pdev, void *cookie, static inline int vga_client_register(struct pci_dev *pdev, void *cookie,
void (*irq_set_state)(void *cookie, bool state),
unsigned int (*set_vga_decode)(void *cookie, bool state)) unsigned int (*set_vga_decode)(void *cookie, bool state))
{ {
return 0; return 0;
...@@ -118,7 +116,7 @@ static inline int vga_get_uninterruptible(struct pci_dev *pdev, ...@@ -118,7 +116,7 @@ static inline int vga_get_uninterruptible(struct pci_dev *pdev,
static inline void vga_client_unregister(struct pci_dev *pdev) static inline void vga_client_unregister(struct pci_dev *pdev)
{ {
vga_client_register(pdev, NULL, NULL, NULL); vga_client_register(pdev, NULL, NULL);
} }
#endif /* LINUX_VGA_H */ #endif /* LINUX_VGA_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment