Module Name: src Committed By: martin Date: Sun Jan 20 15:35:03 UTC 2019
Modified Files: src/sys/external/bsd/drm2/pci [netbsd-8]: drm_pci.c Log Message: Pull up following revision(s) (requested by dholland in ticket #1165): sys/external/bsd/drm2/pci/drm_pci.c: revision 1.32 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.17.2.1 -r1.17.2.2 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.17.2.1 src/sys/external/bsd/drm2/pci/drm_pci.c:1.17.2.2 --- src/sys/external/bsd/drm2/pci/drm_pci.c:1.17.2.1 Tue Aug 1 23:12:06 2017 +++ src/sys/external/bsd/drm2/pci/drm_pci.c Sun Jan 20 15:35:03 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: drm_pci.c,v 1.17.2.1 2017/08/01 23:12:06 snj Exp $ */ +/* $NetBSD: drm_pci.c,v 1.17.2.2 2019/01/20 15:35:03 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.17.2.1 2017/08/01 23:12:06 snj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: drm_pci.c,v 1.17.2.2 2019/01/20 15:35:03 martin Exp $"); #include <sys/types.h> #include <sys/errno.h> @@ -145,6 +145,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) {