1b843c749SSergey Zigachev /* 2b843c749SSergey Zigachev * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. 3b843c749SSergey Zigachev * All Rights Reserved. 4b843c749SSergey Zigachev * 5b843c749SSergey Zigachev * Permission is hereby granted, free of charge, to any person obtaining a 6b843c749SSergey Zigachev * copy of this software and associated documentation files (the "Software"), 7b843c749SSergey Zigachev * to deal in the Software without restriction, including without limitation 8b843c749SSergey Zigachev * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9b843c749SSergey Zigachev * and/or sell copies of the Software, and to permit persons to whom the 10b843c749SSergey Zigachev * Software is furnished to do so, subject to the following conditions: 11b843c749SSergey Zigachev * 12b843c749SSergey Zigachev * The above copyright notice and this permission notice (including the next 13b843c749SSergey Zigachev * paragraph) shall be included in all copies or substantial portions of the 14b843c749SSergey Zigachev * Software. 15b843c749SSergey Zigachev * 16b843c749SSergey Zigachev * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17b843c749SSergey Zigachev * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18b843c749SSergey Zigachev * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 19b843c749SSergey Zigachev * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20b843c749SSergey Zigachev * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21b843c749SSergey Zigachev * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22b843c749SSergey Zigachev * OTHER DEALINGS IN THE SOFTWARE. 23b843c749SSergey Zigachev */ 24b843c749SSergey Zigachev 25b843c749SSergey Zigachev #include <drm/drmP.h> 26b843c749SSergey Zigachev #include <drm/amdgpu_drm.h> 27b843c749SSergey Zigachev #include <drm/drm_gem.h> 28b843c749SSergey Zigachev #include "amdgpu_drv.h" 29b843c749SSergey Zigachev 30b843c749SSergey Zigachev #include <drm/drm_pciids.h> 31b843c749SSergey Zigachev #include <linux/console.h> 32b843c749SSergey Zigachev #include <linux/module.h> 33b843c749SSergey Zigachev #include <linux/pm_runtime.h> 34b843c749SSergey Zigachev #include <linux/vga_switcheroo.h> 35b843c749SSergey Zigachev #include <drm/drm_crtc_helper.h> 36b843c749SSergey Zigachev 37b843c749SSergey Zigachev #include "amdgpu.h" 38b843c749SSergey Zigachev #include "amdgpu_irq.h" 39b843c749SSergey Zigachev 40b843c749SSergey Zigachev #include "amdgpu_amdkfd.h" 41b843c749SSergey Zigachev 42b843c749SSergey Zigachev /* 43b843c749SSergey Zigachev * KMS wrapper. 44b843c749SSergey Zigachev * - 3.0.0 - initial driver 45b843c749SSergey Zigachev * - 3.1.0 - allow reading more status registers (GRBM, SRBM, SDMA, CP) 46b843c749SSergey Zigachev * - 3.2.0 - GFX8: Uses EOP_TC_WB_ACTION_EN, so UMDs don't have to do the same 47b843c749SSergey Zigachev * at the end of IBs. 48b843c749SSergey Zigachev * - 3.3.0 - Add VM support for UVD on supported hardware. 49b843c749SSergey Zigachev * - 3.4.0 - Add AMDGPU_INFO_NUM_EVICTIONS. 50b843c749SSergey Zigachev * - 3.5.0 - Add support for new UVD_NO_OP register. 51b843c749SSergey Zigachev * - 3.6.0 - kmd involves use CONTEXT_CONTROL in ring buffer. 52b843c749SSergey Zigachev * - 3.7.0 - Add support for VCE clock list packet 53b843c749SSergey Zigachev * - 3.8.0 - Add support raster config init in the kernel 54b843c749SSergey Zigachev * - 3.9.0 - Add support for memory query info about VRAM and GTT. 55b843c749SSergey Zigachev * - 3.10.0 - Add support for new fences ioctl, new gem ioctl flags 56b843c749SSergey Zigachev * - 3.11.0 - Add support for sensor query info (clocks, temp, etc). 57b843c749SSergey Zigachev * - 3.12.0 - Add query for double offchip LDS buffers 58b843c749SSergey Zigachev * - 3.13.0 - Add PRT support 59b843c749SSergey Zigachev * - 3.14.0 - Fix race in amdgpu_ctx_get_fence() and note new functionality 60b843c749SSergey Zigachev * - 3.15.0 - Export more gpu info for gfx9 61b843c749SSergey Zigachev * - 3.16.0 - Add reserved vmid support 62b843c749SSergey Zigachev * - 3.17.0 - Add AMDGPU_NUM_VRAM_CPU_PAGE_FAULTS. 63b843c749SSergey Zigachev * - 3.18.0 - Export gpu always on cu bitmap 64b843c749SSergey Zigachev * - 3.19.0 - Add support for UVD MJPEG decode 65b843c749SSergey Zigachev * - 3.20.0 - Add support for local BOs 66b843c749SSergey Zigachev * - 3.21.0 - Add DRM_AMDGPU_FENCE_TO_HANDLE ioctl 67b843c749SSergey Zigachev * - 3.22.0 - Add DRM_AMDGPU_SCHED ioctl 68b843c749SSergey Zigachev * - 3.23.0 - Add query for VRAM lost counter 69b843c749SSergey Zigachev * - 3.24.0 - Add high priority compute support for gfx9 70b843c749SSergey Zigachev * - 3.25.0 - Add support for sensor query info (stable pstate sclk/mclk). 71b843c749SSergey Zigachev * - 3.26.0 - GFX9: Process AMDGPU_IB_FLAG_TC_WB_NOT_INVALIDATE. 72b843c749SSergey Zigachev * - 3.27.0 - Add new chunk to to AMDGPU_CS to enable BO_LIST creation. 73b843c749SSergey Zigachev */ 74b843c749SSergey Zigachev #define KMS_DRIVER_MAJOR 3 75b843c749SSergey Zigachev #define KMS_DRIVER_MINOR 27 76b843c749SSergey Zigachev #define KMS_DRIVER_PATCHLEVEL 0 77b843c749SSergey Zigachev 78b843c749SSergey Zigachev int amdgpu_vram_limit = 0; 79b843c749SSergey Zigachev int amdgpu_vis_vram_limit = 0; 80b843c749SSergey Zigachev int amdgpu_gart_size = -1; /* auto */ 81b843c749SSergey Zigachev int amdgpu_gtt_size = -1; /* auto */ 82b843c749SSergey Zigachev int amdgpu_moverate = -1; /* auto */ 83b843c749SSergey Zigachev int amdgpu_benchmarking = 0; 84b843c749SSergey Zigachev int amdgpu_testing = 0; 85b843c749SSergey Zigachev int amdgpu_audio = -1; 86b843c749SSergey Zigachev int amdgpu_disp_priority = 0; 87*78973132SSergey Zigachev int amdgpu_hw_i2c = 1; 88b843c749SSergey Zigachev int amdgpu_pcie_gen2 = -1; 89b843c749SSergey Zigachev int amdgpu_msi = -1; 90b843c749SSergey Zigachev int amdgpu_lockup_timeout = 10000; 91b843c749SSergey Zigachev int amdgpu_dpm = -1; 92b843c749SSergey Zigachev int amdgpu_fw_load_type = -1; 93b843c749SSergey Zigachev int amdgpu_aspm = -1; 94b843c749SSergey Zigachev int amdgpu_runtime_pm = -1; 95b843c749SSergey Zigachev uint amdgpu_ip_block_mask = 0xffffffff; 96b843c749SSergey Zigachev int amdgpu_bapm = -1; 97b843c749SSergey Zigachev int amdgpu_deep_color = 0; 98b843c749SSergey Zigachev int amdgpu_vm_size = -1; 99b843c749SSergey Zigachev int amdgpu_vm_fragment_size = -1; 100b843c749SSergey Zigachev int amdgpu_vm_block_size = -1; 101b843c749SSergey Zigachev int amdgpu_vm_fault_stop = 0; 102b843c749SSergey Zigachev int amdgpu_vm_debug = 0; 103b843c749SSergey Zigachev int amdgpu_vram_page_split = 512; 104b843c749SSergey Zigachev int amdgpu_vm_update_mode = -1; 105b843c749SSergey Zigachev int amdgpu_exp_hw_support = 0; 106b843c749SSergey Zigachev int amdgpu_dc = -1; 107b843c749SSergey Zigachev int amdgpu_sched_jobs = 32; 108b843c749SSergey Zigachev int amdgpu_sched_hw_submission = 2; 109b843c749SSergey Zigachev uint amdgpu_pcie_gen_cap = 0; 110b843c749SSergey Zigachev uint amdgpu_pcie_lane_cap = 0; 111b843c749SSergey Zigachev uint amdgpu_cg_mask = 0xffffffff; 112b843c749SSergey Zigachev uint amdgpu_pg_mask = 0xffffffff; 113b843c749SSergey Zigachev uint amdgpu_sdma_phase_quantum = 32; 114b843c749SSergey Zigachev char *amdgpu_disable_cu = NULL; 115b843c749SSergey Zigachev char *amdgpu_virtual_display = NULL; 116b843c749SSergey Zigachev /* OverDrive(bit 14),gfxoff(bit 15),stutter mode(bit 17) disabled by default*/ 117b843c749SSergey Zigachev uint amdgpu_pp_feature_mask = 0xfffd3fff; 118b843c749SSergey Zigachev int amdgpu_ngg = 0; 119b843c749SSergey Zigachev int amdgpu_prim_buf_per_se = 0; 120b843c749SSergey Zigachev int amdgpu_pos_buf_per_se = 0; 121b843c749SSergey Zigachev int amdgpu_cntl_sb_buf_per_se = 0; 122b843c749SSergey Zigachev int amdgpu_param_buf_per_se = 0; 123b843c749SSergey Zigachev int amdgpu_job_hang_limit = 0; 124b843c749SSergey Zigachev int amdgpu_lbpw = -1; 125b843c749SSergey Zigachev int amdgpu_compute_multipipe = -1; 126b843c749SSergey Zigachev int amdgpu_gpu_recovery = -1; /* auto */ 127b843c749SSergey Zigachev int amdgpu_emu_mode = 0; 128b843c749SSergey Zigachev uint amdgpu_smu_memory_pool_size = 0; 129b843c749SSergey Zigachev 130b843c749SSergey Zigachev /** 131b843c749SSergey Zigachev * DOC: vramlimit (int) 132b843c749SSergey Zigachev * Restrict the total amount of VRAM in MiB for testing. The default is 0 (Use full VRAM). 133b843c749SSergey Zigachev */ 134b843c749SSergey Zigachev MODULE_PARM_DESC(vramlimit, "Restrict VRAM for testing, in megabytes"); 135b843c749SSergey Zigachev module_param_named(vramlimit, amdgpu_vram_limit, int, 0600); 136b843c749SSergey Zigachev 137b843c749SSergey Zigachev /** 138b843c749SSergey Zigachev * DOC: vis_vramlimit (int) 139b843c749SSergey Zigachev * Restrict the amount of CPU visible VRAM in MiB for testing. The default is 0 (Use full CPU visible VRAM). 140b843c749SSergey Zigachev */ 141b843c749SSergey Zigachev MODULE_PARM_DESC(vis_vramlimit, "Restrict visible VRAM for testing, in megabytes"); 142b843c749SSergey Zigachev module_param_named(vis_vramlimit, amdgpu_vis_vram_limit, int, 0444); 143b843c749SSergey Zigachev 144b843c749SSergey Zigachev /** 145b843c749SSergey Zigachev * DOC: gartsize (uint) 146b843c749SSergey Zigachev * Restrict the size of GART in Mib (32, 64, etc.) for testing. The default is -1 (The size depends on asic). 147b843c749SSergey Zigachev */ 148b843c749SSergey Zigachev MODULE_PARM_DESC(gartsize, "Size of GART to setup in megabytes (32, 64, etc., -1=auto)"); 149b843c749SSergey Zigachev module_param_named(gartsize, amdgpu_gart_size, uint, 0600); 150b843c749SSergey Zigachev 151b843c749SSergey Zigachev /** 152b843c749SSergey Zigachev * DOC: gttsize (int) 153b843c749SSergey Zigachev * Restrict the size of GTT domain in MiB for testing. The default is -1 (It's VRAM size if 3GB < VRAM < 3/4 RAM, 154b843c749SSergey Zigachev * otherwise 3/4 RAM size). 155b843c749SSergey Zigachev */ 156b843c749SSergey Zigachev MODULE_PARM_DESC(gttsize, "Size of the GTT domain in megabytes (-1 = auto)"); 157b843c749SSergey Zigachev module_param_named(gttsize, amdgpu_gtt_size, int, 0600); 158b843c749SSergey Zigachev 159b843c749SSergey Zigachev /** 160b843c749SSergey Zigachev * DOC: moverate (int) 161b843c749SSergey Zigachev * Set maximum buffer migration rate in MB/s. The default is -1 (8 MB/s). 162b843c749SSergey Zigachev */ 163b843c749SSergey Zigachev MODULE_PARM_DESC(moverate, "Maximum buffer migration rate in MB/s. (32, 64, etc., -1=auto, 0=1=disabled)"); 164b843c749SSergey Zigachev module_param_named(moverate, amdgpu_moverate, int, 0600); 165b843c749SSergey Zigachev 166b843c749SSergey Zigachev /** 167b843c749SSergey Zigachev * DOC: benchmark (int) 168b843c749SSergey Zigachev * Run benchmarks. The default is 0 (Skip benchmarks). 169b843c749SSergey Zigachev */ 170b843c749SSergey Zigachev MODULE_PARM_DESC(benchmark, "Run benchmark"); 171b843c749SSergey Zigachev module_param_named(benchmark, amdgpu_benchmarking, int, 0444); 172b843c749SSergey Zigachev 173b843c749SSergey Zigachev /** 174b843c749SSergey Zigachev * DOC: test (int) 175b843c749SSergey Zigachev * Test BO GTT->VRAM and VRAM->GTT GPU copies. The default is 0 (Skip test, only set 1 to run test). 176b843c749SSergey Zigachev */ 177b843c749SSergey Zigachev MODULE_PARM_DESC(test, "Run tests"); 178b843c749SSergey Zigachev module_param_named(test, amdgpu_testing, int, 0444); 179b843c749SSergey Zigachev 180b843c749SSergey Zigachev /** 181b843c749SSergey Zigachev * DOC: audio (int) 182b843c749SSergey Zigachev * Set HDMI/DPAudio. Only affects non-DC display handling. The default is -1 (Enabled), set 0 to disabled it. 183b843c749SSergey Zigachev */ 184b843c749SSergey Zigachev MODULE_PARM_DESC(audio, "Audio enable (-1 = auto, 0 = disable, 1 = enable)"); 185b843c749SSergey Zigachev module_param_named(audio, amdgpu_audio, int, 0444); 186b843c749SSergey Zigachev 187b843c749SSergey Zigachev /** 188b843c749SSergey Zigachev * DOC: disp_priority (int) 189b843c749SSergey Zigachev * Set display Priority (1 = normal, 2 = high). Only affects non-DC display handling. The default is 0 (auto). 190b843c749SSergey Zigachev */ 191b843c749SSergey Zigachev MODULE_PARM_DESC(disp_priority, "Display Priority (0 = auto, 1 = normal, 2 = high)"); 192b843c749SSergey Zigachev module_param_named(disp_priority, amdgpu_disp_priority, int, 0444); 193b843c749SSergey Zigachev 194b843c749SSergey Zigachev /** 195b843c749SSergey Zigachev * DOC: hw_i2c (int) 196b843c749SSergey Zigachev * To enable hw i2c engine. Only affects non-DC display handling. The default is 0 (Disabled). 197b843c749SSergey Zigachev */ 198b843c749SSergey Zigachev MODULE_PARM_DESC(hw_i2c, "hw i2c engine enable (0 = disable)"); 199b843c749SSergey Zigachev module_param_named(hw_i2c, amdgpu_hw_i2c, int, 0444); 200b843c749SSergey Zigachev 201b843c749SSergey Zigachev /** 202b843c749SSergey Zigachev * DOC: pcie_gen2 (int) 203b843c749SSergey Zigachev * To disable PCIE Gen2/3 mode (0 = disable, 1 = enable). The default is -1 (auto, enabled). 204b843c749SSergey Zigachev */ 205b843c749SSergey Zigachev MODULE_PARM_DESC(pcie_gen2, "PCIE Gen2 mode (-1 = auto, 0 = disable, 1 = enable)"); 206b843c749SSergey Zigachev module_param_named(pcie_gen2, amdgpu_pcie_gen2, int, 0444); 207b843c749SSergey Zigachev 208b843c749SSergey Zigachev /** 209b843c749SSergey Zigachev * DOC: msi (int) 210b843c749SSergey Zigachev * To disable Message Signaled Interrupts (MSI) functionality (1 = enable, 0 = disable). The default is -1 (auto, enabled). 211b843c749SSergey Zigachev */ 212b843c749SSergey Zigachev MODULE_PARM_DESC(msi, "MSI support (1 = enable, 0 = disable, -1 = auto)"); 213b843c749SSergey Zigachev module_param_named(msi, amdgpu_msi, int, 0444); 214b843c749SSergey Zigachev 215b843c749SSergey Zigachev /** 216b843c749SSergey Zigachev * DOC: lockup_timeout (int) 217b843c749SSergey Zigachev * Set GPU scheduler timeout value in ms. Value 0 is invalidated, will be adjusted to 10000. 218b843c749SSergey Zigachev * Negative values mean 'infinite timeout' (MAX_JIFFY_OFFSET). The default is 10000. 219b843c749SSergey Zigachev */ 220b843c749SSergey Zigachev MODULE_PARM_DESC(lockup_timeout, "GPU lockup timeout in ms > 0 (default 10000)"); 221b843c749SSergey Zigachev module_param_named(lockup_timeout, amdgpu_lockup_timeout, int, 0444); 222b843c749SSergey Zigachev 223b843c749SSergey Zigachev /** 224b843c749SSergey Zigachev * DOC: dpm (int) 225b843c749SSergey Zigachev * Override for dynamic power management setting (1 = enable, 0 = disable). The default is -1 (auto). 226b843c749SSergey Zigachev */ 227b843c749SSergey Zigachev MODULE_PARM_DESC(dpm, "DPM support (1 = enable, 0 = disable, -1 = auto)"); 228b843c749SSergey Zigachev module_param_named(dpm, amdgpu_dpm, int, 0444); 229b843c749SSergey Zigachev 230b843c749SSergey Zigachev /** 231b843c749SSergey Zigachev * DOC: fw_load_type (int) 232b843c749SSergey Zigachev * Set different firmware loading type for debugging (0 = direct, 1 = SMU, 2 = PSP). The default is -1 (auto). 233b843c749SSergey Zigachev */ 234b843c749SSergey Zigachev MODULE_PARM_DESC(fw_load_type, "firmware loading type (0 = direct, 1 = SMU, 2 = PSP, -1 = auto)"); 235b843c749SSergey Zigachev module_param_named(fw_load_type, amdgpu_fw_load_type, int, 0444); 236b843c749SSergey Zigachev 237b843c749SSergey Zigachev /** 238b843c749SSergey Zigachev * DOC: aspm (int) 239b843c749SSergey Zigachev * To disable ASPM (1 = enable, 0 = disable). The default is -1 (auto, enabled). 240b843c749SSergey Zigachev */ 241b843c749SSergey Zigachev MODULE_PARM_DESC(aspm, "ASPM support (1 = enable, 0 = disable, -1 = auto)"); 242b843c749SSergey Zigachev module_param_named(aspm, amdgpu_aspm, int, 0444); 243b843c749SSergey Zigachev 244b843c749SSergey Zigachev /** 245b843c749SSergey Zigachev * DOC: runpm (int) 246b843c749SSergey Zigachev * Override for runtime power management control for dGPUs in PX/HG laptops. The amdgpu driver can dynamically power down 247b843c749SSergey Zigachev * the dGPU on PX/HG laptops when it is idle. The default is -1 (auto enable). Setting the value to 0 disables this functionality. 248b843c749SSergey Zigachev */ 249b843c749SSergey Zigachev MODULE_PARM_DESC(runpm, "PX runtime pm (1 = force enable, 0 = disable, -1 = PX only default)"); 250b843c749SSergey Zigachev module_param_named(runpm, amdgpu_runtime_pm, int, 0444); 251b843c749SSergey Zigachev 252b843c749SSergey Zigachev /** 253b843c749SSergey Zigachev * DOC: ip_block_mask (uint) 254b843c749SSergey Zigachev * Override what IP blocks are enabled on the GPU. Each GPU is a collection of IP blocks (gfx, display, video, etc.). 255b843c749SSergey Zigachev * Use this parameter to disable specific blocks. Note that the IP blocks do not have a fixed index. Some asics may not have 256b843c749SSergey Zigachev * some IPs or may include multiple instances of an IP so the ordering various from asic to asic. See the driver output in 257b843c749SSergey Zigachev * the kernel log for the list of IPs on the asic. The default is 0xffffffff (enable all blocks on a device). 258b843c749SSergey Zigachev */ 259b843c749SSergey Zigachev MODULE_PARM_DESC(ip_block_mask, "IP Block Mask (all blocks enabled (default))"); 260b843c749SSergey Zigachev module_param_named(ip_block_mask, amdgpu_ip_block_mask, uint, 0444); 261b843c749SSergey Zigachev 262b843c749SSergey Zigachev /** 263b843c749SSergey Zigachev * DOC: bapm (int) 264b843c749SSergey Zigachev * Bidirectional Application Power Management (BAPM) used to dynamically share TDP between CPU and GPU. Set value 0 to disable it. 265b843c749SSergey Zigachev * The default -1 (auto, enabled) 266b843c749SSergey Zigachev */ 267b843c749SSergey Zigachev MODULE_PARM_DESC(bapm, "BAPM support (1 = enable, 0 = disable, -1 = auto)"); 268b843c749SSergey Zigachev module_param_named(bapm, amdgpu_bapm, int, 0444); 269b843c749SSergey Zigachev 270b843c749SSergey Zigachev /** 271b843c749SSergey Zigachev * DOC: deep_color (int) 272b843c749SSergey Zigachev * Set 1 to enable Deep Color support. Only affects non-DC display handling. The default is 0 (disabled). 273b843c749SSergey Zigachev */ 274b843c749SSergey Zigachev MODULE_PARM_DESC(deep_color, "Deep Color support (1 = enable, 0 = disable (default))"); 275b843c749SSergey Zigachev module_param_named(deep_color, amdgpu_deep_color, int, 0444); 276b843c749SSergey Zigachev 277b843c749SSergey Zigachev /** 278b843c749SSergey Zigachev * DOC: vm_size (int) 279b843c749SSergey Zigachev * Override the size of the GPU's per client virtual address space in GiB. The default is -1 (automatic for each asic). 280b843c749SSergey Zigachev */ 281b843c749SSergey Zigachev MODULE_PARM_DESC(vm_size, "VM address space size in gigabytes (default 64GB)"); 282b843c749SSergey Zigachev module_param_named(vm_size, amdgpu_vm_size, int, 0444); 283b843c749SSergey Zigachev 284b843c749SSergey Zigachev /** 285b843c749SSergey Zigachev * DOC: vm_fragment_size (int) 286b843c749SSergey Zigachev * Override VM fragment size in bits (4, 5, etc. 4 = 64K, 9 = 2M). The default is -1 (automatic for each asic). 287b843c749SSergey Zigachev */ 288b843c749SSergey Zigachev MODULE_PARM_DESC(vm_fragment_size, "VM fragment size in bits (4, 5, etc. 4 = 64K (default), Max 9 = 2M)"); 289b843c749SSergey Zigachev module_param_named(vm_fragment_size, amdgpu_vm_fragment_size, int, 0444); 290b843c749SSergey Zigachev 291b843c749SSergey Zigachev /** 292b843c749SSergey Zigachev * DOC: vm_block_size (int) 293b843c749SSergey Zigachev * Override VM page table size in bits (default depending on vm_size and hw setup). The default is -1 (automatic for each asic). 294b843c749SSergey Zigachev */ 295b843c749SSergey Zigachev MODULE_PARM_DESC(vm_block_size, "VM page table size in bits (default depending on vm_size)"); 296b843c749SSergey Zigachev module_param_named(vm_block_size, amdgpu_vm_block_size, int, 0444); 297b843c749SSergey Zigachev 298b843c749SSergey Zigachev /** 299b843c749SSergey Zigachev * DOC: vm_fault_stop (int) 300b843c749SSergey Zigachev * Stop on VM fault for debugging (0 = never, 1 = print first, 2 = always). The default is 0 (No stop). 301b843c749SSergey Zigachev */ 302b843c749SSergey Zigachev MODULE_PARM_DESC(vm_fault_stop, "Stop on VM fault (0 = never (default), 1 = print first, 2 = always)"); 303b843c749SSergey Zigachev module_param_named(vm_fault_stop, amdgpu_vm_fault_stop, int, 0444); 304b843c749SSergey Zigachev 305b843c749SSergey Zigachev /** 306b843c749SSergey Zigachev * DOC: vm_debug (int) 307b843c749SSergey Zigachev * Debug VM handling (0 = disabled, 1 = enabled). The default is 0 (Disabled). 308b843c749SSergey Zigachev */ 309b843c749SSergey Zigachev MODULE_PARM_DESC(vm_debug, "Debug VM handling (0 = disabled (default), 1 = enabled)"); 310b843c749SSergey Zigachev module_param_named(vm_debug, amdgpu_vm_debug, int, 0644); 311b843c749SSergey Zigachev 312b843c749SSergey Zigachev /** 313b843c749SSergey Zigachev * DOC: vm_update_mode (int) 314b843c749SSergey Zigachev * Override VM update mode. VM updated by using CPU (0 = never, 1 = Graphics only, 2 = Compute only, 3 = Both). The default 315b843c749SSergey Zigachev * is -1 (Only in large BAR(LB) systems Compute VM tables will be updated by CPU, otherwise 0, never). 316b843c749SSergey Zigachev */ 317b843c749SSergey Zigachev MODULE_PARM_DESC(vm_update_mode, "VM update using CPU (0 = never (default except for large BAR(LB)), 1 = Graphics only, 2 = Compute only (default for LB), 3 = Both"); 318b843c749SSergey Zigachev module_param_named(vm_update_mode, amdgpu_vm_update_mode, int, 0444); 319b843c749SSergey Zigachev 320b843c749SSergey Zigachev /** 321b843c749SSergey Zigachev * DOC: vram_page_split (int) 322b843c749SSergey Zigachev * Override the number of pages after we split VRAM allocations (default 512, -1 = disable). The default is 512. 323b843c749SSergey Zigachev */ 324b843c749SSergey Zigachev MODULE_PARM_DESC(vram_page_split, "Number of pages after we split VRAM allocations (default 512, -1 = disable)"); 325b843c749SSergey Zigachev module_param_named(vram_page_split, amdgpu_vram_page_split, int, 0444); 326b843c749SSergey Zigachev 327b843c749SSergey Zigachev /** 328b843c749SSergey Zigachev * DOC: exp_hw_support (int) 329b843c749SSergey Zigachev * Enable experimental hw support (1 = enable). The default is 0 (disabled). 330b843c749SSergey Zigachev */ 331b843c749SSergey Zigachev MODULE_PARM_DESC(exp_hw_support, "experimental hw support (1 = enable, 0 = disable (default))"); 332b843c749SSergey Zigachev module_param_named(exp_hw_support, amdgpu_exp_hw_support, int, 0444); 333b843c749SSergey Zigachev 334b843c749SSergey Zigachev /** 335b843c749SSergey Zigachev * DOC: dc (int) 336b843c749SSergey Zigachev * Disable/Enable Display Core driver for debugging (1 = enable, 0 = disable). The default is -1 (automatic for each asic). 337b843c749SSergey Zigachev */ 338b843c749SSergey Zigachev MODULE_PARM_DESC(dc, "Display Core driver (1 = enable, 0 = disable, -1 = auto (default))"); 339b843c749SSergey Zigachev module_param_named(dc, amdgpu_dc, int, 0444); 340b843c749SSergey Zigachev 341b843c749SSergey Zigachev /** 342b843c749SSergey Zigachev * DOC: sched_jobs (int) 343b843c749SSergey Zigachev * Override the max number of jobs supported in the sw queue. The default is 32. 344b843c749SSergey Zigachev */ 345b843c749SSergey Zigachev MODULE_PARM_DESC(sched_jobs, "the max number of jobs supported in the sw queue (default 32)"); 346b843c749SSergey Zigachev module_param_named(sched_jobs, amdgpu_sched_jobs, int, 0444); 347b843c749SSergey Zigachev 348b843c749SSergey Zigachev /** 349b843c749SSergey Zigachev * DOC: sched_hw_submission (int) 350b843c749SSergey Zigachev * Override the max number of HW submissions. The default is 2. 351b843c749SSergey Zigachev */ 352b843c749SSergey Zigachev MODULE_PARM_DESC(sched_hw_submission, "the max number of HW submissions (default 2)"); 353b843c749SSergey Zigachev module_param_named(sched_hw_submission, amdgpu_sched_hw_submission, int, 0444); 354b843c749SSergey Zigachev 355b843c749SSergey Zigachev /** 356b843c749SSergey Zigachev * DOC: ppfeaturemask (uint) 357b843c749SSergey Zigachev * Override power features enabled. See enum PP_FEATURE_MASK in drivers/gpu/drm/amd/include/amd_shared.h. 358b843c749SSergey Zigachev * The default is the current set of stable power features. 359b843c749SSergey Zigachev */ 360b843c749SSergey Zigachev MODULE_PARM_DESC(ppfeaturemask, "all power features enabled (default))"); 361b843c749SSergey Zigachev module_param_named(ppfeaturemask, amdgpu_pp_feature_mask, uint, 0444); 362b843c749SSergey Zigachev 363b843c749SSergey Zigachev /** 364b843c749SSergey Zigachev * DOC: pcie_gen_cap (uint) 365b843c749SSergey Zigachev * Override PCIE gen speed capabilities. See the CAIL flags in drivers/gpu/drm/amd/include/amd_pcie.h. 366b843c749SSergey Zigachev * The default is 0 (automatic for each asic). 367b843c749SSergey Zigachev */ 368b843c749SSergey Zigachev MODULE_PARM_DESC(pcie_gen_cap, "PCIE Gen Caps (0: autodetect (default))"); 369b843c749SSergey Zigachev module_param_named(pcie_gen_cap, amdgpu_pcie_gen_cap, uint, 0444); 370b843c749SSergey Zigachev 371b843c749SSergey Zigachev /** 372b843c749SSergey Zigachev * DOC: pcie_lane_cap (uint) 373b843c749SSergey Zigachev * Override PCIE lanes capabilities. See the CAIL flags in drivers/gpu/drm/amd/include/amd_pcie.h. 374b843c749SSergey Zigachev * The default is 0 (automatic for each asic). 375b843c749SSergey Zigachev */ 376b843c749SSergey Zigachev MODULE_PARM_DESC(pcie_lane_cap, "PCIE Lane Caps (0: autodetect (default))"); 377b843c749SSergey Zigachev module_param_named(pcie_lane_cap, amdgpu_pcie_lane_cap, uint, 0444); 378b843c749SSergey Zigachev 379b843c749SSergey Zigachev /** 380b843c749SSergey Zigachev * DOC: cg_mask (uint) 381b843c749SSergey Zigachev * Override Clockgating features enabled on GPU (0 = disable clock gating). See the AMD_CG_SUPPORT flags in 382b843c749SSergey Zigachev * drivers/gpu/drm/amd/include/amd_shared.h. The default is 0xffffffff (all enabled). 383b843c749SSergey Zigachev */ 384b843c749SSergey Zigachev MODULE_PARM_DESC(cg_mask, "Clockgating flags mask (0 = disable clock gating)"); 385b843c749SSergey Zigachev module_param_named(cg_mask, amdgpu_cg_mask, uint, 0444); 386b843c749SSergey Zigachev 387b843c749SSergey Zigachev /** 388b843c749SSergey Zigachev * DOC: pg_mask (uint) 389b843c749SSergey Zigachev * Override Powergating features enabled on GPU (0 = disable power gating). See the AMD_PG_SUPPORT flags in 390b843c749SSergey Zigachev * drivers/gpu/drm/amd/include/amd_shared.h. The default is 0xffffffff (all enabled). 391b843c749SSergey Zigachev */ 392b843c749SSergey Zigachev MODULE_PARM_DESC(pg_mask, "Powergating flags mask (0 = disable power gating)"); 393b843c749SSergey Zigachev module_param_named(pg_mask, amdgpu_pg_mask, uint, 0444); 394b843c749SSergey Zigachev 395b843c749SSergey Zigachev /** 396b843c749SSergey Zigachev * DOC: sdma_phase_quantum (uint) 397b843c749SSergey Zigachev * Override SDMA context switch phase quantum (x 1K GPU clock cycles, 0 = no change). The default is 32. 398b843c749SSergey Zigachev */ 399b843c749SSergey Zigachev MODULE_PARM_DESC(sdma_phase_quantum, "SDMA context switch phase quantum (x 1K GPU clock cycles, 0 = no change (default 32))"); 400b843c749SSergey Zigachev module_param_named(sdma_phase_quantum, amdgpu_sdma_phase_quantum, uint, 0444); 401b843c749SSergey Zigachev 402b843c749SSergey Zigachev /** 403b843c749SSergey Zigachev * DOC: disable_cu (charp) 404b843c749SSergey Zigachev * Set to disable CUs (It's set like se.sh.cu,...). The default is NULL. 405b843c749SSergey Zigachev */ 406b843c749SSergey Zigachev MODULE_PARM_DESC(disable_cu, "Disable CUs (se.sh.cu,...)"); 407b843c749SSergey Zigachev module_param_named(disable_cu, amdgpu_disable_cu, charp, 0444); 408b843c749SSergey Zigachev 409b843c749SSergey Zigachev /** 410b843c749SSergey Zigachev * DOC: virtual_display (charp) 411b843c749SSergey Zigachev * Set to enable virtual display feature. This feature provides a virtual display hardware on headless boards 412b843c749SSergey Zigachev * or in virtualized environments. It will be set like xxxx:xx:xx.x,x;xxxx:xx:xx.x,x. It's the pci address of 413b843c749SSergey Zigachev * the device, plus the number of crtcs to expose. E.g., 0000:26:00.0,4 would enable 4 virtual crtcs on the pci 414b843c749SSergey Zigachev * device at 26:00.0. The default is NULL. 415b843c749SSergey Zigachev */ 416b843c749SSergey Zigachev MODULE_PARM_DESC(virtual_display, 417b843c749SSergey Zigachev "Enable virtual display feature (the virtual_display will be set like xxxx:xx:xx.x,x;xxxx:xx:xx.x,x)"); 418b843c749SSergey Zigachev module_param_named(virtual_display, amdgpu_virtual_display, charp, 0444); 419b843c749SSergey Zigachev 420b843c749SSergey Zigachev /** 421b843c749SSergey Zigachev * DOC: ngg (int) 422b843c749SSergey Zigachev * Set to enable Next Generation Graphics (1 = enable). The default is 0 (disabled). 423b843c749SSergey Zigachev */ 424b843c749SSergey Zigachev MODULE_PARM_DESC(ngg, "Next Generation Graphics (1 = enable, 0 = disable(default depending on gfx))"); 425b843c749SSergey Zigachev module_param_named(ngg, amdgpu_ngg, int, 0444); 426b843c749SSergey Zigachev 427b843c749SSergey Zigachev /** 428b843c749SSergey Zigachev * DOC: prim_buf_per_se (int) 429b843c749SSergey Zigachev * Override the size of Primitive Buffer per Shader Engine in Byte. The default is 0 (depending on gfx). 430b843c749SSergey Zigachev */ 431b843c749SSergey Zigachev MODULE_PARM_DESC(prim_buf_per_se, "the size of Primitive Buffer per Shader Engine (default depending on gfx)"); 432b843c749SSergey Zigachev module_param_named(prim_buf_per_se, amdgpu_prim_buf_per_se, int, 0444); 433b843c749SSergey Zigachev 434b843c749SSergey Zigachev /** 435b843c749SSergey Zigachev * DOC: pos_buf_per_se (int) 436b843c749SSergey Zigachev * Override the size of Position Buffer per Shader Engine in Byte. The default is 0 (depending on gfx). 437b843c749SSergey Zigachev */ 438b843c749SSergey Zigachev MODULE_PARM_DESC(pos_buf_per_se, "the size of Position Buffer per Shader Engine (default depending on gfx)"); 439b843c749SSergey Zigachev module_param_named(pos_buf_per_se, amdgpu_pos_buf_per_se, int, 0444); 440b843c749SSergey Zigachev 441b843c749SSergey Zigachev /** 442b843c749SSergey Zigachev * DOC: cntl_sb_buf_per_se (int) 443b843c749SSergey Zigachev * Override the size of Control Sideband per Shader Engine in Byte. The default is 0 (depending on gfx). 444b843c749SSergey Zigachev */ 445b843c749SSergey Zigachev MODULE_PARM_DESC(cntl_sb_buf_per_se, "the size of Control Sideband per Shader Engine (default depending on gfx)"); 446b843c749SSergey Zigachev module_param_named(cntl_sb_buf_per_se, amdgpu_cntl_sb_buf_per_se, int, 0444); 447b843c749SSergey Zigachev 448b843c749SSergey Zigachev /** 449b843c749SSergey Zigachev * DOC: param_buf_per_se (int) 450b843c749SSergey Zigachev * Override the size of Off-Chip Pramater Cache per Shader Engine in Byte. The default is 0 (depending on gfx). 451b843c749SSergey Zigachev */ 452b843c749SSergey Zigachev MODULE_PARM_DESC(param_buf_per_se, "the size of Off-Chip Pramater Cache per Shader Engine (default depending on gfx)"); 453b843c749SSergey Zigachev module_param_named(param_buf_per_se, amdgpu_param_buf_per_se, int, 0444); 454b843c749SSergey Zigachev 455b843c749SSergey Zigachev /** 456b843c749SSergey Zigachev * DOC: job_hang_limit (int) 457b843c749SSergey Zigachev * Set how much time allow a job hang and not drop it. The default is 0. 458b843c749SSergey Zigachev */ 459b843c749SSergey Zigachev MODULE_PARM_DESC(job_hang_limit, "how much time allow a job hang and not drop it (default 0)"); 460b843c749SSergey Zigachev module_param_named(job_hang_limit, amdgpu_job_hang_limit, int ,0444); 461b843c749SSergey Zigachev 462b843c749SSergey Zigachev /** 463b843c749SSergey Zigachev * DOC: lbpw (int) 464b843c749SSergey Zigachev * Override Load Balancing Per Watt (LBPW) support (1 = enable, 0 = disable). The default is -1 (auto, enabled). 465b843c749SSergey Zigachev */ 466b843c749SSergey Zigachev MODULE_PARM_DESC(lbpw, "Load Balancing Per Watt (LBPW) support (1 = enable, 0 = disable, -1 = auto)"); 467b843c749SSergey Zigachev module_param_named(lbpw, amdgpu_lbpw, int, 0444); 468b843c749SSergey Zigachev 469b843c749SSergey Zigachev MODULE_PARM_DESC(compute_multipipe, "Force compute queues to be spread across pipes (1 = enable, 0 = disable, -1 = auto)"); 470b843c749SSergey Zigachev module_param_named(compute_multipipe, amdgpu_compute_multipipe, int, 0444); 471b843c749SSergey Zigachev 472b843c749SSergey Zigachev /** 473b843c749SSergey Zigachev * DOC: gpu_recovery (int) 474b843c749SSergey Zigachev * Set to enable GPU recovery mechanism (1 = enable, 0 = disable). The default is -1 (auto, disabled except SRIOV). 475b843c749SSergey Zigachev */ 476b843c749SSergey Zigachev MODULE_PARM_DESC(gpu_recovery, "Enable GPU recovery mechanism, (1 = enable, 0 = disable, -1 = auto)"); 477b843c749SSergey Zigachev module_param_named(gpu_recovery, amdgpu_gpu_recovery, int, 0444); 478b843c749SSergey Zigachev 479b843c749SSergey Zigachev /** 480b843c749SSergey Zigachev * DOC: emu_mode (int) 481b843c749SSergey Zigachev * Set value 1 to enable emulation mode. This is only needed when running on an emulator. The default is 0 (disabled). 482b843c749SSergey Zigachev */ 483b843c749SSergey Zigachev MODULE_PARM_DESC(emu_mode, "Emulation mode, (1 = enable, 0 = disable)"); 484b843c749SSergey Zigachev module_param_named(emu_mode, amdgpu_emu_mode, int, 0444); 485b843c749SSergey Zigachev 486b843c749SSergey Zigachev /** 487b843c749SSergey Zigachev * DOC: si_support (int) 488b843c749SSergey Zigachev * Set SI support driver. This parameter works after set config CONFIG_DRM_AMDGPU_SI. For SI asic, when radeon driver is enabled, 489b843c749SSergey Zigachev * set value 0 to use radeon driver, while set value 1 to use amdgpu driver. The default is using radeon driver when it available, 490b843c749SSergey Zigachev * otherwise using amdgpu driver. 491b843c749SSergey Zigachev */ 492b843c749SSergey Zigachev #ifdef CONFIG_DRM_AMDGPU_SI 493b843c749SSergey Zigachev 494b843c749SSergey Zigachev #if defined(CONFIG_DRM_RADEON) || defined(CONFIG_DRM_RADEON_MODULE) 495b843c749SSergey Zigachev int amdgpu_si_support = 0; 496b843c749SSergey Zigachev MODULE_PARM_DESC(si_support, "SI support (1 = enabled, 0 = disabled (default))"); 497b843c749SSergey Zigachev #else 498b843c749SSergey Zigachev int amdgpu_si_support = 1; 499b843c749SSergey Zigachev MODULE_PARM_DESC(si_support, "SI support (1 = enabled (default), 0 = disabled)"); 500b843c749SSergey Zigachev #endif 501b843c749SSergey Zigachev 502b843c749SSergey Zigachev module_param_named(si_support, amdgpu_si_support, int, 0444); 503b843c749SSergey Zigachev #endif 504b843c749SSergey Zigachev 505b843c749SSergey Zigachev /** 506b843c749SSergey Zigachev * DOC: cik_support (int) 507b843c749SSergey Zigachev * Set CIK support driver. This parameter works after set config CONFIG_DRM_AMDGPU_CIK. For CIK asic, when radeon driver is enabled, 508b843c749SSergey Zigachev * set value 0 to use radeon driver, while set value 1 to use amdgpu driver. The default is using radeon driver when it available, 509b843c749SSergey Zigachev * otherwise using amdgpu driver. 510b843c749SSergey Zigachev */ 511b843c749SSergey Zigachev #ifdef CONFIG_DRM_AMDGPU_CIK 512b843c749SSergey Zigachev 513b843c749SSergey Zigachev #if defined(CONFIG_DRM_RADEON) || defined(CONFIG_DRM_RADEON_MODULE) 514b843c749SSergey Zigachev int amdgpu_cik_support = 0; 515b843c749SSergey Zigachev MODULE_PARM_DESC(cik_support, "CIK support (1 = enabled, 0 = disabled (default))"); 516b843c749SSergey Zigachev #else 517b843c749SSergey Zigachev int amdgpu_cik_support = 1; 518b843c749SSergey Zigachev MODULE_PARM_DESC(cik_support, "CIK support (1 = enabled (default), 0 = disabled)"); 519b843c749SSergey Zigachev #endif 520b843c749SSergey Zigachev 521b843c749SSergey Zigachev module_param_named(cik_support, amdgpu_cik_support, int, 0444); 522b843c749SSergey Zigachev #endif 523b843c749SSergey Zigachev 524b843c749SSergey Zigachev /** 525b843c749SSergey Zigachev * DOC: smu_memory_pool_size (uint) 526b843c749SSergey Zigachev * It is used to reserve gtt for smu debug usage, setting value 0 to disable it. The actual size is value * 256MiB. 527b843c749SSergey Zigachev * E.g. 0x1 = 256Mbyte, 0x2 = 512Mbyte, 0x4 = 1 Gbyte, 0x8 = 2GByte. The default is 0 (disabled). 528b843c749SSergey Zigachev */ 529b843c749SSergey Zigachev MODULE_PARM_DESC(smu_memory_pool_size, 530b843c749SSergey Zigachev "reserve gtt for smu debug usage, 0 = disable," 531b843c749SSergey Zigachev "0x1 = 256Mbyte, 0x2 = 512Mbyte, 0x4 = 1 Gbyte, 0x8 = 2GByte"); 532b843c749SSergey Zigachev module_param_named(smu_memory_pool_size, amdgpu_smu_memory_pool_size, uint, 0444); 533b843c749SSergey Zigachev 534b843c749SSergey Zigachev static const struct pci_device_id pciidlist[] = { 535b843c749SSergey Zigachev #ifdef CONFIG_DRM_AMDGPU_SI 536b843c749SSergey Zigachev {0x1002, 0x6780, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI}, 537b843c749SSergey Zigachev {0x1002, 0x6784, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI}, 538b843c749SSergey Zigachev {0x1002, 0x6788, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI}, 539b843c749SSergey Zigachev {0x1002, 0x678A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI}, 540b843c749SSergey Zigachev {0x1002, 0x6790, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI}, 541b843c749SSergey Zigachev {0x1002, 0x6791, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI}, 542b843c749SSergey Zigachev {0x1002, 0x6792, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI}, 543b843c749SSergey Zigachev {0x1002, 0x6798, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI}, 544b843c749SSergey Zigachev {0x1002, 0x6799, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI}, 545b843c749SSergey Zigachev {0x1002, 0x679A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI}, 546b843c749SSergey Zigachev {0x1002, 0x679B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI}, 547b843c749SSergey Zigachev {0x1002, 0x679E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI}, 548b843c749SSergey Zigachev {0x1002, 0x679F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI}, 549b843c749SSergey Zigachev {0x1002, 0x6800, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|AMD_IS_MOBILITY}, 550b843c749SSergey Zigachev {0x1002, 0x6801, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|AMD_IS_MOBILITY}, 551b843c749SSergey Zigachev {0x1002, 0x6802, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|AMD_IS_MOBILITY}, 552b843c749SSergey Zigachev {0x1002, 0x6806, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN}, 553b843c749SSergey Zigachev {0x1002, 0x6808, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN}, 554b843c749SSergey Zigachev {0x1002, 0x6809, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN}, 555b843c749SSergey Zigachev {0x1002, 0x6810, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN}, 556b843c749SSergey Zigachev {0x1002, 0x6811, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN}, 557b843c749SSergey Zigachev {0x1002, 0x6816, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN}, 558b843c749SSergey Zigachev {0x1002, 0x6817, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN}, 559b843c749SSergey Zigachev {0x1002, 0x6818, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN}, 560b843c749SSergey Zigachev {0x1002, 0x6819, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN}, 561b843c749SSergey Zigachev {0x1002, 0x6600, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|AMD_IS_MOBILITY}, 562b843c749SSergey Zigachev {0x1002, 0x6601, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|AMD_IS_MOBILITY}, 563b843c749SSergey Zigachev {0x1002, 0x6602, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|AMD_IS_MOBILITY}, 564b843c749SSergey Zigachev {0x1002, 0x6603, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|AMD_IS_MOBILITY}, 565b843c749SSergey Zigachev {0x1002, 0x6604, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|AMD_IS_MOBILITY}, 566b843c749SSergey Zigachev {0x1002, 0x6605, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|AMD_IS_MOBILITY}, 567b843c749SSergey Zigachev {0x1002, 0x6606, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|AMD_IS_MOBILITY}, 568b843c749SSergey Zigachev {0x1002, 0x6607, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|AMD_IS_MOBILITY}, 569b843c749SSergey Zigachev {0x1002, 0x6608, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND}, 570b843c749SSergey Zigachev {0x1002, 0x6610, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND}, 571b843c749SSergey Zigachev {0x1002, 0x6611, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND}, 572b843c749SSergey Zigachev {0x1002, 0x6613, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND}, 573b843c749SSergey Zigachev {0x1002, 0x6617, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|AMD_IS_MOBILITY}, 574b843c749SSergey Zigachev {0x1002, 0x6620, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|AMD_IS_MOBILITY}, 575b843c749SSergey Zigachev {0x1002, 0x6621, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|AMD_IS_MOBILITY}, 576b843c749SSergey Zigachev {0x1002, 0x6623, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|AMD_IS_MOBILITY}, 577b843c749SSergey Zigachev {0x1002, 0x6631, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND}, 578b843c749SSergey Zigachev {0x1002, 0x6820, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE|AMD_IS_MOBILITY}, 579b843c749SSergey Zigachev {0x1002, 0x6821, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE|AMD_IS_MOBILITY}, 580b843c749SSergey Zigachev {0x1002, 0x6822, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE|AMD_IS_MOBILITY}, 581b843c749SSergey Zigachev {0x1002, 0x6823, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE|AMD_IS_MOBILITY}, 582b843c749SSergey Zigachev {0x1002, 0x6824, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE|AMD_IS_MOBILITY}, 583b843c749SSergey Zigachev {0x1002, 0x6825, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE|AMD_IS_MOBILITY}, 584b843c749SSergey Zigachev {0x1002, 0x6826, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE|AMD_IS_MOBILITY}, 585b843c749SSergey Zigachev {0x1002, 0x6827, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE|AMD_IS_MOBILITY}, 586b843c749SSergey Zigachev {0x1002, 0x6828, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE}, 587b843c749SSergey Zigachev {0x1002, 0x6829, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE}, 588b843c749SSergey Zigachev {0x1002, 0x682A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE|AMD_IS_MOBILITY}, 589b843c749SSergey Zigachev {0x1002, 0x682B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE|AMD_IS_MOBILITY}, 590b843c749SSergey Zigachev {0x1002, 0x682C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE}, 591b843c749SSergey Zigachev {0x1002, 0x682D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE|AMD_IS_MOBILITY}, 592b843c749SSergey Zigachev {0x1002, 0x682F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE|AMD_IS_MOBILITY}, 593b843c749SSergey Zigachev {0x1002, 0x6830, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE|AMD_IS_MOBILITY}, 594b843c749SSergey Zigachev {0x1002, 0x6831, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE|AMD_IS_MOBILITY}, 595b843c749SSergey Zigachev {0x1002, 0x6835, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE}, 596b843c749SSergey Zigachev {0x1002, 0x6837, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE}, 597b843c749SSergey Zigachev {0x1002, 0x6838, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE}, 598b843c749SSergey Zigachev {0x1002, 0x6839, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE}, 599b843c749SSergey Zigachev {0x1002, 0x683B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE}, 600b843c749SSergey Zigachev {0x1002, 0x683D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE}, 601b843c749SSergey Zigachev {0x1002, 0x683F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE}, 602b843c749SSergey Zigachev {0x1002, 0x6660, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAINAN|AMD_IS_MOBILITY}, 603b843c749SSergey Zigachev {0x1002, 0x6663, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAINAN|AMD_IS_MOBILITY}, 604b843c749SSergey Zigachev {0x1002, 0x6664, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAINAN|AMD_IS_MOBILITY}, 605b843c749SSergey Zigachev {0x1002, 0x6665, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAINAN|AMD_IS_MOBILITY}, 606b843c749SSergey Zigachev {0x1002, 0x6667, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAINAN|AMD_IS_MOBILITY}, 607b843c749SSergey Zigachev {0x1002, 0x666F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAINAN|AMD_IS_MOBILITY}, 608b843c749SSergey Zigachev #endif 609b843c749SSergey Zigachev #ifdef CONFIG_DRM_AMDGPU_CIK 610b843c749SSergey Zigachev /* Kaveri */ 611b843c749SSergey Zigachev {0x1002, 0x1304, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|AMD_IS_MOBILITY|AMD_IS_APU}, 612b843c749SSergey Zigachev {0x1002, 0x1305, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|AMD_IS_APU}, 613b843c749SSergey Zigachev {0x1002, 0x1306, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|AMD_IS_MOBILITY|AMD_IS_APU}, 614b843c749SSergey Zigachev {0x1002, 0x1307, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|AMD_IS_APU}, 615b843c749SSergey Zigachev {0x1002, 0x1309, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|AMD_IS_MOBILITY|AMD_IS_APU}, 616b843c749SSergey Zigachev {0x1002, 0x130A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|AMD_IS_MOBILITY|AMD_IS_APU}, 617b843c749SSergey Zigachev {0x1002, 0x130B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|AMD_IS_MOBILITY|AMD_IS_APU}, 618b843c749SSergey Zigachev {0x1002, 0x130C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|AMD_IS_MOBILITY|AMD_IS_APU}, 619b843c749SSergey Zigachev {0x1002, 0x130D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|AMD_IS_MOBILITY|AMD_IS_APU}, 620b843c749SSergey Zigachev {0x1002, 0x130E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|AMD_IS_MOBILITY|AMD_IS_APU}, 621b843c749SSergey Zigachev {0x1002, 0x130F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|AMD_IS_APU}, 622b843c749SSergey Zigachev {0x1002, 0x1310, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|AMD_IS_APU}, 623b843c749SSergey Zigachev {0x1002, 0x1311, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|AMD_IS_APU}, 624b843c749SSergey Zigachev {0x1002, 0x1312, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|AMD_IS_APU}, 625b843c749SSergey Zigachev {0x1002, 0x1313, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|AMD_IS_APU}, 626b843c749SSergey Zigachev {0x1002, 0x1315, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|AMD_IS_APU}, 627b843c749SSergey Zigachev {0x1002, 0x1316, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|AMD_IS_APU}, 628b843c749SSergey Zigachev {0x1002, 0x1317, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|AMD_IS_MOBILITY|AMD_IS_APU}, 629b843c749SSergey Zigachev {0x1002, 0x1318, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|AMD_IS_MOBILITY|AMD_IS_APU}, 630b843c749SSergey Zigachev {0x1002, 0x131B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|AMD_IS_APU}, 631b843c749SSergey Zigachev {0x1002, 0x131C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|AMD_IS_APU}, 632b843c749SSergey Zigachev {0x1002, 0x131D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|AMD_IS_APU}, 633b843c749SSergey Zigachev /* Bonaire */ 634b843c749SSergey Zigachev {0x1002, 0x6640, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|AMD_IS_MOBILITY}, 635b843c749SSergey Zigachev {0x1002, 0x6641, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|AMD_IS_MOBILITY}, 636b843c749SSergey Zigachev {0x1002, 0x6646, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|AMD_IS_MOBILITY}, 637b843c749SSergey Zigachev {0x1002, 0x6647, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|AMD_IS_MOBILITY}, 638b843c749SSergey Zigachev {0x1002, 0x6649, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE}, 639b843c749SSergey Zigachev {0x1002, 0x6650, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE}, 640b843c749SSergey Zigachev {0x1002, 0x6651, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE}, 641b843c749SSergey Zigachev {0x1002, 0x6658, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE}, 642b843c749SSergey Zigachev {0x1002, 0x665c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE}, 643b843c749SSergey Zigachev {0x1002, 0x665d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE}, 644b843c749SSergey Zigachev {0x1002, 0x665f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE}, 645b843c749SSergey Zigachev /* Hawaii */ 646b843c749SSergey Zigachev {0x1002, 0x67A0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII}, 647b843c749SSergey Zigachev {0x1002, 0x67A1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII}, 648b843c749SSergey Zigachev {0x1002, 0x67A2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII}, 649b843c749SSergey Zigachev {0x1002, 0x67A8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII}, 650b843c749SSergey Zigachev {0x1002, 0x67A9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII}, 651b843c749SSergey Zigachev {0x1002, 0x67AA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII}, 652b843c749SSergey Zigachev {0x1002, 0x67B0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII}, 653b843c749SSergey Zigachev {0x1002, 0x67B1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII}, 654b843c749SSergey Zigachev {0x1002, 0x67B8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII}, 655b843c749SSergey Zigachev {0x1002, 0x67B9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII}, 656b843c749SSergey Zigachev {0x1002, 0x67BA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII}, 657b843c749SSergey Zigachev {0x1002, 0x67BE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII}, 658b843c749SSergey Zigachev /* Kabini */ 659b843c749SSergey Zigachev {0x1002, 0x9830, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|AMD_IS_MOBILITY|AMD_IS_APU}, 660b843c749SSergey Zigachev {0x1002, 0x9831, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|AMD_IS_APU}, 661b843c749SSergey Zigachev {0x1002, 0x9832, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|AMD_IS_MOBILITY|AMD_IS_APU}, 662b843c749SSergey Zigachev {0x1002, 0x9833, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|AMD_IS_APU}, 663b843c749SSergey Zigachev {0x1002, 0x9834, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|AMD_IS_MOBILITY|AMD_IS_APU}, 664b843c749SSergey Zigachev {0x1002, 0x9835, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|AMD_IS_APU}, 665b843c749SSergey Zigachev {0x1002, 0x9836, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|AMD_IS_MOBILITY|AMD_IS_APU}, 666b843c749SSergey Zigachev {0x1002, 0x9837, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|AMD_IS_APU}, 667b843c749SSergey Zigachev {0x1002, 0x9838, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|AMD_IS_MOBILITY|AMD_IS_APU}, 668b843c749SSergey Zigachev {0x1002, 0x9839, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|AMD_IS_MOBILITY|AMD_IS_APU}, 669b843c749SSergey Zigachev {0x1002, 0x983a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|AMD_IS_APU}, 670b843c749SSergey Zigachev {0x1002, 0x983b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|AMD_IS_MOBILITY|AMD_IS_APU}, 671b843c749SSergey Zigachev {0x1002, 0x983c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|AMD_IS_APU}, 672b843c749SSergey Zigachev {0x1002, 0x983d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|AMD_IS_APU}, 673b843c749SSergey Zigachev {0x1002, 0x983e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|AMD_IS_APU}, 674b843c749SSergey Zigachev {0x1002, 0x983f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|AMD_IS_APU}, 675b843c749SSergey Zigachev /* mullins */ 676b843c749SSergey Zigachev {0x1002, 0x9850, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|AMD_IS_MOBILITY|AMD_IS_APU}, 677b843c749SSergey Zigachev {0x1002, 0x9851, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|AMD_IS_MOBILITY|AMD_IS_APU}, 678b843c749SSergey Zigachev {0x1002, 0x9852, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|AMD_IS_MOBILITY|AMD_IS_APU}, 679b843c749SSergey Zigachev {0x1002, 0x9853, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|AMD_IS_MOBILITY|AMD_IS_APU}, 680b843c749SSergey Zigachev {0x1002, 0x9854, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|AMD_IS_MOBILITY|AMD_IS_APU}, 681b843c749SSergey Zigachev {0x1002, 0x9855, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|AMD_IS_MOBILITY|AMD_IS_APU}, 682b843c749SSergey Zigachev {0x1002, 0x9856, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|AMD_IS_MOBILITY|AMD_IS_APU}, 683b843c749SSergey Zigachev {0x1002, 0x9857, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|AMD_IS_MOBILITY|AMD_IS_APU}, 684b843c749SSergey Zigachev {0x1002, 0x9858, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|AMD_IS_MOBILITY|AMD_IS_APU}, 685b843c749SSergey Zigachev {0x1002, 0x9859, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|AMD_IS_MOBILITY|AMD_IS_APU}, 686b843c749SSergey Zigachev {0x1002, 0x985A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|AMD_IS_MOBILITY|AMD_IS_APU}, 687b843c749SSergey Zigachev {0x1002, 0x985B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|AMD_IS_MOBILITY|AMD_IS_APU}, 688b843c749SSergey Zigachev {0x1002, 0x985C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|AMD_IS_MOBILITY|AMD_IS_APU}, 689b843c749SSergey Zigachev {0x1002, 0x985D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|AMD_IS_MOBILITY|AMD_IS_APU}, 690b843c749SSergey Zigachev {0x1002, 0x985E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|AMD_IS_MOBILITY|AMD_IS_APU}, 691b843c749SSergey Zigachev {0x1002, 0x985F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|AMD_IS_MOBILITY|AMD_IS_APU}, 692b843c749SSergey Zigachev #endif 693b843c749SSergey Zigachev /* topaz */ 694b843c749SSergey Zigachev {0x1002, 0x6900, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TOPAZ}, 695b843c749SSergey Zigachev {0x1002, 0x6901, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TOPAZ}, 696b843c749SSergey Zigachev {0x1002, 0x6902, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TOPAZ}, 697b843c749SSergey Zigachev {0x1002, 0x6903, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TOPAZ}, 698b843c749SSergey Zigachev {0x1002, 0x6907, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TOPAZ}, 699b843c749SSergey Zigachev /* tonga */ 700b843c749SSergey Zigachev {0x1002, 0x6920, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TONGA}, 701b843c749SSergey Zigachev {0x1002, 0x6921, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TONGA}, 702b843c749SSergey Zigachev {0x1002, 0x6928, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TONGA}, 703b843c749SSergey Zigachev {0x1002, 0x6929, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TONGA}, 704b843c749SSergey Zigachev {0x1002, 0x692B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TONGA}, 705b843c749SSergey Zigachev {0x1002, 0x692F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TONGA}, 706b843c749SSergey Zigachev {0x1002, 0x6930, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TONGA}, 707b843c749SSergey Zigachev {0x1002, 0x6938, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TONGA}, 708b843c749SSergey Zigachev {0x1002, 0x6939, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TONGA}, 709b843c749SSergey Zigachev /* fiji */ 710b843c749SSergey Zigachev {0x1002, 0x7300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_FIJI}, 711b843c749SSergey Zigachev {0x1002, 0x730F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_FIJI}, 712b843c749SSergey Zigachev /* carrizo */ 713b843c749SSergey Zigachev {0x1002, 0x9870, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CARRIZO|AMD_IS_APU}, 714b843c749SSergey Zigachev {0x1002, 0x9874, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CARRIZO|AMD_IS_APU}, 715b843c749SSergey Zigachev {0x1002, 0x9875, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CARRIZO|AMD_IS_APU}, 716b843c749SSergey Zigachev {0x1002, 0x9876, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CARRIZO|AMD_IS_APU}, 717b843c749SSergey Zigachev {0x1002, 0x9877, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CARRIZO|AMD_IS_APU}, 718b843c749SSergey Zigachev /* stoney */ 719b843c749SSergey Zigachev {0x1002, 0x98E4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_STONEY|AMD_IS_APU}, 720b843c749SSergey Zigachev /* Polaris11 */ 721b843c749SSergey Zigachev {0x1002, 0x67E0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS11}, 722b843c749SSergey Zigachev {0x1002, 0x67E3, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS11}, 723b843c749SSergey Zigachev {0x1002, 0x67E8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS11}, 724b843c749SSergey Zigachev {0x1002, 0x67EB, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS11}, 725b843c749SSergey Zigachev {0x1002, 0x67EF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS11}, 726b843c749SSergey Zigachev {0x1002, 0x67FF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS11}, 727b843c749SSergey Zigachev {0x1002, 0x67E1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS11}, 728b843c749SSergey Zigachev {0x1002, 0x67E7, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS11}, 729b843c749SSergey Zigachev {0x1002, 0x67E9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS11}, 730b843c749SSergey Zigachev /* Polaris10 */ 731b843c749SSergey Zigachev {0x1002, 0x67C0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS10}, 732b843c749SSergey Zigachev {0x1002, 0x67C1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS10}, 733b843c749SSergey Zigachev {0x1002, 0x67C2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS10}, 734b843c749SSergey Zigachev {0x1002, 0x67C4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS10}, 735b843c749SSergey Zigachev {0x1002, 0x67C7, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS10}, 736b843c749SSergey Zigachev {0x1002, 0x67D0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS10}, 737b843c749SSergey Zigachev {0x1002, 0x67DF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS10}, 738b843c749SSergey Zigachev {0x1002, 0x67C8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS10}, 739b843c749SSergey Zigachev {0x1002, 0x67C9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS10}, 740b843c749SSergey Zigachev {0x1002, 0x67CA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS10}, 741b843c749SSergey Zigachev {0x1002, 0x67CC, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS10}, 742b843c749SSergey Zigachev {0x1002, 0x67CF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS10}, 743b843c749SSergey Zigachev {0x1002, 0x6FDF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS10}, 744b843c749SSergey Zigachev /* Polaris12 */ 745b843c749SSergey Zigachev {0x1002, 0x6980, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12}, 746b843c749SSergey Zigachev {0x1002, 0x6981, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12}, 747b843c749SSergey Zigachev {0x1002, 0x6985, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12}, 748b843c749SSergey Zigachev {0x1002, 0x6986, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12}, 749b843c749SSergey Zigachev {0x1002, 0x6987, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12}, 750b843c749SSergey Zigachev {0x1002, 0x6995, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12}, 751b843c749SSergey Zigachev {0x1002, 0x6997, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12}, 752b843c749SSergey Zigachev {0x1002, 0x699F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12}, 753b843c749SSergey Zigachev /* VEGAM */ 754b843c749SSergey Zigachev {0x1002, 0x694C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGAM}, 755b843c749SSergey Zigachev {0x1002, 0x694E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGAM}, 756b843c749SSergey Zigachev {0x1002, 0x694F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGAM}, 757b843c749SSergey Zigachev /* Vega 10 */ 758b843c749SSergey Zigachev {0x1002, 0x6860, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA10}, 759b843c749SSergey Zigachev {0x1002, 0x6861, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA10}, 760b843c749SSergey Zigachev {0x1002, 0x6862, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA10}, 761b843c749SSergey Zigachev {0x1002, 0x6863, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA10}, 762b843c749SSergey Zigachev {0x1002, 0x6864, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA10}, 763b843c749SSergey Zigachev {0x1002, 0x6867, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA10}, 764b843c749SSergey Zigachev {0x1002, 0x6868, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA10}, 765b843c749SSergey Zigachev {0x1002, 0x6869, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA10}, 766b843c749SSergey Zigachev {0x1002, 0x686a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA10}, 767b843c749SSergey Zigachev {0x1002, 0x686b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA10}, 768b843c749SSergey Zigachev {0x1002, 0x686c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA10}, 769b843c749SSergey Zigachev {0x1002, 0x686d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA10}, 770b843c749SSergey Zigachev {0x1002, 0x686e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA10}, 771b843c749SSergey Zigachev {0x1002, 0x686f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA10}, 772b843c749SSergey Zigachev {0x1002, 0x687f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA10}, 773b843c749SSergey Zigachev /* Vega 12 */ 774b843c749SSergey Zigachev {0x1002, 0x69A0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA12}, 775b843c749SSergey Zigachev {0x1002, 0x69A1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA12}, 776b843c749SSergey Zigachev {0x1002, 0x69A2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA12}, 777b843c749SSergey Zigachev {0x1002, 0x69A3, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA12}, 778b843c749SSergey Zigachev {0x1002, 0x69AF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA12}, 779b843c749SSergey Zigachev /* Vega 20 */ 780b843c749SSergey Zigachev {0x1002, 0x66A0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA20|AMD_EXP_HW_SUPPORT}, 781b843c749SSergey Zigachev {0x1002, 0x66A1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA20|AMD_EXP_HW_SUPPORT}, 782b843c749SSergey Zigachev {0x1002, 0x66A2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA20|AMD_EXP_HW_SUPPORT}, 783b843c749SSergey Zigachev {0x1002, 0x66A3, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA20|AMD_EXP_HW_SUPPORT}, 784b843c749SSergey Zigachev {0x1002, 0x66A7, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA20|AMD_EXP_HW_SUPPORT}, 785b843c749SSergey Zigachev {0x1002, 0x66AF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA20|AMD_EXP_HW_SUPPORT}, 786b843c749SSergey Zigachev /* Raven */ 787b843c749SSergey Zigachev {0x1002, 0x15dd, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RAVEN|AMD_IS_APU}, 788b843c749SSergey Zigachev 789b843c749SSergey Zigachev {0, 0, 0} 790b843c749SSergey Zigachev }; 791b843c749SSergey Zigachev 792b843c749SSergey Zigachev MODULE_DEVICE_TABLE(pci, pciidlist); 793b843c749SSergey Zigachev 794b843c749SSergey Zigachev static struct drm_driver kms_driver; 795b843c749SSergey Zigachev 796b843c749SSergey Zigachev static int amdgpu_kick_out_firmware_fb(struct pci_dev *pdev) 797b843c749SSergey Zigachev { 798*78973132SSergey Zigachev #if 0 799b843c749SSergey Zigachev struct apertures_struct *ap; 800b843c749SSergey Zigachev bool primary = false; 801b843c749SSergey Zigachev 802b843c749SSergey Zigachev ap = alloc_apertures(1); 803b843c749SSergey Zigachev if (!ap) 804b843c749SSergey Zigachev return -ENOMEM; 805b843c749SSergey Zigachev 806b843c749SSergey Zigachev ap->ranges[0].base = pci_resource_start(pdev, 0); 807b843c749SSergey Zigachev ap->ranges[0].size = pci_resource_len(pdev, 0); 808b843c749SSergey Zigachev 809b843c749SSergey Zigachev #ifdef CONFIG_X86 810b843c749SSergey Zigachev primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW; 811b843c749SSergey Zigachev #endif 812b843c749SSergey Zigachev drm_fb_helper_remove_conflicting_framebuffers(ap, "amdgpudrmfb", primary); 813b843c749SSergey Zigachev kfree(ap); 814*78973132SSergey Zigachev #endif 815b843c749SSergey Zigachev 816b843c749SSergey Zigachev return 0; 817b843c749SSergey Zigachev } 818b843c749SSergey Zigachev 819b843c749SSergey Zigachev 820b843c749SSergey Zigachev static int amdgpu_pci_probe(struct pci_dev *pdev, 821b843c749SSergey Zigachev const struct pci_device_id *ent) 822b843c749SSergey Zigachev { 823b843c749SSergey Zigachev struct drm_device *dev; 824b843c749SSergey Zigachev unsigned long flags = ent->driver_data; 825b843c749SSergey Zigachev int ret, retry = 0; 826b843c749SSergey Zigachev bool supports_atomic = false; 827b843c749SSergey Zigachev 828b843c749SSergey Zigachev if (!amdgpu_virtual_display && 829b843c749SSergey Zigachev amdgpu_device_asic_has_dc_support(flags & AMD_ASIC_MASK)) 830b843c749SSergey Zigachev supports_atomic = true; 831b843c749SSergey Zigachev 832b843c749SSergey Zigachev if ((flags & AMD_EXP_HW_SUPPORT) && !amdgpu_exp_hw_support) { 833b843c749SSergey Zigachev DRM_INFO("This hardware requires experimental hardware support.\n" 834b843c749SSergey Zigachev "See modparam exp_hw_support\n"); 835b843c749SSergey Zigachev return -ENODEV; 836b843c749SSergey Zigachev } 837b843c749SSergey Zigachev 838b843c749SSergey Zigachev /* 839b843c749SSergey Zigachev * Initialize amdkfd before starting radeon. If it was not loaded yet, 840b843c749SSergey Zigachev * defer radeon probing 841b843c749SSergey Zigachev */ 842*78973132SSergey Zigachev #if 0 843b843c749SSergey Zigachev ret = amdgpu_amdkfd_init(); 844b843c749SSergey Zigachev if (ret == -EPROBE_DEFER) 845b843c749SSergey Zigachev return ret; 846*78973132SSergey Zigachev #endif 847b843c749SSergey Zigachev 848b843c749SSergey Zigachev #ifdef CONFIG_DRM_AMDGPU_SI 849b843c749SSergey Zigachev if (!amdgpu_si_support) { 850b843c749SSergey Zigachev switch (flags & AMD_ASIC_MASK) { 851b843c749SSergey Zigachev case CHIP_TAHITI: 852b843c749SSergey Zigachev case CHIP_PITCAIRN: 853b843c749SSergey Zigachev case CHIP_VERDE: 854b843c749SSergey Zigachev case CHIP_OLAND: 855b843c749SSergey Zigachev case CHIP_HAINAN: 856b843c749SSergey Zigachev dev_info(&pdev->dev, 857b843c749SSergey Zigachev "SI support provided by radeon.\n"); 858b843c749SSergey Zigachev dev_info(&pdev->dev, 859b843c749SSergey Zigachev "Use radeon.si_support=0 amdgpu.si_support=1 to override.\n" 860b843c749SSergey Zigachev ); 861b843c749SSergey Zigachev return -ENODEV; 862b843c749SSergey Zigachev } 863b843c749SSergey Zigachev } 864b843c749SSergey Zigachev #endif 865b843c749SSergey Zigachev #ifdef CONFIG_DRM_AMDGPU_CIK 866b843c749SSergey Zigachev if (!amdgpu_cik_support) { 867b843c749SSergey Zigachev switch (flags & AMD_ASIC_MASK) { 868b843c749SSergey Zigachev case CHIP_KAVERI: 869b843c749SSergey Zigachev case CHIP_BONAIRE: 870b843c749SSergey Zigachev case CHIP_HAWAII: 871b843c749SSergey Zigachev case CHIP_KABINI: 872b843c749SSergey Zigachev case CHIP_MULLINS: 873b843c749SSergey Zigachev dev_info(&pdev->dev, 874b843c749SSergey Zigachev "CIK support provided by radeon.\n"); 875b843c749SSergey Zigachev dev_info(&pdev->dev, 876b843c749SSergey Zigachev "Use radeon.cik_support=0 amdgpu.cik_support=1 to override.\n" 877b843c749SSergey Zigachev ); 878b843c749SSergey Zigachev return -ENODEV; 879b843c749SSergey Zigachev } 880b843c749SSergey Zigachev } 881b843c749SSergey Zigachev #endif 882b843c749SSergey Zigachev 883b843c749SSergey Zigachev /* Get rid of things like offb */ 884b843c749SSergey Zigachev ret = amdgpu_kick_out_firmware_fb(pdev); 885b843c749SSergey Zigachev if (ret) 886b843c749SSergey Zigachev return ret; 887b843c749SSergey Zigachev 888b843c749SSergey Zigachev /* warn the user if they mix atomic and non-atomic capable GPUs */ 889b843c749SSergey Zigachev if ((kms_driver.driver_features & DRIVER_ATOMIC) && !supports_atomic) 890b843c749SSergey Zigachev DRM_ERROR("Mixing atomic and non-atomic capable GPUs!\n"); 891b843c749SSergey Zigachev /* support atomic early so the atomic debugfs stuff gets created */ 892b843c749SSergey Zigachev if (supports_atomic) 893b843c749SSergey Zigachev kms_driver.driver_features |= DRIVER_ATOMIC; 894b843c749SSergey Zigachev 895b843c749SSergey Zigachev dev = drm_dev_alloc(&kms_driver, &pdev->dev); 896b843c749SSergey Zigachev if (IS_ERR(dev)) 897b843c749SSergey Zigachev return PTR_ERR(dev); 898b843c749SSergey Zigachev 899b843c749SSergey Zigachev ret = pci_enable_device(pdev); 900b843c749SSergey Zigachev if (ret) 901b843c749SSergey Zigachev goto err_free; 902b843c749SSergey Zigachev 903b843c749SSergey Zigachev dev->pdev = pdev; 904b843c749SSergey Zigachev 905b843c749SSergey Zigachev pci_set_drvdata(pdev, dev); 906b843c749SSergey Zigachev 907b843c749SSergey Zigachev retry_init: 908b843c749SSergey Zigachev ret = drm_dev_register(dev, ent->driver_data); 909b843c749SSergey Zigachev if (ret == -EAGAIN && ++retry <= 3) { 910b843c749SSergey Zigachev DRM_INFO("retry init %d\n", retry); 911b843c749SSergey Zigachev /* Don't request EX mode too frequently which is attacking */ 912b843c749SSergey Zigachev msleep(5000); 913b843c749SSergey Zigachev goto retry_init; 914b843c749SSergey Zigachev } else if (ret) 915b843c749SSergey Zigachev goto err_pci; 916b843c749SSergey Zigachev 917b843c749SSergey Zigachev return 0; 918b843c749SSergey Zigachev 919b843c749SSergey Zigachev err_pci: 920b843c749SSergey Zigachev pci_disable_device(pdev); 921b843c749SSergey Zigachev err_free: 922b843c749SSergey Zigachev drm_dev_put(dev); 923b843c749SSergey Zigachev return ret; 924b843c749SSergey Zigachev } 925b843c749SSergey Zigachev 926*78973132SSergey Zigachev #ifdef __DragonFly__ 927*78973132SSergey Zigachev const struct pci_device_id *ent; /* XXX hack */ 928*78973132SSergey Zigachev 929*78973132SSergey Zigachev static int 930*78973132SSergey Zigachev amdgpu_pci_probe_dfly(device_t kdev) 931*78973132SSergey Zigachev { 932*78973132SSergey Zigachev int device, i = 0; 933*78973132SSergey Zigachev 934*78973132SSergey Zigachev if (pci_get_class(kdev) != PCIC_DISPLAY) 935*78973132SSergey Zigachev return ENXIO; 936*78973132SSergey Zigachev 937*78973132SSergey Zigachev if (pci_get_vendor(kdev) != PCI_VENDOR_ID_ATI) 938*78973132SSergey Zigachev return ENXIO; 939*78973132SSergey Zigachev 940*78973132SSergey Zigachev device = pci_get_device(kdev); 941*78973132SSergey Zigachev 942*78973132SSergey Zigachev for (i = 0; pciidlist[i].device != 0; i++) { 943*78973132SSergey Zigachev if (pciidlist[i].device == device) { 944*78973132SSergey Zigachev ent = &pciidlist[i]; 945*78973132SSergey Zigachev goto found; 946*78973132SSergey Zigachev } 947*78973132SSergey Zigachev } 948*78973132SSergey Zigachev 949*78973132SSergey Zigachev return ENXIO; 950*78973132SSergey Zigachev found: 951*78973132SSergey Zigachev return 0; 952*78973132SSergey Zigachev } 953*78973132SSergey Zigachev 954*78973132SSergey Zigachev static int 955*78973132SSergey Zigachev amdgpu_attach_dfly(device_t kdev) 956*78973132SSergey Zigachev { 957*78973132SSergey Zigachev struct pci_dev *pdev = NULL; 958*78973132SSergey Zigachev static device_t bsddev; 959*78973132SSergey Zigachev 960*78973132SSergey Zigachev if (!strcmp(device_get_name(kdev), "drmsub")) 961*78973132SSergey Zigachev bsddev = device_get_parent(kdev); 962*78973132SSergey Zigachev else 963*78973132SSergey Zigachev bsddev = kdev; 964*78973132SSergey Zigachev 965*78973132SSergey Zigachev drm_init_pdev(bsddev, &pdev); 966*78973132SSergey Zigachev 967*78973132SSergey Zigachev /* Print the contents of pdev struct. */ 968*78973132SSergey Zigachev drm_print_pdev(pdev); 969*78973132SSergey Zigachev 970*78973132SSergey Zigachev /* 971*78973132SSergey Zigachev The device_probe function can be called multiple times on DragonFly 972*78973132SSergey Zigachev and amdgpu_pci_probe() is supposed to be called only once. 973*78973132SSergey Zigachev Call it from the DragonFly device_attach function. 974*78973132SSergey Zigachev */ 975*78973132SSergey Zigachev return amdgpu_pci_probe(pdev, ent); 976*78973132SSergey Zigachev 977*78973132SSergey Zigachev return 0; 978*78973132SSergey Zigachev } 979*78973132SSergey Zigachev #endif 980*78973132SSergey Zigachev 981*78973132SSergey Zigachev #if 0 982b843c749SSergey Zigachev static void 983b843c749SSergey Zigachev amdgpu_pci_remove(struct pci_dev *pdev) 984b843c749SSergey Zigachev { 985b843c749SSergey Zigachev struct drm_device *dev = pci_get_drvdata(pdev); 986b843c749SSergey Zigachev 987b843c749SSergey Zigachev drm_dev_unregister(dev); 988b843c749SSergey Zigachev drm_dev_put(dev); 989b843c749SSergey Zigachev pci_disable_device(pdev); 990b843c749SSergey Zigachev pci_set_drvdata(pdev, NULL); 991b843c749SSergey Zigachev } 992b843c749SSergey Zigachev 993b843c749SSergey Zigachev static void 994b843c749SSergey Zigachev amdgpu_pci_shutdown(struct pci_dev *pdev) 995b843c749SSergey Zigachev { 996b843c749SSergey Zigachev struct drm_device *dev = pci_get_drvdata(pdev); 997b843c749SSergey Zigachev struct amdgpu_device *adev = dev->dev_private; 998b843c749SSergey Zigachev 999b843c749SSergey Zigachev /* if we are running in a VM, make sure the device 1000b843c749SSergey Zigachev * torn down properly on reboot/shutdown. 1001b843c749SSergey Zigachev * unfortunately we can't detect certain 1002b843c749SSergey Zigachev * hypervisors so just do this all the time. 1003b843c749SSergey Zigachev */ 1004b843c749SSergey Zigachev amdgpu_device_ip_suspend(adev); 1005b843c749SSergey Zigachev } 1006b843c749SSergey Zigachev 1007b843c749SSergey Zigachev static int amdgpu_pmops_suspend(struct device *dev) 1008b843c749SSergey Zigachev { 1009b843c749SSergey Zigachev struct pci_dev *pdev = to_pci_dev(dev); 1010b843c749SSergey Zigachev 1011b843c749SSergey Zigachev struct drm_device *drm_dev = pci_get_drvdata(pdev); 1012b843c749SSergey Zigachev return amdgpu_device_suspend(drm_dev, true, true); 1013b843c749SSergey Zigachev } 1014b843c749SSergey Zigachev 1015b843c749SSergey Zigachev static int amdgpu_pmops_resume(struct device *dev) 1016b843c749SSergey Zigachev { 1017b843c749SSergey Zigachev struct pci_dev *pdev = to_pci_dev(dev); 1018b843c749SSergey Zigachev struct drm_device *drm_dev = pci_get_drvdata(pdev); 1019b843c749SSergey Zigachev 1020b843c749SSergey Zigachev /* GPU comes up enabled by the bios on resume */ 1021b843c749SSergey Zigachev if (amdgpu_device_is_px(drm_dev)) { 1022b843c749SSergey Zigachev pm_runtime_disable(dev); 1023b843c749SSergey Zigachev pm_runtime_set_active(dev); 1024b843c749SSergey Zigachev pm_runtime_enable(dev); 1025b843c749SSergey Zigachev } 1026b843c749SSergey Zigachev 1027b843c749SSergey Zigachev return amdgpu_device_resume(drm_dev, true, true); 1028b843c749SSergey Zigachev } 1029b843c749SSergey Zigachev 1030b843c749SSergey Zigachev static int amdgpu_pmops_freeze(struct device *dev) 1031b843c749SSergey Zigachev { 1032b843c749SSergey Zigachev struct pci_dev *pdev = to_pci_dev(dev); 1033b843c749SSergey Zigachev 1034b843c749SSergey Zigachev struct drm_device *drm_dev = pci_get_drvdata(pdev); 1035b843c749SSergey Zigachev return amdgpu_device_suspend(drm_dev, false, true); 1036b843c749SSergey Zigachev } 1037b843c749SSergey Zigachev 1038b843c749SSergey Zigachev static int amdgpu_pmops_thaw(struct device *dev) 1039b843c749SSergey Zigachev { 1040b843c749SSergey Zigachev struct pci_dev *pdev = to_pci_dev(dev); 1041b843c749SSergey Zigachev 1042b843c749SSergey Zigachev struct drm_device *drm_dev = pci_get_drvdata(pdev); 1043b843c749SSergey Zigachev return amdgpu_device_resume(drm_dev, false, true); 1044b843c749SSergey Zigachev } 1045b843c749SSergey Zigachev 1046b843c749SSergey Zigachev static int amdgpu_pmops_poweroff(struct device *dev) 1047b843c749SSergey Zigachev { 1048b843c749SSergey Zigachev struct pci_dev *pdev = to_pci_dev(dev); 1049b843c749SSergey Zigachev 1050b843c749SSergey Zigachev struct drm_device *drm_dev = pci_get_drvdata(pdev); 1051b843c749SSergey Zigachev return amdgpu_device_suspend(drm_dev, true, true); 1052b843c749SSergey Zigachev } 1053b843c749SSergey Zigachev 1054b843c749SSergey Zigachev static int amdgpu_pmops_restore(struct device *dev) 1055b843c749SSergey Zigachev { 1056b843c749SSergey Zigachev struct pci_dev *pdev = to_pci_dev(dev); 1057b843c749SSergey Zigachev 1058b843c749SSergey Zigachev struct drm_device *drm_dev = pci_get_drvdata(pdev); 1059b843c749SSergey Zigachev return amdgpu_device_resume(drm_dev, false, true); 1060b843c749SSergey Zigachev } 1061b843c749SSergey Zigachev 1062b843c749SSergey Zigachev static int amdgpu_pmops_runtime_suspend(struct device *dev) 1063b843c749SSergey Zigachev { 1064b843c749SSergey Zigachev struct pci_dev *pdev = to_pci_dev(dev); 1065b843c749SSergey Zigachev struct drm_device *drm_dev = pci_get_drvdata(pdev); 1066b843c749SSergey Zigachev int ret; 1067b843c749SSergey Zigachev 1068b843c749SSergey Zigachev if (!amdgpu_device_is_px(drm_dev)) { 1069b843c749SSergey Zigachev pm_runtime_forbid(dev); 1070b843c749SSergey Zigachev return -EBUSY; 1071b843c749SSergey Zigachev } 1072b843c749SSergey Zigachev 1073b843c749SSergey Zigachev drm_dev->switch_power_state = DRM_SWITCH_POWER_CHANGING; 1074b843c749SSergey Zigachev drm_kms_helper_poll_disable(drm_dev); 1075b843c749SSergey Zigachev 1076b843c749SSergey Zigachev ret = amdgpu_device_suspend(drm_dev, false, false); 1077b843c749SSergey Zigachev pci_save_state(pdev); 1078b843c749SSergey Zigachev pci_disable_device(pdev); 1079b843c749SSergey Zigachev pci_ignore_hotplug(pdev); 1080b843c749SSergey Zigachev if (amdgpu_is_atpx_hybrid()) 1081b843c749SSergey Zigachev pci_set_power_state(pdev, PCI_D3cold); 1082b843c749SSergey Zigachev else if (!amdgpu_has_atpx_dgpu_power_cntl()) 1083b843c749SSergey Zigachev pci_set_power_state(pdev, PCI_D3hot); 1084b843c749SSergey Zigachev drm_dev->switch_power_state = DRM_SWITCH_POWER_DYNAMIC_OFF; 1085b843c749SSergey Zigachev 1086b843c749SSergey Zigachev return 0; 1087b843c749SSergey Zigachev } 1088b843c749SSergey Zigachev 1089b843c749SSergey Zigachev static int amdgpu_pmops_runtime_resume(struct device *dev) 1090b843c749SSergey Zigachev { 1091b843c749SSergey Zigachev struct pci_dev *pdev = to_pci_dev(dev); 1092b843c749SSergey Zigachev struct drm_device *drm_dev = pci_get_drvdata(pdev); 1093b843c749SSergey Zigachev int ret; 1094b843c749SSergey Zigachev 1095b843c749SSergey Zigachev if (!amdgpu_device_is_px(drm_dev)) 1096b843c749SSergey Zigachev return -EINVAL; 1097b843c749SSergey Zigachev 1098b843c749SSergey Zigachev drm_dev->switch_power_state = DRM_SWITCH_POWER_CHANGING; 1099b843c749SSergey Zigachev 1100b843c749SSergey Zigachev if (amdgpu_is_atpx_hybrid() || 1101b843c749SSergey Zigachev !amdgpu_has_atpx_dgpu_power_cntl()) 1102b843c749SSergey Zigachev pci_set_power_state(pdev, PCI_D0); 1103b843c749SSergey Zigachev pci_restore_state(pdev); 1104b843c749SSergey Zigachev ret = pci_enable_device(pdev); 1105b843c749SSergey Zigachev if (ret) 1106b843c749SSergey Zigachev return ret; 1107b843c749SSergey Zigachev pci_set_master(pdev); 1108b843c749SSergey Zigachev 1109b843c749SSergey Zigachev ret = amdgpu_device_resume(drm_dev, false, false); 1110b843c749SSergey Zigachev drm_kms_helper_poll_enable(drm_dev); 1111b843c749SSergey Zigachev drm_dev->switch_power_state = DRM_SWITCH_POWER_ON; 1112b843c749SSergey Zigachev return 0; 1113b843c749SSergey Zigachev } 1114b843c749SSergey Zigachev 1115b843c749SSergey Zigachev static int amdgpu_pmops_runtime_idle(struct device *dev) 1116b843c749SSergey Zigachev { 1117b843c749SSergey Zigachev struct pci_dev *pdev = to_pci_dev(dev); 1118b843c749SSergey Zigachev struct drm_device *drm_dev = pci_get_drvdata(pdev); 1119b843c749SSergey Zigachev struct drm_crtc *crtc; 1120b843c749SSergey Zigachev 1121b843c749SSergey Zigachev if (!amdgpu_device_is_px(drm_dev)) { 1122b843c749SSergey Zigachev pm_runtime_forbid(dev); 1123b843c749SSergey Zigachev return -EBUSY; 1124b843c749SSergey Zigachev } 1125b843c749SSergey Zigachev 1126b843c749SSergey Zigachev list_for_each_entry(crtc, &drm_dev->mode_config.crtc_list, head) { 1127b843c749SSergey Zigachev if (crtc->enabled) { 1128b843c749SSergey Zigachev DRM_DEBUG_DRIVER("failing to power off - crtc active\n"); 1129b843c749SSergey Zigachev return -EBUSY; 1130b843c749SSergey Zigachev } 1131b843c749SSergey Zigachev } 1132b843c749SSergey Zigachev 1133b843c749SSergey Zigachev pm_runtime_mark_last_busy(dev); 1134b843c749SSergey Zigachev pm_runtime_autosuspend(dev); 1135b843c749SSergey Zigachev /* we don't want the main rpm_idle to call suspend - we want to autosuspend */ 1136b843c749SSergey Zigachev return 1; 1137b843c749SSergey Zigachev } 1138b843c749SSergey Zigachev 1139b843c749SSergey Zigachev long amdgpu_drm_ioctl(struct file *filp, 1140b843c749SSergey Zigachev unsigned int cmd, unsigned long arg) 1141b843c749SSergey Zigachev { 1142b843c749SSergey Zigachev struct drm_file *file_priv = filp->private_data; 1143b843c749SSergey Zigachev struct drm_device *dev; 1144b843c749SSergey Zigachev long ret; 1145b843c749SSergey Zigachev dev = file_priv->minor->dev; 1146b843c749SSergey Zigachev ret = pm_runtime_get_sync(dev->dev); 1147b843c749SSergey Zigachev if (ret < 0) 1148b843c749SSergey Zigachev goto out; 1149b843c749SSergey Zigachev 1150b843c749SSergey Zigachev ret = drm_ioctl(filp, cmd, arg); 1151b843c749SSergey Zigachev 1152b843c749SSergey Zigachev pm_runtime_mark_last_busy(dev->dev); 1153b843c749SSergey Zigachev out: 1154b843c749SSergey Zigachev pm_runtime_put_autosuspend(dev->dev); 1155b843c749SSergey Zigachev return ret; 1156b843c749SSergey Zigachev } 1157b843c749SSergey Zigachev 1158b843c749SSergey Zigachev static const struct dev_pm_ops amdgpu_pm_ops = { 1159b843c749SSergey Zigachev .suspend = amdgpu_pmops_suspend, 1160b843c749SSergey Zigachev .resume = amdgpu_pmops_resume, 1161b843c749SSergey Zigachev .freeze = amdgpu_pmops_freeze, 1162b843c749SSergey Zigachev .thaw = amdgpu_pmops_thaw, 1163b843c749SSergey Zigachev .poweroff = amdgpu_pmops_poweroff, 1164b843c749SSergey Zigachev .restore = amdgpu_pmops_restore, 1165b843c749SSergey Zigachev .runtime_suspend = amdgpu_pmops_runtime_suspend, 1166b843c749SSergey Zigachev .runtime_resume = amdgpu_pmops_runtime_resume, 1167b843c749SSergey Zigachev .runtime_idle = amdgpu_pmops_runtime_idle, 1168b843c749SSergey Zigachev }; 1169*78973132SSergey Zigachev #endif 1170b843c749SSergey Zigachev 1171*78973132SSergey Zigachev #if 0 1172b843c749SSergey Zigachev static int amdgpu_flush(struct file *f, fl_owner_t id) 1173b843c749SSergey Zigachev { 1174b843c749SSergey Zigachev struct drm_file *file_priv = f->private_data; 1175b843c749SSergey Zigachev struct amdgpu_fpriv *fpriv = file_priv->driver_priv; 1176b843c749SSergey Zigachev 1177b843c749SSergey Zigachev amdgpu_ctx_mgr_entity_flush(&fpriv->ctx_mgr); 1178b843c749SSergey Zigachev 1179b843c749SSergey Zigachev return 0; 1180b843c749SSergey Zigachev } 1181*78973132SSergey Zigachev #endif 1182b843c749SSergey Zigachev 1183b843c749SSergey Zigachev 1184b843c749SSergey Zigachev static const struct file_operations amdgpu_driver_kms_fops = { 1185b843c749SSergey Zigachev .owner = THIS_MODULE, 1186*78973132SSergey Zigachev #if 0 1187b843c749SSergey Zigachev .open = drm_open, 1188b843c749SSergey Zigachev .flush = amdgpu_flush, 1189b843c749SSergey Zigachev .release = drm_release, 1190b843c749SSergey Zigachev .unlocked_ioctl = amdgpu_drm_ioctl, 1191b843c749SSergey Zigachev .mmap = amdgpu_mmap, 1192b843c749SSergey Zigachev .poll = drm_poll, 1193b843c749SSergey Zigachev .read = drm_read, 1194*78973132SSergey Zigachev #endif 1195b843c749SSergey Zigachev #ifdef CONFIG_COMPAT 1196b843c749SSergey Zigachev .compat_ioctl = amdgpu_kms_compat_ioctl, 1197b843c749SSergey Zigachev #endif 1198b843c749SSergey Zigachev }; 1199b843c749SSergey Zigachev 1200b843c749SSergey Zigachev static bool 1201b843c749SSergey Zigachev amdgpu_get_crtc_scanout_position(struct drm_device *dev, unsigned int pipe, 1202b843c749SSergey Zigachev bool in_vblank_irq, int *vpos, int *hpos, 1203b843c749SSergey Zigachev ktime_t *stime, ktime_t *etime, 1204b843c749SSergey Zigachev const struct drm_display_mode *mode) 1205b843c749SSergey Zigachev { 1206b843c749SSergey Zigachev return amdgpu_display_get_crtc_scanoutpos(dev, pipe, 0, vpos, hpos, 1207b843c749SSergey Zigachev stime, etime, mode); 1208b843c749SSergey Zigachev } 1209b843c749SSergey Zigachev 1210b843c749SSergey Zigachev static struct drm_driver kms_driver = { 1211b843c749SSergey Zigachev .driver_features = 1212b843c749SSergey Zigachev DRIVER_USE_AGP | 1213b843c749SSergey Zigachev DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_GEM | 1214b843c749SSergey Zigachev DRIVER_PRIME | DRIVER_RENDER | DRIVER_MODESET | DRIVER_SYNCOBJ, 1215b843c749SSergey Zigachev .load = amdgpu_driver_load_kms, 1216b843c749SSergey Zigachev .open = amdgpu_driver_open_kms, 1217b843c749SSergey Zigachev .postclose = amdgpu_driver_postclose_kms, 1218b843c749SSergey Zigachev .lastclose = amdgpu_driver_lastclose_kms, 1219b843c749SSergey Zigachev .unload = amdgpu_driver_unload_kms, 1220b843c749SSergey Zigachev .get_vblank_counter = amdgpu_get_vblank_counter_kms, 1221b843c749SSergey Zigachev .enable_vblank = amdgpu_enable_vblank_kms, 1222b843c749SSergey Zigachev .disable_vblank = amdgpu_disable_vblank_kms, 1223b843c749SSergey Zigachev .get_vblank_timestamp = drm_calc_vbltimestamp_from_scanoutpos, 1224b843c749SSergey Zigachev .get_scanout_position = amdgpu_get_crtc_scanout_position, 1225b843c749SSergey Zigachev .irq_handler = amdgpu_irq_handler, 1226b843c749SSergey Zigachev .ioctls = amdgpu_ioctls_kms, 1227b843c749SSergey Zigachev .gem_free_object_unlocked = amdgpu_gem_object_free, 1228b843c749SSergey Zigachev .gem_open_object = amdgpu_gem_object_open, 1229b843c749SSergey Zigachev .gem_close_object = amdgpu_gem_object_close, 1230b843c749SSergey Zigachev .dumb_create = amdgpu_mode_dumb_create, 1231b843c749SSergey Zigachev .dumb_map_offset = amdgpu_mode_dumb_mmap, 1232b843c749SSergey Zigachev .fops = &amdgpu_driver_kms_fops, 1233b843c749SSergey Zigachev 1234b843c749SSergey Zigachev .prime_handle_to_fd = drm_gem_prime_handle_to_fd, 1235b843c749SSergey Zigachev .prime_fd_to_handle = drm_gem_prime_fd_to_handle, 1236b843c749SSergey Zigachev .gem_prime_export = amdgpu_gem_prime_export, 1237b843c749SSergey Zigachev .gem_prime_import = amdgpu_gem_prime_import, 1238b843c749SSergey Zigachev .gem_prime_res_obj = amdgpu_gem_prime_res_obj, 1239b843c749SSergey Zigachev .gem_prime_get_sg_table = amdgpu_gem_prime_get_sg_table, 1240b843c749SSergey Zigachev .gem_prime_import_sg_table = amdgpu_gem_prime_import_sg_table, 1241b843c749SSergey Zigachev .gem_prime_vmap = amdgpu_gem_prime_vmap, 1242b843c749SSergey Zigachev .gem_prime_vunmap = amdgpu_gem_prime_vunmap, 1243b843c749SSergey Zigachev .gem_prime_mmap = amdgpu_gem_prime_mmap, 1244b843c749SSergey Zigachev 1245b843c749SSergey Zigachev .name = DRIVER_NAME, 1246b843c749SSergey Zigachev .desc = DRIVER_DESC, 1247b843c749SSergey Zigachev .date = DRIVER_DATE, 1248b843c749SSergey Zigachev .major = KMS_DRIVER_MAJOR, 1249b843c749SSergey Zigachev .minor = KMS_DRIVER_MINOR, 1250b843c749SSergey Zigachev .patchlevel = KMS_DRIVER_PATCHLEVEL, 1251b843c749SSergey Zigachev }; 1252b843c749SSergey Zigachev 1253b843c749SSergey Zigachev static struct drm_driver *driver; 1254b843c749SSergey Zigachev static struct pci_driver *pdriver; 1255b843c749SSergey Zigachev 1256b843c749SSergey Zigachev static struct pci_driver amdgpu_kms_pci_driver = { 1257*78973132SSergey Zigachev #if 0 1258b843c749SSergey Zigachev .name = DRIVER_NAME, 1259b843c749SSergey Zigachev .id_table = pciidlist, 1260b843c749SSergey Zigachev .probe = amdgpu_pci_probe, 1261b843c749SSergey Zigachev .remove = amdgpu_pci_remove, 1262b843c749SSergey Zigachev .shutdown = amdgpu_pci_shutdown, 1263b843c749SSergey Zigachev .driver.pm = &amdgpu_pm_ops, 1264*78973132SSergey Zigachev #endif 1265b843c749SSergey Zigachev }; 1266b843c749SSergey Zigachev 1267b843c749SSergey Zigachev 1268b843c749SSergey Zigachev 1269b843c749SSergey Zigachev static int __init amdgpu_init(void) 1270b843c749SSergey Zigachev { 1271b843c749SSergey Zigachev int r; 1272b843c749SSergey Zigachev 1273b843c749SSergey Zigachev if (vgacon_text_force()) { 1274b843c749SSergey Zigachev DRM_ERROR("VGACON disables amdgpu kernel modesetting.\n"); 1275b843c749SSergey Zigachev return -EINVAL; 1276b843c749SSergey Zigachev } 1277b843c749SSergey Zigachev 1278b843c749SSergey Zigachev r = amdgpu_sync_init(); 1279b843c749SSergey Zigachev if (r) 1280b843c749SSergey Zigachev goto error_sync; 1281b843c749SSergey Zigachev 1282b843c749SSergey Zigachev r = amdgpu_fence_slab_init(); 1283b843c749SSergey Zigachev if (r) 1284b843c749SSergey Zigachev goto error_fence; 1285b843c749SSergey Zigachev 1286b843c749SSergey Zigachev DRM_INFO("amdgpu kernel modesetting enabled.\n"); 1287b843c749SSergey Zigachev driver = &kms_driver; 1288b843c749SSergey Zigachev pdriver = &amdgpu_kms_pci_driver; 1289b843c749SSergey Zigachev driver->num_ioctls = amdgpu_max_kms_ioctl; 1290b843c749SSergey Zigachev amdgpu_register_atpx_handler(); 1291b843c749SSergey Zigachev /* let modprobe override vga console setting */ 1292b843c749SSergey Zigachev return pci_register_driver(pdriver); 1293b843c749SSergey Zigachev 1294b843c749SSergey Zigachev error_fence: 1295b843c749SSergey Zigachev amdgpu_sync_fini(); 1296b843c749SSergey Zigachev 1297b843c749SSergey Zigachev error_sync: 1298b843c749SSergey Zigachev return r; 1299b843c749SSergey Zigachev } 1300b843c749SSergey Zigachev 1301b843c749SSergey Zigachev static void __exit amdgpu_exit(void) 1302b843c749SSergey Zigachev { 1303b843c749SSergey Zigachev amdgpu_amdkfd_fini(); 1304b843c749SSergey Zigachev pci_unregister_driver(pdriver); 1305b843c749SSergey Zigachev amdgpu_unregister_atpx_handler(); 1306b843c749SSergey Zigachev amdgpu_sync_fini(); 1307b843c749SSergey Zigachev amdgpu_fence_slab_fini(); 1308b843c749SSergey Zigachev } 1309b843c749SSergey Zigachev 1310b843c749SSergey Zigachev module_init(amdgpu_init); 1311b843c749SSergey Zigachev module_exit(amdgpu_exit); 1312b843c749SSergey Zigachev 1313b843c749SSergey Zigachev MODULE_AUTHOR(DRIVER_AUTHOR); 1314b843c749SSergey Zigachev MODULE_DESCRIPTION(DRIVER_DESC); 1315b843c749SSergey Zigachev MODULE_LICENSE("GPL and additional rights"); 1316*78973132SSergey Zigachev 1317*78973132SSergey Zigachev #ifdef __DragonFly__ 1318*78973132SSergey Zigachev static device_method_t amdgpu_methods[] = { 1319*78973132SSergey Zigachev /* Device interface */ 1320*78973132SSergey Zigachev DEVMETHOD(device_probe, amdgpu_pci_probe_dfly), 1321*78973132SSergey Zigachev DEVMETHOD(device_attach, amdgpu_attach_dfly), 1322*78973132SSergey Zigachev #if 0 1323*78973132SSergey Zigachev DEVMETHOD(device_suspend, amdgpu_suspend_switcheroo), 1324*78973132SSergey Zigachev DEVMETHOD(device_resume, amdgpu_resume_switcheroo), 1325*78973132SSergey Zigachev #endif 1326*78973132SSergey Zigachev DEVMETHOD(device_detach, drm_release), 1327*78973132SSergey Zigachev DEVMETHOD_END 1328*78973132SSergey Zigachev }; 1329*78973132SSergey Zigachev 1330*78973132SSergey Zigachev static driver_t amdgpu_driver = { 1331*78973132SSergey Zigachev "drm", 1332*78973132SSergey Zigachev amdgpu_methods, 1333*78973132SSergey Zigachev sizeof(struct drm_device) 1334*78973132SSergey Zigachev }; 1335*78973132SSergey Zigachev 1336*78973132SSergey Zigachev extern devclass_t drm_devclass; 1337*78973132SSergey Zigachev DRIVER_MODULE_ORDERED(amdgpu, vgapci, amdgpu_driver, drm_devclass, NULL, NULL, SI_ORDER_ANY); 1338*78973132SSergey Zigachev MODULE_DEPEND(amdgpu, drm, 1, 1, 1); 1339*78973132SSergey Zigachev #ifdef CONFIG_ACPI 1340*78973132SSergey Zigachev MODULE_DEPEND(amdgpu, acpi, 1, 1, 1); 1341*78973132SSergey Zigachev #endif 1342*78973132SSergey Zigachev #endif 1343