aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-10-28 20:49:53 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-10-28 20:49:53 -0400
commit53b3b6bbfde6aae8d1ededc86ad4e0e1e00eb5f8 (patch)
treeb29473f21270aefd113b298c9402be8b4b3c91b4 /drivers/gpu/drm/amd/amdgpu/amdgpu.h
parent746bb4ed6d626f3f9e431a7f9b20504538e62ded (diff)
parentf2bfc71aee75feff33ca659322b72ffeed5a243d (diff)
Merge tag 'drm-next-2018-10-24' of git://anongit.freedesktop.org/drm/drm
Pull drm updates from Dave Airlie: "This is going to rebuild more than drm as it adds a new helper to list.h for doing bulk updates. Seemed like a reasonable addition to me. Otherwise the usual merge window stuff lots of i915 and amdgpu, not so much nouveau, and piles of everything else. Core: - Adds a new list.h helper for doing bulk list updates for TTM. - Don't leak fb address in smem_start to userspace (comes with EXPORT workaround for people using mali out of tree hacks) - udmabuf device to turn memfd regions into dma-buf - Per-plane blend mode property - ref/unref replacements with get/put - fbdev conflicting framebuffers code cleaned up - host-endian format variants - panel orientation quirk for Acer One 10 bridge: - TI SN65DSI86 chip support vkms: - GEM support. - Cursor support amdgpu: - Merge amdkfd and amdgpu into one module - CEC over DP AUX support - Picasso APU support + VCN dynamic powergating - Raven2 APU support - Vega20 enablement + kfd support - ACP powergating improvements - ABGR/XBGR display support - VCN jpeg support - xGMI support - DC i2c/aux cleanup - Ycbcr 4:2:0 support - GPUVM improvements - Powerplay and powerplay endian fixes - Display underflow fixes vmwgfx: - Move vmwgfx specific TTM code to vmwgfx - Split out vmwgfx buffer/resource validation code - Atomic operation rework bochs: - use more helpers - format/byteorder improvements qxl: - use more helpers i915: - GGTT coherency getparam - Turn off resource streamer API - More Icelake enablement + DMC firmware - Full PPGTT for Ivybridge, Haswell and Valleyview - DDB distribution based on resolution - Limited range DP display support nouveau: - CEC over DP AUX support - Initial HDMI 2.0 support virtio-gpu: - vmap support for PRIME objects tegra: - Initial Tegra194 support - DMA/IOMMU integration fixes msm: - a6xx perf improvements + clock prefix - GPU preemption optimisations - a6xx devfreq support - cursor support rockchip: - PX30 support - rgb output interface support mediatek: - HDMI output support on mt2701 and mt7623 rcar-du: - Interlaced modes on Gen3 - LVDS on R8A77980 - D3 and E3 SoC support hisilicon: - misc fixes mxsfb: - runtime pm support sun4i: - R40 TCON support - Allwinner A64 support - R40 HDMI support omapdrm: - Driver rework changing display pipeline ordering to use common code - DMM memory barrier and irq fixes - Errata workarounds exynos: - out-bridge support for LVDS bridge driver - Samsung 16x16 tiled format support - Plane alpha and pixel blend mode support tilcdc: - suspend/resume update mali-dp: - misc updates" * tag 'drm-next-2018-10-24' of git://anongit.freedesktop.org/drm/drm: (1382 commits) firmware/dmc/icl: Add missing MODULE_FIRMWARE() for Icelake. drm/i915/icl: Fix signal_levels drm/i915/icl: Fix DDI/TC port clk_off bits drm/i915/icl: create function to identify combophy port drm/i915/gen9+: Fix initial readout for Y tiled framebuffers drm/i915: Large page offsets for pread/pwrite drm/i915/selftests: Disable shrinker across mmap-exhaustion drm/i915/dp: Link train Fallback on eDP only if fallback link BW can fit panel's native mode drm/i915: Fix intel_dp_mst_best_encoder() drm/i915: Skip vcpi allocation for MSTB ports that are gone drm/i915: Don't unset intel_connector->mst_port drm/i915: Only reset seqno if actually idle drm/i915: Use the correct crtc when sanitizing plane mapping drm/i915: Restore vblank interrupts earlier drm/i915: Check fb stride against plane max stride drm/amdgpu/vcn:Fix uninitialized symbol error drm: panel-orientation-quirks: Add quirk for Acer One 10 (S1003) drm/amd/amdgpu: Fix debugfs error handling drm/amdgpu: Update gc_9_0 golden settings. drm/amd/powerplay: update PPtable with DC BTC and Tvr SocLimit fields ...
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu.h')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu.h704
1 files changed, 55 insertions, 649 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 447c4c7a36d6..d0102cfc8efb 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -28,6 +28,8 @@
28#ifndef __AMDGPU_H__ 28#ifndef __AMDGPU_H__
29#define __AMDGPU_H__ 29#define __AMDGPU_H__
30 30
31#include "amdgpu_ctx.h"
32
31#include <linux/atomic.h> 33#include <linux/atomic.h>
32#include <linux/wait.h> 34#include <linux/wait.h>
33#include <linux/list.h> 35#include <linux/list.h>
@@ -69,12 +71,32 @@
69#include "amdgpu_vcn.h" 71#include "amdgpu_vcn.h"
70#include "amdgpu_mn.h" 72#include "amdgpu_mn.h"
71#include "amdgpu_gmc.h" 73#include "amdgpu_gmc.h"
74#include "amdgpu_gfx.h"
75#include "amdgpu_sdma.h"
72#include "amdgpu_dm.h" 76#include "amdgpu_dm.h"
73#include "amdgpu_virt.h" 77#include "amdgpu_virt.h"
74#include "amdgpu_gart.h" 78#include "amdgpu_gart.h"
75#include "amdgpu_debugfs.h" 79#include "amdgpu_debugfs.h"
76#include "amdgpu_job.h" 80#include "amdgpu_job.h"
77#include "amdgpu_bo_list.h" 81#include "amdgpu_bo_list.h"
82#include "amdgpu_gem.h"
83
84#define MAX_GPU_INSTANCE 16
85
86struct amdgpu_gpu_instance
87{
88 struct amdgpu_device *adev;
89 int mgpu_fan_enabled;
90};
91
92struct amdgpu_mgpu_info
93{
94 struct amdgpu_gpu_instance gpu_ins[MAX_GPU_INSTANCE];
95 struct mutex mutex;
96 uint32_t num_gpu;
97 uint32_t num_dgpu;
98 uint32_t num_apu;
99};
78 100
79/* 101/*
80 * Modules parameters. 102 * Modules parameters.
@@ -129,6 +151,7 @@ extern int amdgpu_compute_multipipe;
129extern int amdgpu_gpu_recovery; 151extern int amdgpu_gpu_recovery;
130extern int amdgpu_emu_mode; 152extern int amdgpu_emu_mode;
131extern uint amdgpu_smu_memory_pool_size; 153extern uint amdgpu_smu_memory_pool_size;
154extern struct amdgpu_mgpu_info mgpu_info;
132 155
133#ifdef CONFIG_DRM_AMDGPU_SI 156#ifdef CONFIG_DRM_AMDGPU_SI
134extern int amdgpu_si_support; 157extern int amdgpu_si_support;
@@ -148,9 +171,6 @@ extern int amdgpu_cik_support;
148#define AMDGPUFB_CONN_LIMIT 4 171#define AMDGPUFB_CONN_LIMIT 4
149#define AMDGPU_BIOS_NUM_SCRATCH 16 172#define AMDGPU_BIOS_NUM_SCRATCH 16
150 173
151/* max number of IP instances */
152#define AMDGPU_MAX_SDMA_INSTANCES 2
153
154/* hard reset data */ 174/* hard reset data */
155#define AMDGPU_ASIC_RESET_DATA 0x39d5e86b 175#define AMDGPU_ASIC_RESET_DATA 0x39d5e86b
156 176
@@ -171,13 +191,6 @@ extern int amdgpu_cik_support;
171#define AMDGPU_RESET_VCE (1 << 13) 191#define AMDGPU_RESET_VCE (1 << 13)
172#define AMDGPU_RESET_VCE1 (1 << 14) 192#define AMDGPU_RESET_VCE1 (1 << 14)
173 193
174/* GFX current status */
175#define AMDGPU_GFX_NORMAL_MODE 0x00000000L
176#define AMDGPU_GFX_SAFE_MODE 0x00000001L
177#define AMDGPU_GFX_PG_DISABLED_MODE 0x00000002L
178#define AMDGPU_GFX_CG_DISABLED_MODE 0x00000004L
179#define AMDGPU_GFX_LBPW_DISABLED_MODE 0x00000008L
180
181/* max cursor sizes (in pixels) */ 194/* max cursor sizes (in pixels) */
182#define CIK_CURSOR_WIDTH 128 195#define CIK_CURSOR_WIDTH 128
183#define CIK_CURSOR_HEIGHT 128 196#define CIK_CURSOR_HEIGHT 128
@@ -205,13 +218,6 @@ enum amdgpu_cp_irq {
205 AMDGPU_CP_IRQ_LAST 218 AMDGPU_CP_IRQ_LAST
206}; 219};
207 220
208enum amdgpu_sdma_irq {
209 AMDGPU_SDMA_IRQ_TRAP0 = 0,
210 AMDGPU_SDMA_IRQ_TRAP1,
211
212 AMDGPU_SDMA_IRQ_LAST
213};
214
215enum amdgpu_thermal_irq { 221enum amdgpu_thermal_irq {
216 AMDGPU_THERMAL_IRQ_LOW_TO_HIGH = 0, 222 AMDGPU_THERMAL_IRQ_LOW_TO_HIGH = 0,
217 AMDGPU_THERMAL_IRQ_HIGH_TO_LOW, 223 AMDGPU_THERMAL_IRQ_HIGH_TO_LOW,
@@ -224,6 +230,10 @@ enum amdgpu_kiq_irq {
224 AMDGPU_CP_KIQ_IRQ_LAST 230 AMDGPU_CP_KIQ_IRQ_LAST
225}; 231};
226 232
233#define MAX_KIQ_REG_WAIT 5000 /* in usecs, 5ms */
234#define MAX_KIQ_REG_BAILOUT_INTERVAL 5 /* in msecs, 5ms */
235#define MAX_KIQ_REG_TRY 20
236
227int amdgpu_device_ip_set_clockgating_state(void *dev, 237int amdgpu_device_ip_set_clockgating_state(void *dev,
228 enum amd_ip_block_type block_type, 238 enum amd_ip_block_type block_type,
229 enum amd_clockgating_state state); 239 enum amd_clockgating_state state);
@@ -271,70 +281,6 @@ amdgpu_device_ip_get_ip_block(struct amdgpu_device *adev,
271int amdgpu_device_ip_block_add(struct amdgpu_device *adev, 281int amdgpu_device_ip_block_add(struct amdgpu_device *adev,
272 const struct amdgpu_ip_block_version *ip_block_version); 282 const struct amdgpu_ip_block_version *ip_block_version);
273 283
274/* provided by hw blocks that can move/clear data. e.g., gfx or sdma */
275struct amdgpu_buffer_funcs {
276 /* maximum bytes in a single operation */
277 uint32_t copy_max_bytes;
278
279 /* number of dw to reserve per operation */
280 unsigned copy_num_dw;
281
282 /* used for buffer migration */
283 void (*emit_copy_buffer)(struct amdgpu_ib *ib,
284 /* src addr in bytes */
285 uint64_t src_offset,
286 /* dst addr in bytes */
287 uint64_t dst_offset,
288 /* number of byte to transfer */
289 uint32_t byte_count);
290
291 /* maximum bytes in a single operation */
292 uint32_t fill_max_bytes;
293
294 /* number of dw to reserve per operation */
295 unsigned fill_num_dw;
296
297 /* used for buffer clearing */
298 void (*emit_fill_buffer)(struct amdgpu_ib *ib,
299 /* value to write to memory */
300 uint32_t src_data,
301 /* dst addr in bytes */
302 uint64_t dst_offset,
303 /* number of byte to fill */
304 uint32_t byte_count);
305};
306
307/* provided by hw blocks that can write ptes, e.g., sdma */
308struct amdgpu_vm_pte_funcs {
309 /* number of dw to reserve per operation */
310 unsigned copy_pte_num_dw;
311
312 /* copy pte entries from GART */
313 void (*copy_pte)(struct amdgpu_ib *ib,
314 uint64_t pe, uint64_t src,
315 unsigned count);
316
317 /* write pte one entry at a time with addr mapping */
318 void (*write_pte)(struct amdgpu_ib *ib, uint64_t pe,
319 uint64_t value, unsigned count,
320 uint32_t incr);
321 /* for linear pte/pde updates without addr mapping */
322 void (*set_pte_pde)(struct amdgpu_ib *ib,
323 uint64_t pe,
324 uint64_t addr, unsigned count,
325 uint32_t incr, uint64_t flags);
326};
327
328/* provided by the ih block */
329struct amdgpu_ih_funcs {
330 /* ring read/write ptr handling, called from interrupt context */