Source-Changes-HG archive

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

[src/trunk]: src/sys First whack at radeon driver.



details:   https://anonhg.NetBSD.org/src/rev/7cbbe2c273c5
branches:  trunk
changeset: 330644:7cbbe2c273c5
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Jul 16 20:59:57 2014 +0000

description:
First whack at radeon driver.

No hardware to test yet, but it builds.

diffstat:

 sys/arch/amd64/conf/DRMKMS                                  |    1 +
 sys/external/bsd/common/include/linux/kernel.h              |    4 +-
 sys/external/bsd/common/include/linux/list.h                |    8 +-
 sys/external/bsd/drm2/dist/drm/radeon/atom-names.h          |    6 +-
 sys/external/bsd/drm2/dist/drm/radeon/atom.c                |    9 +
 sys/external/bsd/drm2/dist/drm/radeon/atom.h                |    2 +-
 sys/external/bsd/drm2/dist/drm/radeon/atombios_crtc.c       |    1 +
 sys/external/bsd/drm2/dist/drm/radeon/atombios_dp.c         |    7 +-
 sys/external/bsd/drm2/dist/drm/radeon/atombios_encoders.c   |    1 +
 sys/external/bsd/drm2/dist/drm/radeon/atombios_i2c.c        |    6 +-
 sys/external/bsd/drm2/dist/drm/radeon/btc_dpm.c             |    3 +
 sys/external/bsd/drm2/dist/drm/radeon/ci_dpm.c              |   23 +-
 sys/external/bsd/drm2/dist/drm/radeon/cik.c                 |   68 +-
 sys/external/bsd/drm2/dist/drm/radeon/cik_sdma.c            |   41 +-
 sys/external/bsd/drm2/dist/drm/radeon/cypress_dpm.c         |    3 +
 sys/external/bsd/drm2/dist/drm/radeon/evergreen.c           |   59 +-
 sys/external/bsd/drm2/dist/drm/radeon/evergreen_cs.c        |   75 +-
 sys/external/bsd/drm2/dist/drm/radeon/evergreen_hdmi.c      |    6 +-
 sys/external/bsd/drm2/dist/drm/radeon/kv_dpm.c              |    2 +
 sys/external/bsd/drm2/dist/drm/radeon/ni.c                  |   20 +-
 sys/external/bsd/drm2/dist/drm/radeon/ni_dpm.c              |    2 +
 sys/external/bsd/drm2/dist/drm/radeon/r100.c                |   73 +-
 sys/external/bsd/drm2/dist/drm/radeon/r300.c                |   26 +-
 sys/external/bsd/drm2/dist/drm/radeon/r600.c                |  102 +-
 sys/external/bsd/drm2/dist/drm/radeon/r600_cs.c             |   50 +-
 sys/external/bsd/drm2/dist/drm/radeon/r600_dma.c            |   52 +-
 sys/external/bsd/drm2/dist/drm/radeon/r600_hdmi.c           |    4 +-
 sys/external/bsd/drm2/dist/drm/radeon/radeon.h              |   73 +-
 sys/external/bsd/drm2/dist/drm/radeon/radeon_agp.c          |   10 +-
 sys/external/bsd/drm2/dist/drm/radeon/radeon_asic.c         |   22 +
 sys/external/bsd/drm2/dist/drm/radeon/radeon_atombios.c     |    6 +-
 sys/external/bsd/drm2/dist/drm/radeon/radeon_benchmark.c    |    2 +-
 sys/external/bsd/drm2/dist/drm/radeon/radeon_bios.c         |   39 +
 sys/external/bsd/drm2/dist/drm/radeon/radeon_combios.c      |    2 +-
 sys/external/bsd/drm2/dist/drm/radeon/radeon_device.c       |  200 +++-
 sys/external/bsd/drm2/dist/drm/radeon/radeon_display.c      |    5 +-
 sys/external/bsd/drm2/dist/drm/radeon/radeon_drv.c          |   24 +-
 sys/external/bsd/drm2/dist/drm/radeon/radeon_fb.c           |   45 +
 sys/external/bsd/drm2/dist/drm/radeon/radeon_fence.c        |   59 +-
 sys/external/bsd/drm2/dist/drm/radeon/radeon_gart.c         |  165 +++
 sys/external/bsd/drm2/dist/drm/radeon/radeon_gem.c          |    8 +
 sys/external/bsd/drm2/dist/drm/radeon/radeon_i2c.c          |    1 +
 sys/external/bsd/drm2/dist/drm/radeon/radeon_irq.c          |    2 +-
 sys/external/bsd/drm2/dist/drm/radeon/radeon_irq_kms.c      |    2 +-
 sys/external/bsd/drm2/dist/drm/radeon/radeon_kms.c          |    9 +-
 sys/external/bsd/drm2/dist/drm/radeon/radeon_legacy_tv.c    |    4 +-
 sys/external/bsd/drm2/dist/drm/radeon/radeon_mode.h         |    8 +
 sys/external/bsd/drm2/dist/drm/radeon/radeon_object.c       |   10 +-
 sys/external/bsd/drm2/dist/drm/radeon/radeon_object.h       |    2 +-
 sys/external/bsd/drm2/dist/drm/radeon/radeon_pm.c           |   28 +
 sys/external/bsd/drm2/dist/drm/radeon/radeon_ring.c         |    5 +-
 sys/external/bsd/drm2/dist/drm/radeon/radeon_sa.c           |   41 +
 sys/external/bsd/drm2/dist/drm/radeon/radeon_test.c         |   20 +-
 sys/external/bsd/drm2/dist/drm/radeon/radeon_trace.h        |  191 ---
 sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c          |   83 +-
 sys/external/bsd/drm2/dist/drm/radeon/radeon_uvd.c          |   26 +-
 sys/external/bsd/drm2/dist/drm/radeon/radeon_vce.c          |   50 +-
 sys/external/bsd/drm2/dist/drm/radeon/radeon_vm.c           |    8 +
 sys/external/bsd/drm2/dist/drm/radeon/rs400.c               |    8 +
 sys/external/bsd/drm2/dist/drm/radeon/rs600.c               |   36 +-
 sys/external/bsd/drm2/dist/drm/radeon/rs780_dpm.c           |    2 +
 sys/external/bsd/drm2/dist/drm/radeon/rv6xx_dpm.c           |    2 +
 sys/external/bsd/drm2/dist/drm/radeon/rv770.c               |    4 +-
 sys/external/bsd/drm2/dist/drm/radeon/rv770_dpm.c           |    2 +
 sys/external/bsd/drm2/dist/drm/radeon/si.c                  |   72 +-
 sys/external/bsd/drm2/dist/drm/radeon/si_dpm.c              |    9 +-
 sys/external/bsd/drm2/dist/drm/radeon/sumo_dpm.c            |    2 +
 sys/external/bsd/drm2/dist/drm/radeon/trinity_dpm.c         |    2 +
 sys/external/bsd/drm2/dist/drm/ttm/ttm_bo.c                 |  111 +-
 sys/external/bsd/drm2/dist/drm/ttm/ttm_bo_manager.c         |    1 +
 sys/external/bsd/drm2/dist/drm/ttm/ttm_bo_util.c            |  146 ++-
 sys/external/bsd/drm2/dist/drm/ttm/ttm_execbuf_util.c       |    1 +
 sys/external/bsd/drm2/dist/drm/ttm/ttm_memory.c             |   38 +
 sys/external/bsd/drm2/dist/drm/ttm/ttm_tt.c                 |  115 ++
 sys/external/bsd/drm2/dist/include/drm/ttm/ttm_bo_api.h     |   43 +
 sys/external/bsd/drm2/dist/include/drm/ttm/ttm_bo_driver.h  |   34 +-
 sys/external/bsd/drm2/dist/include/drm/ttm/ttm_memory.h     |    4 +
 sys/external/bsd/drm2/dist/include/drm/ttm/ttm_page_alloc.h |    6 +
 sys/external/bsd/drm2/drm/files.drmkms                      |   28 +-
 sys/external/bsd/drm2/include/asm/byteorder.h               |    9 +-
 sys/external/bsd/drm2/include/asm/page.h                    |    8 +-
 sys/external/bsd/drm2/include/asm/unaligned.h               |   44 +
 sys/external/bsd/drm2/include/drm/bus_dma_hacks.h           |   68 +-
 sys/external/bsd/drm2/include/drm/drm_wait_netbsd.h         |    4 +-
 sys/external/bsd/drm2/include/drm/ttm/ttm_page_alloc.h      |   65 +
 sys/external/bsd/drm2/include/linux/atomic.h                |   38 +-
 sys/external/bsd/drm2/include/linux/bitops.h                |   24 +-
 sys/external/bsd/drm2/include/linux/device.h                |   13 +-
 sys/external/bsd/drm2/include/linux/firmware.h              |   57 +-
 sys/external/bsd/drm2/include/linux/gcd.h                   |   55 +
 sys/external/bsd/drm2/include/linux/gfp.h                   |    4 +-
 sys/external/bsd/drm2/include/linux/hdmi.h                  |  112 ++-
 sys/external/bsd/drm2/include/linux/highmem.h               |    5 +-
 sys/external/bsd/drm2/include/linux/hwmon-sysfs.h           |   35 +
 sys/external/bsd/drm2/include/linux/hwmon.h                 |   35 +
 sys/external/bsd/drm2/include/linux/i2c-algo-bit.h          |   11 +-
 sys/external/bsd/drm2/include/linux/i2c.h                   |   28 +-
 sys/external/bsd/drm2/include/linux/io.h                    |    4 +-
 sys/external/bsd/drm2/include/linux/jiffies.h               |    5 +-
 sys/external/bsd/drm2/include/linux/kref.h                  |   29 +-
 sys/external/bsd/drm2/include/linux/log2.h                  |    5 +-
 sys/external/bsd/drm2/include/linux/math64.h                |   10 +-
 sys/external/bsd/drm2/include/linux/mm.h                    |   21 +-
 sys/external/bsd/drm2/include/linux/mm_types.h              |    8 +-
 sys/external/bsd/drm2/include/linux/module.h                |    4 +-
 sys/external/bsd/drm2/include/linux/mutex.h                 |    4 +-
 sys/external/bsd/drm2/include/linux/pci.h                   |   66 +-
 sys/external/bsd/drm2/include/linux/pm.h                    |    6 +-
 sys/external/bsd/drm2/include/linux/pm_runtime.h            |   10 +-
 sys/external/bsd/drm2/include/linux/power_supply.h          |   41 +
 sys/external/bsd/drm2/include/linux/reservation.h           |   57 +
 sys/external/bsd/drm2/include/linux/rwsem.h                 |   94 +
 sys/external/bsd/drm2/include/linux/slab.h                  |   14 +-
 sys/external/bsd/drm2/include/linux/swiotlb.h               |   35 +
 sys/external/bsd/drm2/include/linux/types.h                 |    6 +-
 sys/external/bsd/drm2/include/linux/workqueue.h             |   17 +-
 sys/external/bsd/drm2/include/linux/ww_mutex.h              |  643 ++++++++++++
 sys/external/bsd/drm2/include/radeon/Makefile               |   35 +
 sys/external/bsd/drm2/include/radeon/cayman_reg_safe.h      |  521 +++++++++
 sys/external/bsd/drm2/include/radeon/evergreen_reg_safe.h   |  521 +++++++++
 sys/external/bsd/drm2/include/radeon/r100_reg_safe.h        |   35 +
 sys/external/bsd/drm2/include/radeon/r200_reg_safe.h        |   35 +
 sys/external/bsd/drm2/include/radeon/r300_reg_safe.h        |   49 +
 sys/external/bsd/drm2/include/radeon/r420_reg_safe.h        |   49 +
 sys/external/bsd/drm2/include/radeon/r600_reg_safe.h        |  497 +++++++++
 sys/external/bsd/drm2/include/radeon/rn50_reg_safe.h        |   35 +
 sys/external/bsd/drm2/include/radeon/rs600_reg_safe.h       |   64 +
 sys/external/bsd/drm2/include/radeon/rv515_reg_safe.h       |   64 +
 sys/external/bsd/drm2/include/radeon_trace.h                |  100 +
 sys/external/bsd/drm2/linux/linux_module.c                  |    7 +-
 sys/external/bsd/drm2/linux/linux_work.c                    |   48 +-
 sys/external/bsd/drm2/pci/files.drmkms_pci                  |    7 +-
 sys/external/bsd/drm2/radeon/files.radeon                   |  127 ++
 sys/external/bsd/drm2/radeon/mkregtable.awk                 |  112 ++
 sys/external/bsd/drm2/radeon/radeon_module.c                |  145 ++
 sys/external/bsd/drm2/radeon/radeon_pci.c                   |  428 +++++++
 sys/external/bsd/drm2/ttm/ttm_agp_backend.c                 |  166 +++
 sys/external/bsd/drm2/ttm/ttm_bo_vm.c                       |  281 +++++
 sys/external/bsd/drm2/ttm/ttm_bus_dma.c                     |   95 +
 139 files changed, 7157 insertions(+), 428 deletions(-)

diffs (truncated from 12537 to 300 lines):

diff -r 362d6815ff47 -r 7cbbe2c273c5 sys/arch/amd64/conf/DRMKMS
--- a/sys/arch/amd64/conf/DRMKMS        Wed Jul 16 20:56:24 2014 +0000
+++ b/sys/arch/amd64/conf/DRMKMS        Wed Jul 16 20:59:57 2014 +0000
@@ -1,6 +1,7 @@
 include "arch/amd64/conf/NO_DRM"
 
 i915drmkms*    at pci? dev ? function ?
+radeondrmkms*  at pci? dev ? function ?
 
 no options     DIAGNOSTIC
 options        DIAGNOSTIC      # expensive kernel consistency check
diff -r 362d6815ff47 -r 7cbbe2c273c5 sys/external/bsd/common/include/linux/kernel.h
--- a/sys/external/bsd/common/include/linux/kernel.h    Wed Jul 16 20:56:24 2014 +0000
+++ b/sys/external/bsd/common/include/linux/kernel.h    Wed Jul 16 20:59:57 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kernel.h,v 1.3 2014/07/16 20:56:24 riastradh Exp $     */
+/*     $NetBSD: kernel.h,v 1.4 2014/07/16 20:59:57 riastradh Exp $     */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -82,6 +82,8 @@
 #define        round_up(X, N)          ((((X) - 1) | ((N) - 1)) + 1)
 #define        round_down(X, N)        ((X) & ~(uintmax_t)((N) - 1))
 
+#define        IS_ALIGNED(X, N)        (((X) & ((N) - 1)) == 0)
+
 /*
  * These select 32-bit halves of what may be 32- or 64-bit quantities,
  * for which straight 32-bit shifts may be undefined behaviour (and do
diff -r 362d6815ff47 -r 7cbbe2c273c5 sys/external/bsd/common/include/linux/list.h
--- a/sys/external/bsd/common/include/linux/list.h      Wed Jul 16 20:56:24 2014 +0000
+++ b/sys/external/bsd/common/include/linux/list.h      Wed Jul 16 20:59:57 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: list.h,v 1.3 2014/07/16 20:56:24 riastradh Exp $       */
+/*     $NetBSD: list.h,v 1.4 2014/07/16 20:59:57 riastradh Exp $       */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -223,6 +223,12 @@
                &(VAR)->FIELD != (HEAD);                                \
                (VAR) = list_next_entry((VAR), FIELD))
 
+#define        list_for_each_entry_safe_from(VAR, NEXT, HEAD, FIELD)           \
+       for (;                                                          \
+               (&(VAR)->FIELD != (HEAD)) &&                            \
+                   ((NEXT) = list_next_entry((VAR), FIELD));           \
+               (VAR) = (NEXT))
+
 /*
  * `H'ead-only/`H'ash-table doubly-linked lists.
  */
diff -r 362d6815ff47 -r 7cbbe2c273c5 sys/external/bsd/drm2/dist/drm/radeon/atom-names.h
--- a/sys/external/bsd/drm2/dist/drm/radeon/atom-names.h        Wed Jul 16 20:56:24 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/radeon/atom-names.h        Wed Jul 16 20:59:57 2014 +0000
@@ -30,7 +30,7 @@
 #ifdef ATOM_DEBUG
 
 #define ATOM_OP_NAMES_CNT 123
-static char *atom_op_names[ATOM_OP_NAMES_CNT] = {
+static const char *atom_op_names[ATOM_OP_NAMES_CNT] = {
 "RESERVED", "MOVE_REG", "MOVE_PS", "MOVE_WS", "MOVE_FB", "MOVE_PLL",
 "MOVE_MC", "AND_REG", "AND_PS", "AND_WS", "AND_FB", "AND_PLL", "AND_MC",
 "OR_REG", "OR_PS", "OR_WS", "OR_FB", "OR_PLL", "OR_MC", "SHIFT_LEFT_REG",
@@ -56,7 +56,7 @@
 };
 
 #define ATOM_TABLE_NAMES_CNT 74
-static char *atom_table_names[ATOM_TABLE_NAMES_CNT] = {
+static const char *atom_table_names[ATOM_TABLE_NAMES_CNT] = {
 "ASIC_Init", "GetDisplaySurfaceSize", "ASIC_RegistersInit",
 "VRAM_BlockVenderDetection", "SetClocksRatio", "MemoryControllerInit",
 "GPIO_PinInit", "MemoryParamAdjust", "DVOEncoderControl",
@@ -85,7 +85,7 @@
 };
 
 #define ATOM_IO_NAMES_CNT 5
-static char *atom_io_names[ATOM_IO_NAMES_CNT] = {
+static const char *atom_io_names[ATOM_IO_NAMES_CNT] = {
 "MM", "PLL", "MC", "PCIE", "PCIE PORT",
 };
 
diff -r 362d6815ff47 -r 7cbbe2c273c5 sys/external/bsd/drm2/dist/drm/radeon/atom.c
--- a/sys/external/bsd/drm2/dist/drm/radeon/atom.c      Wed Jul 16 20:56:24 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/radeon/atom.c      Wed Jul 16 20:59:57 2014 +0000
@@ -92,6 +92,15 @@
                printk("   ");
 }
 
+#ifdef __NetBSD__              /* XXX */
+/*
+ * Kludge: NetBSD defines DEBUG to mean debugging is enabled.  Since
+ * we're not going to include any more header files, it's OK for it to
+ * be defined unconditionally after this.
+ */
+#undef DEBUG
+#endif
+
 #define DEBUG(...) do if (atom_debug) { printk(KERN_DEBUG __VA_ARGS__); } while (0)
 #define SDEBUG(...) do if (atom_debug) { printk(KERN_DEBUG); debug_print_spaces(debug_depth); printk(__VA_ARGS__); } while (0)
 #else
diff -r 362d6815ff47 -r 7cbbe2c273c5 sys/external/bsd/drm2/dist/drm/radeon/atom.h
--- a/sys/external/bsd/drm2/dist/drm/radeon/atom.h      Wed Jul 16 20:56:24 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/radeon/atom.h      Wed Jul 16 20:59:57 2014 +0000
@@ -125,7 +125,7 @@
 struct atom_context {
        struct card_info *card;
        struct mutex mutex;
-       void *bios;
+       uint8_t *bios;
        uint32_t cmd_table, data_table;
        uint16_t *iio;
 
diff -r 362d6815ff47 -r 7cbbe2c273c5 sys/external/bsd/drm2/dist/drm/radeon/atombios_crtc.c
--- a/sys/external/bsd/drm2/dist/drm/radeon/atombios_crtc.c     Wed Jul 16 20:56:24 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/radeon/atombios_crtc.c     Wed Jul 16 20:59:57 2014 +0000
@@ -28,6 +28,7 @@
 #include <drm/radeon_drm.h>
 #include <drm/drm_fixed.h>
 #include "radeon.h"
+#include "radeon_asic.h"
 #include "atom.h"
 #include "atom-bits.h"
 
diff -r 362d6815ff47 -r 7cbbe2c273c5 sys/external/bsd/drm2/dist/drm/radeon/atombios_dp.c
--- a/sys/external/bsd/drm2/dist/drm/radeon/atombios_dp.c       Wed Jul 16 20:56:24 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/radeon/atombios_dp.c       Wed Jul 16 20:59:57 2014 +0000
@@ -36,10 +36,10 @@
 #define DP_LINK_CONFIGURATION_SIZE 9
 #define DP_DPCD_SIZE DP_RECEIVER_CAP_SIZE
 
-static char *voltage_names[] = {
+static const char *voltage_names[] = {
         "0.4V", "0.6V", "0.8V", "1.2V"
 };
-static char *pre_emph_names[] = {
+static const char *pre_emph_names[] = {
         "0dB", "3.5dB", "6dB", "9.5dB"
 };
 
@@ -404,7 +404,6 @@
        struct drm_device *dev = encoder->dev;
        struct radeon_device *rdev = dev->dev_private;
        struct radeon_connector *radeon_connector = to_radeon_connector(connector);
-       struct radeon_connector_atom_dig *dig_connector;
        int panel_mode = DP_PANEL_MODE_EXTERNAL_DP_MODE;
        u16 dp_bridge = radeon_connector_encoder_get_dp_bridge_encoder_id(connector);
        u8 tmp;
@@ -415,8 +414,6 @@
        if (!radeon_connector->con_priv)
                return panel_mode;
 
-       dig_connector = radeon_connector->con_priv;
-
        if (dp_bridge != ENCODER_OBJECT_ID_NONE) {
                /* DP bridge chips */
                if (drm_dp_dpcd_readb(&radeon_connector->ddc_bus->aux,
diff -r 362d6815ff47 -r 7cbbe2c273c5 sys/external/bsd/drm2/dist/drm/radeon/atombios_encoders.c
--- a/sys/external/bsd/drm2/dist/drm/radeon/atombios_encoders.c Wed Jul 16 20:56:24 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/radeon/atombios_encoders.c Wed Jul 16 20:59:57 2014 +0000
@@ -27,6 +27,7 @@
 #include <drm/drm_crtc_helper.h>
 #include <drm/radeon_drm.h>
 #include "radeon.h"
+#include "radeon_asic.h"
 #include "atom.h"
 #include <linux/backlight.h>
 
diff -r 362d6815ff47 -r 7cbbe2c273c5 sys/external/bsd/drm2/dist/drm/radeon/atombios_i2c.c
--- a/sys/external/bsd/drm2/dist/drm/radeon/atombios_i2c.c      Wed Jul 16 20:56:24 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/radeon/atombios_i2c.c      Wed Jul 16 20:59:57 2014 +0000
@@ -63,10 +63,8 @@
                        memcpy(&out, &buf[1], num);
                args.lpI2CDataOut = cpu_to_le16(out);
        } else {
-               if (num > ATOM_MAX_HW_I2C_READ) {
-                       DRM_ERROR("hw i2c: tried to read too many bytes (%d vs 255)\n", num);
-                       return -EINVAL;
-               }
+               CTASSERT(ATOM_MAX_HW_I2C_READ <
+                   (uintmax_t)1 << (CHAR_BIT*sizeof(num)));
                args.ucRegIndex = 0;
                args.lpI2CDataOut = 0;
        }
diff -r 362d6815ff47 -r 7cbbe2c273c5 sys/external/bsd/drm2/dist/drm/radeon/btc_dpm.c
--- a/sys/external/bsd/drm2/dist/drm/radeon/btc_dpm.c   Wed Jul 16 20:56:24 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/radeon/btc_dpm.c   Wed Jul 16 20:59:57 2014 +0000
@@ -24,6 +24,7 @@
 
 #include "drmP.h"
 #include "radeon.h"
+#include "radeon_asic.h"
 #include "btcd.h"
 #include "r600_dpm.h"
 #include "cypress_dpm.h"
@@ -2761,6 +2762,7 @@
        r600_free_extended_power_table(rdev);
 }
 
+#ifdef CONFIG_DEBUG_FS
 void btc_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev,
                                                     struct seq_file *m)
 {
@@ -2791,6 +2793,7 @@
                }
        }
 }
+#endif
 
 u32 btc_dpm_get_sclk(struct radeon_device *rdev, bool low)
 {
diff -r 362d6815ff47 -r 7cbbe2c273c5 sys/external/bsd/drm2/dist/drm/radeon/ci_dpm.c
--- a/sys/external/bsd/drm2/dist/drm/radeon/ci_dpm.c    Wed Jul 16 20:56:24 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/radeon/ci_dpm.c    Wed Jul 16 20:59:57 2014 +0000
@@ -24,6 +24,7 @@
 #include <linux/firmware.h>
 #include "drmP.h"
 #include "radeon.h"
+#include "radeon_asic.h"
 #include "radeon_ucode.h"
 #include "cikd.h"
 #include "r600_dpm.h"
@@ -181,8 +182,10 @@
                                         struct atom_voltage_table_entry *voltage_table,
                                         u16 *std_voltage_hi_sidd, u16 *std_voltage_lo_sidd);
 static int ci_set_power_limit(struct radeon_device *rdev, u32 n);
+#ifndef __NetBSD__             /* XXX unused? */
 static int ci_set_overdrive_target_tdp(struct radeon_device *rdev,
                                       u32 target_tdp);
+#endif
 static int ci_update_uvd_dpm(struct radeon_device *rdev, bool gate);
 
 static struct ci_power_info *ci_get_pi(struct radeon_device *rdev)
@@ -691,6 +694,7 @@
        return ret;
 }
 
+#ifndef __NetBSD__             /* XXX unused? */
 static int ci_power_control_set_level(struct radeon_device *rdev)
 {
        struct ci_power_info *pi = ci_get_pi(rdev);
@@ -714,6 +718,7 @@
 
        return ret;
 }
+#endif
 
 void ci_dpm_powergate_uvd(struct radeon_device *rdev, bool gate)
 {
@@ -995,6 +1000,8 @@
                tmp &= DPM_EVENT_SRC_MASK;
                tmp |= DPM_EVENT_SRC(dpm_event_src);
                WREG32_SMC(CG_THERMAL_CTRL, tmp);
+#else
+               (void)dpm_event_src;
 #endif
 
                tmp = RREG32_SMC(GENERAL_PWRMGT);
@@ -1245,6 +1252,7 @@
        return ci_send_msg_to_smc(rdev, msg);
 }
 
+#ifndef __NetBSD__             /* XXX unused? */
 static PPSMC_Result ci_send_msg_to_smc_return_parameter(struct radeon_device *rdev,
                                                        PPSMC_Msg msg, u32 *parameter)
 {
@@ -1257,6 +1265,7 @@
 
        return smc_result;
 }
+#endif
 
 static int ci_dpm_force_state_sclk(struct radeon_device *rdev, u32 n)
 {
@@ -1314,6 +1323,7 @@
        return 0;
 }
 
+#ifndef __NetBSD__             /* XXX unused? */
 static int ci_set_overdrive_target_tdp(struct radeon_device *rdev,
                                       u32 target_tdp)
 {
@@ -1328,7 +1338,9 @@
 {
        return ci_enable_sclk_mclk_dpm(rdev, false);
 }
-
+#endif
+
+#ifdef CONFIG_DEBUG_FS
 static u32 ci_get_average_sclk_freq(struct radeon_device *rdev)
 {
        u32 sclk_freq;
@@ -1354,6 +1366,7 @@
 
        return mclk_freq;
 }
+#endif
 
 static void ci_dpm_start_smc(struct radeon_device *rdev)
 {



Home | Main Index | Thread Index | Old Index