Module Name: src Committed By: riastradh Date: Sun Feb 27 14:23:17 UTC 2022
Modified Files: src/sys/external/bsd/drm2/dist/drm/radeon: radeon_bios.c Log Message: radeon: Make radeon_bios.c ACPI stuff build. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 \ src/sys/external/bsd/drm2/dist/drm/radeon/radeon_bios.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/dist/drm/radeon/radeon_bios.c diff -u src/sys/external/bsd/drm2/dist/drm/radeon/radeon_bios.c:1.8 src/sys/external/bsd/drm2/dist/drm/radeon/radeon_bios.c:1.9 --- src/sys/external/bsd/drm2/dist/drm/radeon/radeon_bios.c:1.8 Sat Dec 18 23:45:43 2021 +++ src/sys/external/bsd/drm2/dist/drm/radeon/radeon_bios.c Sun Feb 27 14:23:16 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: radeon_bios.c,v 1.8 2021/12/18 23:45:43 riastradh Exp $ */ +/* $NetBSD: radeon_bios.c,v 1.9 2022/02/27 14:23:16 riastradh Exp $ */ /* * Copyright 2008 Advanced Micro Devices, Inc. @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: radeon_bios.c,v 1.8 2021/12/18 23:45:43 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: radeon_bios.c,v 1.9 2022/02/27 14:23:16 riastradh Exp $"); #include <linux/acpi.h> #include <linux/pci.h> @@ -41,6 +41,8 @@ __KERNEL_RCSID(0, "$NetBSD: radeon_bios. #include "radeon.h" #include "radeon_reg.h" +#include <linux/nbsd-namespace-acpi.h> + /* * BIOS. */ @@ -183,7 +185,6 @@ static bool radeon_read_platform_bios(st #endif } -/* XXX radeon acpi */ #ifdef CONFIG_ACPI /* ATRM is used to get the BIOS on the discrete cards in * dual-gpu systems. @@ -247,7 +248,11 @@ static bool radeon_atrm_get_bios(struct return false; while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, pdev)) != NULL) { +#ifdef __NetBSD__ + dhandle = (pdev->pd_ad ? pdev->pd_ad->ad_handle : NULL); +#else dhandle = ACPI_HANDLE(&pdev->dev); +#endif if (!dhandle) continue; @@ -260,7 +265,12 @@ static bool radeon_atrm_get_bios(struct if (!found) { while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_OTHER << 8, pdev)) != NULL) { +#ifdef __NetBSD__ + dhandle = (pdev->pd_ad ? pdev->pd_ad->ad_handle + : NULL); +#else dhandle = ACPI_HANDLE(&pdev->dev); +#endif if (!dhandle) continue;