Module Name: src Committed By: martin Date: Tue Apr 16 08:10:22 UTC 2019
Modified Files: src/sys/external/bsd/drm2/pci [netbsd-7]: drm_pci.c Log Message: Pull up following revision(s) (requested by dholland in ticket #1673): sys/external/bsd/drm2/pci/drm_pci.c: revision 1.32 (via patch) Don't try to interpret the second half of a 64-bit BAR as another one. >From msaitoh@. To generate a diff of this commit: cvs rdiff -u -r1.6.2.3 -r1.6.2.4 src/sys/external/bsd/drm2/pci/drm_pci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/external/bsd/drm2/pci/drm_pci.c diff -u src/sys/external/bsd/drm2/pci/drm_pci.c:1.6.2.3 src/sys/external/bsd/drm2/pci/drm_pci.c:1.6.2.4 --- src/sys/external/bsd/drm2/pci/drm_pci.c:1.6.2.3 Thu Jul 30 15:43:37 2015 +++ src/sys/external/bsd/drm2/pci/drm_pci.c Tue Apr 16 08:10:22 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: drm_pci.c,v 1.6.2.3 2015/07/30 15:43:37 snj Exp $ */ +/* $NetBSD: drm_pci.c,v 1.6.2.4 2019/04/16 08:10:22 martin Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: drm_pci.c,v 1.6.2.3 2015/07/30 15:43:37 snj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: drm_pci.c,v 1.6.2.4 2019/04/16 08:10:22 martin Exp $"); #include <sys/types.h> #include <sys/errno.h> @@ -140,6 +140,14 @@ drm_pci_attach(device_t self, const stru continue; } + /* + * If it's a 64-bit mapping, don't interpret the second + * half of it as another BAR in the next iteration of + * the loop -- move on to the next unit. + */ + if (PCI_MAPREG_MEM_TYPE(type) == PCI_MAPREG_MEM_TYPE_64BIT) + unit++; + /* Inquire about it. We'll map it in drm_core_ioremap. */ if (pci_mapreg_info(pa->pa_pc, pa->pa_tag, reg, type, &bm->bm_base, &bm->bm_size, &bm->bm_flags) != 0) {