Module Name: src
Committed By: riastradh
Date: Sun Feb 27 14:23:24 UTC 2022
Modified Files:
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu: amdgpu_bios.c
Log Message:
amdgpu: Make amdgpu_bios.c ACPI stuff build.
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_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/amd/amdgpu/amdgpu_bios.c
diff -u src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_bios.c:1.5 src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_bios.c:1.6
--- src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_bios.c:1.5 Sun Dec 19 10:59:01 2021
+++ src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_bios.c Sun Feb 27 14:23:24 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: amdgpu_bios.c,v 1.5 2021/12/19 10:59:01 riastradh Exp $ */
+/* $NetBSD: amdgpu_bios.c,v 1.6 2022/02/27 14:23:24 riastradh Exp $ */
/*
* Copyright 2008 Advanced Micro Devices, Inc.
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: amdgpu_bios.c,v 1.5 2021/12/19 10:59:01 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amdgpu_bios.c,v 1.6 2022/02/27 14:23:24 riastradh Exp $");
#include "amdgpu.h"
#include "atom.h"
@@ -39,6 +39,7 @@ __KERNEL_RCSID(0, "$NetBSD: amdgpu_bios.
#include <linux/acpi.h>
#include <linux/nbsd-namespace.h>
+#include <linux/nbsd-namespace-acpi.h>
/*
* BIOS.
@@ -327,7 +328,11 @@ static bool amdgpu_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;
@@ -340,7 +345,12 @@ static bool amdgpu_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;