aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2017-06-15 19:54:02 -0400
committerDave Airlie <airlied@redhat.com>2017-06-15 19:56:53 -0400
commit04d4fb5fa63876d8e7cf67f2788aecfafc6a28a7 (patch)
tree92aec67d7b5a1359baff1a508d381234f046743e /drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
parentbfda9aa15317838ddb259406027ef9911a1dffbc (diff)
parenta1924005a2e9bfcc4e217b4acd0a4f2421969040 (diff)
Merge branch 'drm-next-4.13' of git://people.freedesktop.org/~agd5f/linux into drm-next
New radeon and amdgpu features for 4.13: - Lots of Vega10 bug fixes - Preliminary Raven support - KIQ support for compute rings - MEC queue management rework from Andres - Audio support for DCE6 - SR-IOV improvements - Improved module parameters for controlling radeon vs amdgpu support for SI and CIK - Bug fixes - General code cleanups [airlied: dropped drmP.h header from one file was needed and build broke] * 'drm-next-4.13' of git://people.freedesktop.org/~agd5f/linux: (362 commits) drm/amdgpu: Fix compiler warnings drm/amdgpu: vm_update_ptes remove code duplication drm/amd/amdgpu: Port VCN over to new SOC15 macros drm/amd/amdgpu: Port PSP v10.0 over to new SOC15 macros drm/amd/amdgpu: Port PSP v3.1 over to new SOC15 macros drm/amd/amdgpu: Port NBIO v7.0 driver over to new SOC15 macros drm/amd/amdgpu: Port NBIO v6.1 driver over to new SOC15 macros drm/amd/amdgpu: Port UVD 7.0 over to new SOC15 macros drm/amd/amdgpu: Port MMHUB over to new SOC15 macros drm/amd/amdgpu: Cleanup gfxhub read-modify-write patterns drm/amd/amdgpu: Port GFXHUB over to new SOC15 macros drm/amd/amdgpu: Add offset variant to SOC15 macros drm/amd/powerplay: add avfs control for Vega10 drm/amdgpu: add virtual display support for raven drm/amdgpu/gfx9: fix compute ring doorbell index drm/amd/amdgpu: Rename KIQ ring to avoid spaces drm/amd/amdgpu: gfx9 tidy ups (v2) drm/amdgpu: add contiguous flag in ucode bo create drm/amdgpu: fix missed gpu info firmware when cache firmware during S3 drm/amdgpu: export test ib debugfs interface ...
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c65
1 files changed, 59 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 31eddd85eb40..8168f8ec711a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -65,9 +65,11 @@
65 * - 3.13.0 - Add PRT support 65 * - 3.13.0 - Add PRT support
66 * - 3.14.0 - Fix race in amdgpu_ctx_get_fence() and note new functionality 66 * - 3.14.0 - Fix race in amdgpu_ctx_get_fence() and note new functionality
67 * - 3.15.0 - Export more gpu info for gfx9 67 * - 3.15.0 - Export more gpu info for gfx9
68 * - 3.16.0 - Add reserved vmid support
69 * - 3.17.0 - Add AMDGPU_NUM_VRAM_CPU_PAGE_FAULTS.
68 */ 70 */
69#define KMS_DRIVER_MAJOR 3 71#define KMS_DRIVER_MAJOR 3
70#define KMS_DRIVER_MINOR 15 72#define KMS_DRIVER_MINOR 17
71#define KMS_DRIVER_PATCHLEVEL 0 73#define KMS_DRIVER_PATCHLEVEL 0
72 74
73int amdgpu_vram_limit = 0; 75int amdgpu_vram_limit = 0;
@@ -92,7 +94,8 @@ int amdgpu_vm_size = -1;
92int amdgpu_vm_block_size = -1; 94int amdgpu_vm_block_size = -1;
93int amdgpu_vm_fault_stop = 0; 95int amdgpu_vm_fault_stop = 0;
94int amdgpu_vm_debug = 0; 96int amdgpu_vm_debug = 0;
95int amdgpu_vram_page_split = 1024; 97int amdgpu_vram_page_split = 512;
98int amdgpu_vm_update_mode = -1;
96int amdgpu_exp_hw_support = 0; 99int amdgpu_exp_hw_support = 0;
97int amdgpu_sched_jobs = 32; 100int amdgpu_sched_jobs = 32;
98int amdgpu_sched_hw_submission = 2; 101int amdgpu_sched_hw_submission = 2;
@@ -110,6 +113,8 @@ int amdgpu_prim_buf_per_se = 0;
110int amdgpu_pos_buf_per_se = 0; 113int amdgpu_pos_buf_per_se = 0;
111int amdgpu_cntl_sb_buf_per_se = 0; 114int amdgpu_cntl_sb_buf_per_se = 0;
112int amdgpu_param_buf_per_se = 0; 115int amdgpu_param_buf_per_se = 0;
116int amdgpu_job_hang_limit = 0;
117int amdgpu_lbpw = -1;
113 118
114MODULE_PARM_DESC(vramlimit, "Restrict VRAM for testing, in megabytes"); 119MODULE_PARM_DESC(vramlimit, "Restrict VRAM for testing, in megabytes");
115module_param_named(vramlimit, amdgpu_vram_limit, int, 0600); 120module_param_named(vramlimit, amdgpu_vram_limit, int, 0600);
@@ -177,6 +182,9 @@ module_param_named(vm_fault_stop, amdgpu_vm_fault_stop, int, 0444);
177MODULE_PARM_DESC(vm_debug, "Debug VM handling (0 = disabled (default), 1 = enabled)"); 182MODULE_PARM_DESC(vm_debug, "Debug VM handling (0 = disabled (default), 1 = enabled)");
178module_param_named(vm_debug, amdgpu_vm_debug, int, 0644); 183module_param_named(vm_debug, amdgpu_vm_debug, int, 0644);
179 184
185MODULE_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");
186module_param_named(vm_update_mode, amdgpu_vm_update_mode, int, 0444);
187
180MODULE_PARM_DESC(vram_page_split, "Number of pages after we split VRAM allocations (default 1024, -1 = disable)"); 188MODULE_PARM_DESC(vram_page_split, "Number of pages after we split VRAM allocations (default 1024, -1 = disable)");
181module_param_named(vram_page_split, amdgpu_vram_page_split, int, 0444); 189module_param_named(vram_page_split, amdgpu_vram_page_split, int, 0444);
182 190
@@ -232,6 +240,24 @@ module_param_named(cntl_sb_buf_per_se, amdgpu_cntl_sb_buf_per_se, int, 0444);
232MODULE_PARM_DESC(param_buf_per_se, "the size of Off-Chip Pramater Cache per Shader Engine (default depending on gfx)"); 240MODULE_PARM_DESC(param_buf_per_se, "the size of Off-Chip Pramater Cache per Shader Engine (default depending on gfx)");
233module_param_named(param_buf_per_se, amdgpu_param_buf_per_se, int, 0444); 241module_param_named(param_buf_per_se, amdgpu_param_buf_per_se, int, 0444);
234 242
243MODULE_PARM_DESC(job_hang_limit, "how much time allow a job hang and not drop it (default 0)");
244module_param_named(job_hang_limit, amdgpu_job_hang_limit, int ,0444);
245
246MODULE_PARM_DESC(lbpw, "Load Balancing Per Watt (LBPW) support (1 = enable, 0 = disable, -1 = auto)");
247module_param_named(lbpw, amdgpu_lbpw, int, 0444);
248
249#ifdef CONFIG_DRM_AMDGPU_SI
250int amdgpu_si_support = 0;
251MODULE_PARM_DESC(si_support, "SI support (1 = enabled, 0 = disabled (default))");
252module_param_named(si_support, amdgpu_si_support, int, 0444);
253#endif
254
255#ifdef CONFIG_DRM_AMDGPU_CIK
256int amdgpu_cik_support = 0;
257MODULE_PARM_DESC(cik_support, "CIK support (1 = enabled, 0 = disabled (default))");
258module_param_named(cik_support, amdgpu_cik_support, int, 0444);
259#endif
260
235 261
236static const struct pci_device_id pciidlist[] = { 262static const struct pci_device_id pciidlist[] = {
237#ifdef CONFIG_DRM_AMDGPU_SI 263#ifdef CONFIG_DRM_AMDGPU_SI
@@ -460,6 +486,9 @@ static const struct pci_device_id pciidlist[] = {
460 {0x1002, 0x6868, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA10|AMD_EXP_HW_SUPPORT}, 486 {0x1002, 0x6868, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA10|AMD_EXP_HW_SUPPORT},
461 {0x1002, 0x686c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA10|AMD_EXP_HW_SUPPORT}, 487 {0x1002, 0x686c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA10|AMD_EXP_HW_SUPPORT},
462 {0x1002, 0x687f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA10|AMD_EXP_HW_SUPPORT}, 488 {0x1002, 0x687f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA10|AMD_EXP_HW_SUPPORT},
489 /* Raven */
490 {0x1002, 0x15dd, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RAVEN|AMD_IS_APU|AMD_EXP_HW_SUPPORT},
491
463 {0, 0, 0} 492 {0, 0, 0}
464}; 493};
465 494
@@ -491,6 +520,7 @@ static int amdgpu_kick_out_firmware_fb(struct pci_dev *pdev)
491static int amdgpu_pci_probe(struct pci_dev *pdev, 520static int amdgpu_pci_probe(struct pci_dev *pdev,
492 const struct pci_device_id *ent) 521 const struct pci_device_id *ent)
493{ 522{
523 struct drm_device *dev;
494 unsigned long flags = ent->driver_data; 524 unsigned long flags = ent->driver_data;
495 int ret; 525 int ret;
496 526
@@ -513,7 +543,29 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
513 if (ret) 543 if (ret)
514 return ret; 544 return ret;
515 545
516 return drm_get_pci_dev(pdev, ent, &kms_driver); 546 dev = drm_dev_alloc(&kms_driver, &pdev->dev);
547 if (IS_ERR(dev))
548 return PTR_ERR(dev);
549
550 ret = pci_enable_device(pdev);
551 if (ret)
552 goto err_free;
553
554 dev->pdev = pdev;
555
556 pci_set_drvdata(pdev, dev);
557
558 ret = drm_dev_register(dev, ent->driver_data);
559 if (ret)
560 goto err_pci;
561
562 return 0;
563
564err_pci:
565 pci_disable_device(pdev);
566err_free:
567 drm_dev_unref(dev);
568 return ret;
517} 569}
518 570
519static void 571static void
@@ -521,7 +573,8 @@ amdgpu_pci_remove(struct pci_dev *pdev)
521{ 573{
522 struct drm_device *dev = pci_get_drvdata(pdev); 574 struct drm_device *dev = pci_get_drvdata(pdev);
523 575
524 drm_put_dev(dev); 576 drm_dev_unregister(dev);
577 drm_dev_unref(dev);
525} 578}
526 579
527static void 580static void
@@ -817,7 +870,7 @@ static int __init amdgpu_init(void)
817 driver->num_ioctls = amdgpu_max_kms_ioctl; 870 driver->num_ioctls = amdgpu_max_kms_ioctl;
818 amdgpu_register_atpx_handler(); 871 amdgpu_register_atpx_handler();
819 /* let modprobe override vga console setting */ 872 /* let modprobe override vga console setting */
820 return drm_pci_init(driver, pdriver); 873 return pci_register_driver(pdriver);
821 874
822error_sched: 875error_sched:
823 amdgpu_fence_slab_fini(); 876 amdgpu_fence_slab_fini();
@@ -832,7 +885,7 @@ error_sync:
832static void __exit amdgpu_exit(void) 885static void __exit amdgpu_exit(void)
833{ 886{
834 amdgpu_amdkfd_fini(); 887 amdgpu_amdkfd_fini();
835 drm_pci_exit(driver, pdriver); 888 pci_unregister_driver(pdriver);
836 amdgpu_unregister_atpx_handler(); 889 amdgpu_unregister_atpx_handler();
837 amdgpu_sync_fini(); 890 amdgpu_sync_fini();
838 amd_sched_fence_slab_fini(); 891 amd_sched_fence_slab_fini();