Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Feb 2023 21:09:45 GMT
From:      =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= <dumbbell@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 1c6d8146fdec - main - linuxkpi: Update `vga_client_register()` and add `vga_client_unregister()`
Message-ID:  <202302132109.31DL9jSU056318@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by dumbbell (ports committer):

URL: https://cgit.FreeBSD.org/src/commit/?id=1c6d8146fdec8267712615c261bf6c8800f8ecfe

commit 1c6d8146fdec8267712615c261bf6c8800f8ecfe
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-13 21:09:31 +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
---
 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_ */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202302132109.31DL9jSU056318>