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 Rename amdgpu files to avoid clashes w...



details:   https://anonhg.NetBSD.org/src/rev/781dad92fbf2
branches:  trunk
changeset: 366235:781dad92fbf2
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 14:10:14 2018 +0000

description:
Rename amdgpu files to avoid clashes with radeon.

diffstat:

 sys/external/bsd/drm2/amdgpu/files.amdgpu                            |    68 +-
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_atom.c              |  1464 ++
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_atombios_crtc.c     |   814 +
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_atombios_dp.c       |   770 +
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_atombios_encoders.c |  2077 +++
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_atombios_i2c.c      |   162 +
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_cz_dpm.c            |  2008 +++
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_cz_ih.c             |   459 +
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_cz_smc.c            |  1019 +
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_dce_v10_0.c         |  3826 +++++++
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_dce_v11_0.c         |  3826 +++++++
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_fiji_dpm.c          |   187 +
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_fiji_smc.c          |   863 +
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gfx_v8_0.c          |  5205 ++++++++++
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gmc_v7_0.c          |  1443 ++
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gmc_v8_0.c          |  1388 ++
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_iceland_dpm.c       |   201 +
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_iceland_ih.c        |   458 +
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_iceland_smc.c       |   677 +
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_sdma_v2_4.c         |  1430 ++
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_sdma_v3_0.c         |  1591 +++
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_tonga_dpm.c         |   187 +
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_tonga_ih.c          |   480 +
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_tonga_smc.c         |   862 +
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_uvd_v5_0.c          |   850 +
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_uvd_v6_0.c          |   834 +
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_vce_v3_0.c          |   685 +
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_vi.c                |  1554 ++
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/atom.c                     |  1464 --
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/atombios_crtc.c            |   814 -
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/atombios_dp.c              |   770 -
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/atombios_encoders.c        |  2077 ---
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/atombios_i2c.c             |   162 -
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/cz_dpm.c                   |  2008 ---
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/cz_ih.c                    |   459 -
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/cz_smc.c                   |  1019 -
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/dce_v10_0.c                |  3826 -------
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/dce_v11_0.c                |  3826 -------
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/fiji_dpm.c                 |   187 -
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/fiji_smc.c                 |   863 -
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/gfx_v8_0.c                 |  5205 ----------
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/gmc_v7_0.c                 |  1443 --
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/gmc_v8_0.c                 |  1388 --
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/iceland_dpm.c              |   201 -
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/iceland_ih.c               |   458 -
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/iceland_smc.c              |   677 -
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/sdma_v2_4.c                |  1430 --
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/sdma_v3_0.c                |  1591 ---
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/tonga_dpm.c                |   187 -
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/tonga_ih.c                 |   480 -
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/tonga_smc.c                |   862 -
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/uvd_v5_0.c                 |   850 -
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/uvd_v6_0.c                 |   834 -
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/vce_v3_0.c                 |   685 -
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/vi.c                       |  1554 --
 sys/external/bsd/drm2/dist/drm/amd/scheduler/amdgpu_gpu_scheduler.c  |   643 +
 sys/external/bsd/drm2/dist/drm/amd/scheduler/amdgpu_sched_fence.c    |   105 +
 sys/external/bsd/drm2/dist/drm/amd/scheduler/gpu_scheduler.c         |   643 -
 sys/external/bsd/drm2/dist/drm/amd/scheduler/sched_fence.c           |   105 -
 59 files changed, 36102 insertions(+), 36102 deletions(-)

diffs (truncated from 72496 to 300 lines):

diff -r f543cf1d1229 -r 781dad92fbf2 sys/external/bsd/drm2/amdgpu/files.amdgpu
--- a/sys/external/bsd/drm2/amdgpu/files.amdgpu Mon Aug 27 14:05:40 2018 +0000
+++ b/sys/external/bsd/drm2/amdgpu/files.amdgpu Mon Aug 27 14:10:14 2018 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.amdgpu,v 1.1 2018/08/27 14:02:32 riastradh Exp $
+#      $NetBSD: files.amdgpu,v 1.2 2018/08/27 14:10:14 riastradh Exp $
 
 define amdgpufbbus     { }
 device amdgpu: drmkms, drmkms_pci, drmkms_ttm, amdgpufbbus, firmload
@@ -14,9 +14,9 @@
 makeoptions    amdgpu  CPPFLAGS+="-I$S/external/bsd/drm2/dist/drm/amd/scheduler"
 
 makeoptions    amdgpu  "CWARNFLAGS.amdgpu_drv.c"+="-Wno-missing-field-initializers"
-makeoptions    amdgpu  "CWARNFLAGS.dce_v10_0.c"+="-Wno-shadow"
-makeoptions    amdgpu  "CWARNFLAGS.dce_v11_0.c"+="-Wno-shadow"
-makeoptions    amdgpu  "CWARNFLAGS.vi.c"+="-Wno-missing-field-initializers"
+makeoptions    amdgpu  "CWARNFLAGS.amdgpu_dce_v10_0.c"+="-Wno-shadow"
+makeoptions    amdgpu  "CWARNFLAGS.amdgpu_dce_v11_0.c"+="-Wno-shadow"
+makeoptions    amdgpu  "CWARNFLAGS.amdgpu_vi.c"+="-Wno-missing-field-initializers"
 
 # Local additions.
 file   external/bsd/drm2/amdgpu/amdgpu_module.c        amdgpu
@@ -24,13 +24,18 @@
 file   external/bsd/drm2/amdgpu/amdgpufb.c             amdgpufb
 
 # Generated from amdgpu2netbsd.
-file   external/bsd/drm2/dist/drm/amd/amdgpu/../scheduler/gpu_scheduler.c      amdgpu
-file   external/bsd/drm2/dist/drm/amd/amdgpu/../scheduler/sched_fence.c        amdgpu
+file   external/bsd/drm2/dist/drm/amd/amdgpu/../scheduler/amdgpu_gpu_scheduler.c       amdgpu
+file   external/bsd/drm2/dist/drm/amd/amdgpu/../scheduler/amdgpu_sched_fence.c amdgpu
 #file  external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_acpi.c     amdgpu
 file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_afmt.c     amdgpu
 file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_amdkfd.c   amdgpu
 file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c    amdgpu
+file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_atom.c     amdgpu
 file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_atombios.c amdgpu
+file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_atombios_crtc.c    amdgpu
+file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_atombios_dp.c      amdgpu
+file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_atombios_encoders.c        amdgpu
+file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_atombios_i2c.c     amdgpu
 file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_benchmark.c        amdgpu
 file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_bios.c     amdgpu
 file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_bo_list.c  amdgpu
@@ -38,6 +43,11 @@
 file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_connectors.c       amdgpu
 file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_cs.c       amdgpu
 file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_ctx.c      amdgpu
+file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_cz_dpm.c   amdgpu
+file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_cz_ih.c    amdgpu
+file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_cz_smc.c   amdgpu
+file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_dce_v10_0.c        amdgpu
+file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_dce_v11_0.c        amdgpu
 file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_device.c   amdgpu
 file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_display.c  amdgpu
 file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_dpm.c      amdgpu
@@ -45,54 +55,44 @@
 file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_encoders.c amdgpu
 file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_fb.c       amdgpu
 file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_fence.c    amdgpu
+file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_fiji_dpm.c amdgpu
+file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_fiji_smc.c amdgpu
 file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gart.c     amdgpu
 file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gem.c      amdgpu
 file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gfx.c      amdgpu
+file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gfx_v8_0.c amdgpu
+file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gmc_v7_0.c amdgpu
+file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gmc_v8_0.c amdgpu
 file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_i2c.c      amdgpu
 file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_ib.c       amdgpu
+file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_iceland_dpm.c      amdgpu
+file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_iceland_ih.c       amdgpu
+file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_iceland_smc.c      amdgpu
 file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_ih.c       amdgpu
 file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_irq.c      amdgpu
 file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_kms.c      amdgpu
 file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_object.c   amdgpu
 file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_pll.c      amdgpu
 file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_pm.c       amdgpu
-#file  external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_prime.c    amdgpu  # XXX amdgpu prime
+#file  external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_prime.c    amdgpu  # XXX amdgpu prime
 file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_ring.c     amdgpu
 file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_sa.c       amdgpu
 file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_sched.c    amdgpu
+file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_sdma_v2_4.c        amdgpu
+file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_sdma_v3_0.c        amdgpu
 file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_semaphore.c        amdgpu
 file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_sync.c     amdgpu
 file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_test.c     amdgpu
+file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_tonga_dpm.c        amdgpu
+file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_tonga_ih.c amdgpu
+file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_tonga_smc.c        amdgpu
 file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_trace_points.c     amdgpu
 file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_ttm.c      amdgpu
 file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_ucode.c    amdgpu
 file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_uvd.c      amdgpu
+file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_uvd_v5_0.c amdgpu
+file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_uvd_v6_0.c amdgpu
 file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_vce.c      amdgpu
+file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_vce_v3_0.c amdgpu
+file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_vi.c       amdgpu
 file   external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_vm.c       amdgpu
-file   external/bsd/drm2/dist/drm/amd/amdgpu/atom.c    amdgpu
-file   external/bsd/drm2/dist/drm/amd/amdgpu/atombios_crtc.c   amdgpu
-file   external/bsd/drm2/dist/drm/amd/amdgpu/atombios_dp.c     amdgpu
-file   external/bsd/drm2/dist/drm/amd/amdgpu/atombios_encoders.c       amdgpu
-file   external/bsd/drm2/dist/drm/amd/amdgpu/atombios_i2c.c    amdgpu
-file   external/bsd/drm2/dist/drm/amd/amdgpu/cz_dpm.c  amdgpu
-file   external/bsd/drm2/dist/drm/amd/amdgpu/cz_ih.c   amdgpu
-file   external/bsd/drm2/dist/drm/amd/amdgpu/cz_smc.c  amdgpu
-file   external/bsd/drm2/dist/drm/amd/amdgpu/dce_v10_0.c       amdgpu
-file   external/bsd/drm2/dist/drm/amd/amdgpu/dce_v11_0.c       amdgpu
-file   external/bsd/drm2/dist/drm/amd/amdgpu/fiji_dpm.c        amdgpu
-file   external/bsd/drm2/dist/drm/amd/amdgpu/fiji_smc.c        amdgpu
-file   external/bsd/drm2/dist/drm/amd/amdgpu/gfx_v8_0.c        amdgpu
-file   external/bsd/drm2/dist/drm/amd/amdgpu/gmc_v7_0.c        amdgpu
-file   external/bsd/drm2/dist/drm/amd/amdgpu/gmc_v8_0.c        amdgpu
-file   external/bsd/drm2/dist/drm/amd/amdgpu/iceland_dpm.c     amdgpu
-file   external/bsd/drm2/dist/drm/amd/amdgpu/iceland_ih.c      amdgpu
-file   external/bsd/drm2/dist/drm/amd/amdgpu/iceland_smc.c     amdgpu
-file   external/bsd/drm2/dist/drm/amd/amdgpu/sdma_v2_4.c       amdgpu
-file   external/bsd/drm2/dist/drm/amd/amdgpu/sdma_v3_0.c       amdgpu
-file   external/bsd/drm2/dist/drm/amd/amdgpu/tonga_dpm.c       amdgpu
-file   external/bsd/drm2/dist/drm/amd/amdgpu/tonga_ih.c        amdgpu
-file   external/bsd/drm2/dist/drm/amd/amdgpu/tonga_smc.c       amdgpu
-file   external/bsd/drm2/dist/drm/amd/amdgpu/uvd_v5_0.c        amdgpu
-file   external/bsd/drm2/dist/drm/amd/amdgpu/uvd_v6_0.c        amdgpu
-file   external/bsd/drm2/dist/drm/amd/amdgpu/vce_v3_0.c        amdgpu
-file   external/bsd/drm2/dist/drm/amd/amdgpu/vi.c      amdgpu
diff -r f543cf1d1229 -r 781dad92fbf2 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_atom.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_atom.c   Mon Aug 27 14:10:14 2018 +0000
@@ -0,0 +1,1464 @@
+/*     $NetBSD: amdgpu_atom.c,v 1.1 2018/08/27 14:10:14 riastradh Exp $        */
+
+/*
+ * Copyright 2008 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Author: Stanislaw Skowronek
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: amdgpu_atom.c,v 1.1 2018/08/27 14:10:14 riastradh Exp $");
+
+#include <linux/module.h>
+#include <linux/sched.h>
+#include <linux/slab.h>
+#include <asm/unaligned.h>
+#include <asm/byteorder.h>
+
+#define ATOM_DEBUG
+
+#include "atom.h"
+#include "atom-names.h"
+#include "atom-bits.h"
+#include "amdgpu.h"
+
+#define ATOM_COND_ABOVE                0
+#define ATOM_COND_ABOVEOREQUAL 1
+#define ATOM_COND_ALWAYS       2
+#define ATOM_COND_BELOW                3
+#define ATOM_COND_BELOWOREQUAL 4
+#define ATOM_COND_EQUAL                5
+#define ATOM_COND_NOTEQUAL     6
+
+#define ATOM_PORT_ATI  0
+#define ATOM_PORT_PCI  1
+#define ATOM_PORT_SYSIO        2
+
+#define ATOM_UNIT_MICROSEC     0
+#define ATOM_UNIT_MILLISEC     1
+
+#define PLL_INDEX      2
+#define PLL_DATA       3
+
+typedef struct {
+       struct atom_context *ctx;
+       uint32_t *ps, *ws;
+       int ps_shift;
+       uint16_t start;
+       unsigned last_jump;
+       unsigned long last_jump_jiffies;
+       bool abort;
+} atom_exec_context;
+
+int amdgpu_atom_debug = 0;
+static int amdgpu_atom_execute_table_locked(struct atom_context *ctx, int index, uint32_t * params);
+int amdgpu_atom_execute_table(struct atom_context *ctx, int index, uint32_t * params);
+
+static uint32_t atom_arg_mask[8] =
+    { 0xFFFFFFFF, 0xFFFF, 0xFFFF00, 0xFFFF0000, 0xFF, 0xFF00, 0xFF0000,
+0xFF000000 };
+static int atom_arg_shift[8] = { 0, 0, 8, 16, 0, 8, 16, 24 };
+
+static int atom_dst_to_src[8][4] = {
+       /* translate destination alignment field to the source alignment encoding */
+       {0, 0, 0, 0},
+       {1, 2, 3, 0},
+       {1, 2, 3, 0},
+       {1, 2, 3, 0},
+       {4, 5, 6, 7},
+       {4, 5, 6, 7},
+       {4, 5, 6, 7},
+       {4, 5, 6, 7},
+};
+static int atom_def_dst[8] = { 0, 0, 1, 2, 0, 1, 2, 3 };
+
+static int debug_depth = 0;
+#undef DEBUG                   /* XXX NetBSD kludge */
+#ifdef ATOM_DEBUG
+static void debug_print_spaces(int n)
+{
+       while (n--)
+               printk("   ");
+}
+
+#define DEBUG(...) do if (amdgpu_atom_debug) { printk(KERN_DEBUG __VA_ARGS__); } while (0)
+#define SDEBUG(...) do if (amdgpu_atom_debug) { printk(KERN_DEBUG); debug_print_spaces(debug_depth); printk(__VA_ARGS__); } while (0)
+#else
+#define DEBUG(...) do { } while (0)
+#define SDEBUG(...) do { } while (0)
+#endif
+
+static uint32_t atom_iio_execute(struct atom_context *ctx, int base,
+                                uint32_t index, uint32_t data)
+{
+       uint32_t temp = 0xCDCDCDCD;
+
+       while (1)
+               switch (CU8(base)) {
+               case ATOM_IIO_NOP:
+                       base++;
+                       break;
+               case ATOM_IIO_READ:
+                       temp = ctx->card->ioreg_read(ctx->card, CU16(base + 1));
+                       base += 3;
+                       break;
+               case ATOM_IIO_WRITE:
+                       ctx->card->ioreg_write(ctx->card, CU16(base + 1), temp);
+                       base += 3;
+                       break;
+               case ATOM_IIO_CLEAR:
+                       temp &=
+                           ~((0xFFFFFFFF >> (32 - CU8(base + 1))) <<
+                             CU8(base + 2));
+                       base += 3;
+                       break;
+               case ATOM_IIO_SET:
+                       temp |=
+                           (0xFFFFFFFF >> (32 - CU8(base + 1))) << CU8(base +
+                                                                       2);
+                       base += 3;
+                       break;
+               case ATOM_IIO_MOVE_INDEX:
+                       temp &=
+                           ~((0xFFFFFFFF >> (32 - CU8(base + 1))) <<
+                             CU8(base + 3));
+                       temp |=
+                           ((index >> CU8(base + 2)) &
+                            (0xFFFFFFFF >> (32 - CU8(base + 1)))) << CU8(base +
+                                                                         3);
+                       base += 4;
+                       break;
+               case ATOM_IIO_MOVE_DATA:
+                       temp &=
+                           ~((0xFFFFFFFF >> (32 - CU8(base + 1))) <<
+                             CU8(base + 3));
+                       temp |=
+                           ((data >> CU8(base + 2)) &
+                            (0xFFFFFFFF >> (32 - CU8(base + 1)))) << CU8(base +
+                                                                         3);
+                       base += 4;
+                       break;
+               case ATOM_IIO_MOVE_ATTR:
+                       temp &=
+                           ~((0xFFFFFFFF >> (32 - CU8(base + 1))) <<
+                             CU8(base + 3));
+                       temp |=
+                           ((ctx->
+                             io_attr >> CU8(base + 2)) & (0xFFFFFFFF >> (32 -
+                                                                         CU8
+                                                                         (base
+                                                                          +



Home | Main Index | Thread Index | Old Index