Skip to content

Commit 97eaf75

Browse files
committed
Merge branch 'drm-next-4.13' of git://people.freedesktop.org/~agd5f/linux into drm-next
Fixes for 4.13: - Various fixes for Raven - Various fixes for Vega10 - Stability fixes for KIQ - Fix reloading the driver - Fix S3 on vega10 - Misc other fixes * 'drm-next-4.13' of git://people.freedesktop.org/~agd5f/linux: (26 commits) drm/amd/powerplay: fix bug fail to remove sysfs when rmmod amdgpu. amdgpu: Set cik/si_support to 1 by default if radeon isn't built drm/amdgpu/gfx9: fix driver reload with KIQ drm/amdgpu/gfx8: fix driver reload with KIQ drm/amdgpu: Don't call amd_powerplay_destroy() if we don't have powerplay drm/ttm: Fix use-after-free in ttm_bo_clean_mm drm/amd/amdgpu: move get memory type function from early init to sw init drm/amdgpu/cgs: always set reference clock in mode_info drm/amdgpu: fix vblank_time when displays are off drm/amd/powerplay: power value format change for Vega10 drm/amdgpu/gfx9: support the amdgpu.disable_cu option drm/amd/powerplay: change PPSMC_MSG_GetCurrPkgPwr for Vega10 drm/amdgpu: Make amdgpu_cs_parser_init static (v2) drm/amdgpu/cs: fix a typo in a comment drm/amdgpu: Fix the exported always on CU bitmap drm/amdgpu/gfx9: gfx_v9_0_enable_gfx_static_mg_power_gating() can be static drm/amdgpu/psp: upper_32_bits/lower_32_bits for address setup drm/amd/powerplay/cz: print message if smc message fails drm/amdgpu: fix typo in amdgpu_debugfs_test_ib_init drm/amdgpu: enable mmhub pg on raven ...
2 parents 4d79ce4 + 593f546 commit 97eaf75

28 files changed

+687
-197
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,12 +1028,15 @@ struct amdgpu_gfx_config {
10281028
};
10291029

10301030
struct amdgpu_cu_info {
1031-
uint32_t number; /* total active CU number */
1032-
uint32_t ao_cu_mask;
10331031
uint32_t max_waves_per_simd;
10341032
uint32_t wave_front_size;
10351033
uint32_t max_scratch_slots_per_cu;
10361034
uint32_t lds_size;
1035+
1036+
/* total active CU number */
1037+
uint32_t number;
1038+
uint32_t ao_cu_mask;
1039+
uint32_t ao_cu_bitmap[4][4];
10371040
uint32_t bitmap[4][4];
10381041
};
10391042

@@ -1924,7 +1927,6 @@ void amdgpu_pci_config_reset(struct amdgpu_device *adev);
19241927
bool amdgpu_need_post(struct amdgpu_device *adev);
19251928
void amdgpu_update_display_priority(struct amdgpu_device *adev);
19261929

1927-
int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, void *data);
19281930
void amdgpu_cs_report_moved_bytes(struct amdgpu_device *adev, u64 num_bytes);
19291931
void amdgpu_ttm_placement_from_domain(struct amdgpu_bo *abo, u32 domain);
19301932
bool amdgpu_ttm_bo_is_amdgpu_bo(struct ttm_buffer_object *bo);

drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -838,6 +838,12 @@ static int amdgpu_cgs_get_active_displays_info(struct cgs_device *cgs_device,
838838
return -EINVAL;
839839

840840
mode_info = info->mode_info;
841+
if (mode_info) {
842+
/* if the displays are off, vblank time is max */
843+
mode_info->vblank_time_us = 0xffffffff;
844+
/* always set the reference clock */
845+
mode_info->ref_clock = adev->clock.spll.reference_freq;
846+
}
841847

842848
if (adev->mode_info.num_crtc && adev->mode_info.mode_config_initialized) {
843849
list_for_each_entry(crtc,

drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static int amdgpu_cs_user_fence_chunk(struct amdgpu_cs_parser *p,
6464
return 0;
6565
}
6666

67-
int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, void *data)
67+
static int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, void *data)
6868
{
6969
struct amdgpu_fpriv *fpriv = p->filp->driver_priv;
7070
struct amdgpu_vm *vm = &fpriv->vm;
@@ -497,7 +497,7 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
497497
&e->user_invalidated) && e->user_pages) {
498498

499499
/* We acquired a page array, but somebody
500-
* invalidated it. Free it an try again
500+
* invalidated it. Free it and try again
501501
*/
502502
release_pages(e->user_pages,
503503
e->robj->tbo.ttm->num_pages,

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3804,7 +3804,7 @@ int amdgpu_debugfs_init(struct drm_minor *minor)
38043804
return 0;
38053805
}
38063806
#else
3807-
static int amdgpu_debugfs_test_ib_init(struct amdgpu_device *adev)
3807+
static int amdgpu_debugfs_test_ib_ring_init(struct amdgpu_device *adev)
38083808
{
38093809
return 0;
38103810
}

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,10 @@
6767
* - 3.15.0 - Export more gpu info for gfx9
6868
* - 3.16.0 - Add reserved vmid support
6969
* - 3.17.0 - Add AMDGPU_NUM_VRAM_CPU_PAGE_FAULTS.
70+
* - 3.18.0 - Export gpu always on cu bitmap
7071
*/
7172
#define KMS_DRIVER_MAJOR 3
72-
#define KMS_DRIVER_MINOR 17
73+
#define KMS_DRIVER_MINOR 18
7374
#define KMS_DRIVER_PATCHLEVEL 0
7475

7576
int amdgpu_vram_limit = 0;
@@ -247,14 +248,28 @@ MODULE_PARM_DESC(lbpw, "Load Balancing Per Watt (LBPW) support (1 = enable, 0 =
247248
module_param_named(lbpw, amdgpu_lbpw, int, 0444);
248249

249250
#ifdef CONFIG_DRM_AMDGPU_SI
251+
252+
#if defined(CONFIG_DRM_RADEON) || defined(CONFIG_DRM_RADEON_MODULE)
250253
int amdgpu_si_support = 0;
251254
MODULE_PARM_DESC(si_support, "SI support (1 = enabled, 0 = disabled (default))");
255+
#else
256+
int amdgpu_si_support = 1;
257+
MODULE_PARM_DESC(si_support, "SI support (1 = enabled (default), 0 = disabled)");
258+
#endif
259+
252260
module_param_named(si_support, amdgpu_si_support, int, 0444);
253261
#endif
254262

255263
#ifdef CONFIG_DRM_AMDGPU_CIK
264+
265+
#if defined(CONFIG_DRM_RADEON) || defined(CONFIG_DRM_RADEON_MODULE)
256266
int amdgpu_cik_support = 0;
257267
MODULE_PARM_DESC(cik_support, "CIK support (1 = enabled, 0 = disabled (default))");
268+
#else
269+
int amdgpu_cik_support = 1;
270+
MODULE_PARM_DESC(cik_support, "CIK support (1 = enabled (default), 0 = disabled)");
271+
#endif
272+
258273
module_param_named(cik_support, amdgpu_cik_support, int, 0444);
259274
#endif
260275

drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,8 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file
594594
dev_info.cu_active_number = adev->gfx.cu_info.number;
595595
dev_info.cu_ao_mask = adev->gfx.cu_info.ao_cu_mask;
596596
dev_info.ce_ram_size = adev->gfx.ce_ram_size;
597+
memcpy(&dev_info.cu_ao_bitmap[0], &adev->gfx.cu_info.ao_cu_bitmap[0],
598+
sizeof(adev->gfx.cu_info.ao_cu_bitmap));
597599
memcpy(&dev_info.cu_bitmap[0], &adev->gfx.cu_info.bitmap[0],
598600
sizeof(adev->gfx.cu_info.bitmap));
599601
dev_info.vram_type = adev->mc.vram_type;

drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,9 @@ static int amdgpu_pp_hw_fini(void *handle)
188188
int ret = 0;
189189
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
190190

191+
if (adev->pp_enabled && adev->pm.dpm_enabled)
192+
amdgpu_pm_sysfs_fini(adev);
193+
191194
if (adev->powerplay.ip_funcs->hw_fini)
192195
ret = adev->powerplay.ip_funcs->hw_fini(
193196
adev->powerplay.pp_handle);
@@ -206,10 +209,9 @@ static void amdgpu_pp_late_fini(void *handle)
206209
adev->powerplay.ip_funcs->late_fini(
207210
adev->powerplay.pp_handle);
208211

209-
if (adev->pp_enabled && adev->pm.dpm_enabled)
210-
amdgpu_pm_sysfs_fini(adev);
211212

212-
amd_powerplay_destroy(adev->powerplay.pp_handle);
213+
if (adev->pp_enabled)
214+
amd_powerplay_destroy(adev->powerplay.pp_handle);
213215
}
214216

215217
static int amdgpu_pp_suspend(void *handle)

drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ static void psp_prep_tmr_cmd_buf(struct psp_gfx_cmd_resp *cmd,
152152
uint64_t tmr_mc, uint32_t size)
153153
{
154154
cmd->cmd_id = GFX_CMD_ID_SETUP_TMR;
155-
cmd->cmd.cmd_setup_tmr.buf_phy_addr_lo = (uint32_t)tmr_mc;
156-
cmd->cmd.cmd_setup_tmr.buf_phy_addr_hi = (uint32_t)(tmr_mc >> 32);
155+
cmd->cmd.cmd_setup_tmr.buf_phy_addr_lo = lower_32_bits(tmr_mc);
156+
cmd->cmd.cmd_setup_tmr.buf_phy_addr_hi = upper_32_bits(tmr_mc);
157157
cmd->cmd.cmd_setup_tmr.buf_size = size;
158158
}
159159

@@ -333,14 +333,11 @@ static int psp_load_fw(struct amdgpu_device *adev)
333333
{
334334
int ret;
335335
struct psp_context *psp = &adev->psp;
336-
struct psp_gfx_cmd_resp *cmd;
337336

338-
cmd = kzalloc(sizeof(struct psp_gfx_cmd_resp), GFP_KERNEL);
339-
if (!cmd)
337+
psp->cmd = kzalloc(sizeof(struct psp_gfx_cmd_resp), GFP_KERNEL);
338+
if (!psp->cmd)
340339
return -ENOMEM;
341340

342-
psp->cmd = cmd;
343-
344341
ret = amdgpu_bo_create_kernel(adev, PSP_1_MEG, PSP_1_MEG,
345342
AMDGPU_GEM_DOMAIN_GTT,
346343
&psp->fw_pri_bo,
@@ -379,8 +376,6 @@ static int psp_load_fw(struct amdgpu_device *adev)
379376
if (ret)
380377
goto failed_mem;
381378

382-
kfree(cmd);
383-
384379
return 0;
385380

386381
failed_mem:
@@ -390,7 +385,8 @@ static int psp_load_fw(struct amdgpu_device *adev)
390385
amdgpu_bo_free_kernel(&psp->fw_pri_bo,
391386
&psp->fw_pri_mc_addr, &psp->fw_pri_buf);
392387
failed:
393-
kfree(cmd);
388+
kfree(psp->cmd);
389+
psp->cmd = NULL;
394390
return ret;
395391
}
396392

@@ -450,6 +446,9 @@ static int psp_hw_fini(void *handle)
450446
amdgpu_bo_free_kernel(&psp->fence_buf_bo,
451447
&psp->fence_buf_mc_addr, &psp->fence_buf);
452448

449+
kfree(psp->cmd);
450+
psp->cmd = NULL;
451+
453452
return 0;
454453
}
455454

drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3535,7 +3535,9 @@ static void gfx_v6_0_get_cu_info(struct amdgpu_device *adev)
35353535
mask <<= 1;
35363536
}
35373537
active_cu_number += counter;
3538-
ao_cu_mask |= (ao_bitmap << (i * 16 + j * 8));
3538+
if (i < 2 && j < 2)
3539+
ao_cu_mask |= (ao_bitmap << (i * 16 + j * 8));
3540+
cu_info->ao_cu_bitmap[i][j] = ao_bitmap;
35393541
}
35403542
}
35413543

drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5427,7 +5427,9 @@ static void gfx_v7_0_get_cu_info(struct amdgpu_device *adev)
54275427
mask <<= 1;
54285428
}
54295429
active_cu_number += counter;
5430-
ao_cu_mask |= (ao_bitmap << (i * 16 + j * 8));
5430+
if (i < 2 && j < 2)
5431+
ao_cu_mask |= (ao_bitmap << (i * 16 + j * 8));
5432+
cu_info->ao_cu_bitmap[i][j] = ao_bitmap;
54315433
}
54325434
}
54335435
gfx_v7_0_select_se_sh(adev, 0xffffffff, 0xffffffff, 0xffffffff);

0 commit comments

Comments
 (0)