diff options
author | Jean-Sébastien Pédron <dumbbell@FreeBSD.org> | 2023-02-08 17:53:57 +0000 |
---|---|---|
committer | Jean-Sébastien Pédron <dumbbell@FreeBSD.org> | 2023-02-16 11:55:18 +0000 |
commit | d94ab63c110262283277f3522d190eeea5006089 (patch) | |
tree | 758d9152e4bdcc87b6fd693934d7bcf69dcfc56f | |
parent | fdaf6e24e5d1144fcb5409c047e575a26e14e04a (diff) | |
download | src-d94ab63c110262283277f3522d190eeea5006089.tar.gz src-d94ab63c110262283277f3522d190eeea5006089.zip |
linuxkpi: Update `vga_client_register()` and add `vga_client_unregister()`
For `vga_client_register()`, the API is modified twice in a row. To keep
the API compatible with all commits in the DRM driver, we introduce two
`LINUXKPI_VERSION` version bumps.
Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D38533
(cherry picked from commit 1c6d8146fdec8267712615c261bf6c8800f8ecfe)
-rw-r--r-- | sys/compat/linuxkpi/common/include/linux/vgaarb.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/vgaarb.h b/sys/compat/linuxkpi/common/include/linux/vgaarb.h index 853927f1c049..d43a88136864 100644 --- a/sys/compat/linuxkpi/common/include/linux/vgaarb.h +++ b/sys/compat/linuxkpi/common/include/linux/vgaarb.h @@ -239,16 +239,43 @@ static inline int vga_conflicts(struct pci_dev *p1, struct pci_dev *p2) * by userspace since we some older X servers have issues. */ #if defined(CONFIG_VGA_ARB) +#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 51501 +int vga_client_register(struct pci_dev *pdev, + unsigned int (*set_vga_decode)(struct pci_dev *pdev, bool state)); +#elif defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 51500 +int vga_client_register(struct pci_dev *pdev, void *cookie, + unsigned int (*set_vga_decode)(void *cookie, bool state)); +#else 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)); +#endif +#else +#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 51501 +static inline int vga_client_register(struct pci_dev *pdev, + unsigned int (*set_vga_decode)(struct pci_dev *pdev, bool state)) +#elif defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 51500 +static inline int vga_client_register(struct pci_dev *pdev, void *cookie, + unsigned int (*set_vga_decode)(void *cookie, bool state)) #else 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)) +#endif { return 0; } + +static inline int vga_client_unregister(struct pci_dev *pdev) +{ +#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 51501 + return (vga_client_register(NULL, NULL)); +#elif defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 51500 + return (vga_client_register(NULL, NULL, NULL)); +#else + return (vga_client_register(NULL, NULL, NULL, NULL)); +#endif +} #endif #endif /* _LINUXKPI_LINUX_VGA_H_ */ |