Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/dist/drm/amd/amdgpu amdgpu: Make amdgp...



details:   https://anonhg.NetBSD.org/src/rev/7e4e21413f3b
branches:  trunk
changeset: 362444:7e4e21413f3b
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Feb 27 14:23:24 2022 +0000

description:
amdgpu: Make amdgpu_bios.c ACPI stuff build.

diffstat:

 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_bios.c |  14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diffs (51 lines):

diff -r 466607cb5b40 -r 7e4e21413f3b sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_bios.c
--- a/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_bios.c   Sun Feb 27 14:23:16 2022 +0000
+++ b/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_bios.c   Sun Feb 27 14:23:24 2022 +0000
@@ -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 @@
 #include <linux/acpi.h>
 
 #include <linux/nbsd-namespace.h>
+#include <linux/nbsd-namespace-acpi.h>
 
 /*
  * BIOS.
@@ -327,7 +328,11 @@
                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 @@
 
        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;
 



Home | Main Index | Thread Index | Old Index