git: d94ab63c1102 - stable/13 - linuxkpi: Update `vga_client_register()` and add `vga_client_unregister()`
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 16 Feb 2023 11:56:22 UTC
The branch stable/13 has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=d94ab63c110262283277f3522d190eeea5006089 commit d94ab63c110262283277f3522d190eeea5006089 Author: Jean-Sébastien Pédron <dumbbell@FreeBSD.org> AuthorDate: 2023-02-08 17:53:57 +0000 Commit: Jean-Sébastien Pédron <dumbbell@FreeBSD.org> CommitDate: 2023-02-16 11:55:18 +0000 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) --- sys/compat/linuxkpi/common/include/linux/vgaarb.h | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+) 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_ */