diff options
Diffstat (limited to 'graphics/drm-515-kmod')
| -rw-r--r-- | graphics/drm-515-kmod/Makefile | 13 | ||||
| -rw-r--r-- | graphics/drm-515-kmod/Makefile.version | 2 | ||||
| -rw-r--r-- | graphics/drm-515-kmod/distinfo | 6 | ||||
| -rw-r--r-- | graphics/drm-515-kmod/files/extra-patch-linuxkpi-pci | 102 |
4 files changed, 115 insertions, 8 deletions
diff --git a/graphics/drm-515-kmod/Makefile b/graphics/drm-515-kmod/Makefile index 1f7940ea262b..47eb4b4aa210 100644 --- a/graphics/drm-515-kmod/Makefile +++ b/graphics/drm-515-kmod/Makefile @@ -1,12 +1,12 @@ PORTNAME= drm-515-kmod PORTVERSION= ${DRM_KMOD_DISTVERSION} -PORTREVISION= 6 +PORTREVISION= 8 CATEGORIES= graphics kld .include "Makefile.version" MAINTAINER= x11@FreeBSD.org -COMMENT= DRM drivers modules +COMMENT= Direct Rendering Manager GPU drivers WWW= https://github.com/freebsd/drm-kmod/ LICENSE= BSD2CLAUSE MIT GPLv2 @@ -31,13 +31,18 @@ GH_TAGNAME= ${DRM_KMOD_GH_TAGNAME} SUB_FILES= pkg-message SUB_LIST= OPSYS=${OPSYS} OSREL=${OSREL} -.if ${OPSYS} == FreeBSD && ${OSVERSION} < 1400081 -IGNORE= not supported on older than 14.0, no kernel support +.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1600000 +IGNORE= not supported on FreeBSD 16.0 and higher .endif .if ${OPSYS} != FreeBSD IGNORE= not supported on anything but FreeBSD (missing linuxkpi functionality) .endif +.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1500065 +# LinuxKPI PCI changes. We cannot apply them to drm-kmod yet as it would break 14.x. +EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-linuxkpi-pci +.endif + .if ${ARCH} == "amd64" PLIST_SUB+= AMDGPU="" PLIST_SUB+= I915="" diff --git a/graphics/drm-515-kmod/Makefile.version b/graphics/drm-515-kmod/Makefile.version index e14d70600da8..db97049c4ab1 100644 --- a/graphics/drm-515-kmod/Makefile.version +++ b/graphics/drm-515-kmod/Makefile.version @@ -2,4 +2,4 @@ # # This will be included from consumers such as nvidia-drm DRM_KMOD_DISTVERSION= 5.15.160 -DRM_KMOD_GH_TAGNAME= drm_v5.15.160_5 +DRM_KMOD_GH_TAGNAME= drm_v5.15.160_6 diff --git a/graphics/drm-515-kmod/distinfo b/graphics/drm-515-kmod/distinfo index 649d5a270e8b..c61f5441c75e 100644 --- a/graphics/drm-515-kmod/distinfo +++ b/graphics/drm-515-kmod/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1750400500 -SHA256 (freebsd-drm-kmod-5.15.160-drm_v5.15.160_5_GH0.tar.gz) = 93fc30211374d028ec8e24872cc5ac03dab13309b637cf3bdad27f2dcb808fc0 -SIZE (freebsd-drm-kmod-5.15.160-drm_v5.15.160_5_GH0.tar.gz) = 26098570 +TIMESTAMP = 1760982913 +SHA256 (freebsd-drm-kmod-5.15.160-drm_v5.15.160_6_GH0.tar.gz) = e21962b06c5c4740a165fbb36a1c15107a4c6ccba50ca08df4fb1c9368645ce6 +SIZE (freebsd-drm-kmod-5.15.160-drm_v5.15.160_6_GH0.tar.gz) = 26099109 diff --git a/graphics/drm-515-kmod/files/extra-patch-linuxkpi-pci b/graphics/drm-515-kmod/files/extra-patch-linuxkpi-pci new file mode 100644 index 000000000000..220f7c3f8e9d --- /dev/null +++ b/graphics/drm-515-kmod/files/extra-patch-linuxkpi-pci @@ -0,0 +1,102 @@ +commit 20829888caf411a4ac5a4349cbb013334e0b31de +Author: Bjoern A. Zeeb <bz@FreeBSD.org> +AuthorDate: Thu Jul 31 07:31:38 2025 +0000 +Commit: Jean-Sébastien Pédron <jean-sebastien.pedron@dumbbell.fr> +CommitDate: Sat Aug 9 16:13:12 2025 +0200 + + drm: use LinuxKPI PCI functions rather than bsd native + + LinuxKPI seems to provide everything needed here, which allows + us to remove the special casing for FreeBSD. + Switch from bsddev and FreeBSD native functions to LinuxKPI + variables and functions/macros; this will avoid conflicts with + upcoming additions to LinuxKPI. + + Sponsored by: The FreeBSD Foundation + +diff --git drivers/gpu/drm/drm_pci.c drivers/gpu/drm/drm_pci.c +index b7fcd9ea0b..2798d55a48 100644 +--- drivers/gpu/drm/drm_pci.c ++++ drivers/gpu/drm/drm_pci.c +@@ -57,30 +57,18 @@ static int drm_get_pci_domain(struct drm_device *dev) + return 0; + #endif /* __alpha__ */ + +-#ifdef __FreeBSD__ +- return pci_get_domain(dev->dev->bsddev); +-#else + return pci_domain_nr(to_pci_dev(dev->dev)->bus); +-#endif + } + + int drm_pci_set_busid(struct drm_device *dev, struct drm_master *master) + { + struct pci_dev *pdev = to_pci_dev(dev->dev); + +-#ifdef __FreeBSD__ +- master->unique = kasprintf(GFP_KERNEL, "pci:%04x:%02x:%02x.%d", +- drm_get_pci_domain(dev), +- pci_get_bus(dev->dev->bsddev), +- pci_get_slot(dev->dev->bsddev), +- PCI_FUNC(pdev->devfn)); +-#else + master->unique = kasprintf(GFP_KERNEL, "pci:%04x:%02x:%02x.%d", + drm_get_pci_domain(dev), + pdev->bus->number, + PCI_SLOT(pdev->devfn), + PCI_FUNC(pdev->devfn)); +-#endif + if (!master->unique) + return -ENOMEM; + +@@ -93,16 +81,17 @@ int + drm_getpciinfo(struct drm_device *dev, void *data, struct drm_file *file_priv) + { + struct drm_pciinfo *info = data; ++ struct pci_dev *pdev = to_pci_dev(dev->dev); + +- info->domain = pci_get_domain(dev->dev->bsddev); +- info->bus = pci_get_bus(dev->dev->bsddev); +- info->dev = pci_get_slot(dev->dev->bsddev); +- info->func = pci_get_function(dev->dev->bsddev); +- info->vendor_id = pci_get_vendor(dev->dev->bsddev); +- info->device_id = pci_get_device(dev->dev->bsddev); +- info->subvendor_id = pci_get_subvendor(dev->dev->bsddev); +- info->subdevice_id = pci_get_subdevice(dev->dev->bsddev); +- info->revision_id = pci_get_revid(dev->dev->bsddev); ++ info->domain = drm_get_pci_domain(dev); ++ info->bus = pdev->bus->number; ++ info->dev = PCI_SLOT(pdev->devfn); ++ info->func = PCI_FUNC(pdev->devfn); ++ info->vendor_id = pdev->vendor; ++ info->device_id = pdev->device; ++ info->subvendor_id = pdev->subsystem_vendor; ++ info->subdevice_id = pdev->subsystem_device; ++ info->revision_id = pdev->revision; + + return 0; + } +diff --git drivers/gpu/drm/drm_sysctl_freebsd.c drivers/gpu/drm/drm_sysctl_freebsd.c +index b6dd16b5b5..b9eca7a53c 100644 +--- drivers/gpu/drm/drm_sysctl_freebsd.c ++++ drivers/gpu/drm/drm_sysctl_freebsd.c +@@ -170,14 +170,13 @@ drm_add_busid_modesetting(struct drm_device *dev, struct sysctl_ctx_list *ctx, + struct sysctl_oid *top) + { + struct sysctl_oid *oid; +- device_t bsddev; + int domain, bus, slot, func; ++ struct pci_dev *pdev = to_pci_dev(dev->dev); + +- bsddev = dev->dev->bsddev; +- domain = pci_get_domain(bsddev); +- bus = pci_get_bus(bsddev); +- slot = pci_get_slot(bsddev); +- func = pci_get_function(bsddev); ++ domain = pci_domain_nr(pdev->bus); ++ bus = pdev->bus->number; ++ slot = PCI_SLOT(pdev->devfn); ++ func = PCI_FUNC(pdev->devfn); + + snprintf(dev->busid_str, sizeof(dev->busid_str), + "pci:%04x:%02x:%02x.%d", domain, bus, slot, func); |
