提交 d34d4d8a 编写于 作者: D Dave Airlie

Merge branch 'drm-fixes-3.18' of git://people.freedesktop.org/~agd5f/linux into drm-fixes

- dpm stability fixes for SI and KV
- remove an invalid pci id
- kmalloc_array fixes
- minor cleanups

* 'drm-fixes-3.18' of git://people.freedesktop.org/~agd5f/linux:
  drm/radeon: remove some buggy dead code
  drm/radeon: remove invalid pci id
  drm/radeon: dpm fixes for asrock systems
  radeon: clean up coding style differences in radeon_get_bios()
  drm/radeon: Use drm_malloc_ab instead of kmalloc_array
  drm/radeon/dpm: disable ulv support on SI
...@@ -3005,7 +3005,7 @@ static void evergreen_gpu_init(struct radeon_device *rdev) ...@@ -3005,7 +3005,7 @@ static void evergreen_gpu_init(struct radeon_device *rdev)
u32 vgt_cache_invalidation; u32 vgt_cache_invalidation;
u32 hdp_host_path_cntl, tmp; u32 hdp_host_path_cntl, tmp;
u32 disabled_rb_mask; u32 disabled_rb_mask;
int i, j, num_shader_engines, ps_thread_count; int i, j, ps_thread_count;
switch (rdev->family) { switch (rdev->family) {
case CHIP_CYPRESS: case CHIP_CYPRESS:
...@@ -3303,8 +3303,6 @@ static void evergreen_gpu_init(struct radeon_device *rdev) ...@@ -3303,8 +3303,6 @@ static void evergreen_gpu_init(struct radeon_device *rdev)
rdev->config.evergreen.tile_config |= rdev->config.evergreen.tile_config |=
((gb_addr_config & 0x30000000) >> 28) << 12; ((gb_addr_config & 0x30000000) >> 28) << 12;
num_shader_engines = (gb_addr_config & NUM_SHADER_ENGINES(3) >> 12) + 1;
if ((rdev->family >= CHIP_CEDAR) && (rdev->family <= CHIP_HEMLOCK)) { if ((rdev->family >= CHIP_CEDAR) && (rdev->family <= CHIP_HEMLOCK)) {
u32 efuse_straps_4; u32 efuse_straps_4;
u32 efuse_straps_3; u32 efuse_straps_3;
......
...@@ -2725,6 +2725,10 @@ int kv_dpm_init(struct radeon_device *rdev) ...@@ -2725,6 +2725,10 @@ int kv_dpm_init(struct radeon_device *rdev)
pi->sram_end = SMC_RAM_END; pi->sram_end = SMC_RAM_END;
/* Enabling nb dpm on an asrock system prevents dpm from working */
if (rdev->pdev->subsystem_vendor == 0x1849)
pi->enable_nb_dpm = false;
else
pi->enable_nb_dpm = true; pi->enable_nb_dpm = true;
pi->caps_power_containment = true; pi->caps_power_containment = true;
...@@ -2740,10 +2744,19 @@ int kv_dpm_init(struct radeon_device *rdev) ...@@ -2740,10 +2744,19 @@ int kv_dpm_init(struct radeon_device *rdev)
pi->caps_sclk_ds = true; pi->caps_sclk_ds = true;
pi->enable_auto_thermal_throttling = true; pi->enable_auto_thermal_throttling = true;
pi->disable_nb_ps3_in_battery = false; pi->disable_nb_ps3_in_battery = false;
if (radeon_bapm == 0) if (radeon_bapm == -1) {
/* There are stability issues reported on with
* bapm enabled on an asrock system.
*/
if (rdev->pdev->subsystem_vendor == 0x1849)
pi->bapm_enable = false; pi->bapm_enable = false;
else else
pi->bapm_enable = true; pi->bapm_enable = true;
} else if (radeon_bapm == 0) {
pi->bapm_enable = false;
} else {
pi->bapm_enable = true;
}
pi->voltage_drop_t = 0; pi->voltage_drop_t = 0;
pi->caps_sclk_throttle_low_notification = false; pi->caps_sclk_throttle_low_notification = false;
pi->caps_fps = false; /* true? */ pi->caps_fps = false; /* true? */
......
...@@ -658,12 +658,10 @@ bool radeon_get_bios(struct radeon_device *rdev) ...@@ -658,12 +658,10 @@ bool radeon_get_bios(struct radeon_device *rdev)
r = igp_read_bios_from_vram(rdev); r = igp_read_bios_from_vram(rdev);
if (r == false) if (r == false)
r = radeon_read_bios(rdev); r = radeon_read_bios(rdev);
if (r == false) { if (r == false)
r = radeon_read_disabled_bios(rdev); r = radeon_read_disabled_bios(rdev);
} if (r == false)
if (r == false) {
r = radeon_read_platform_bios(rdev); r = radeon_read_platform_bios(rdev);
}
if (r == false || rdev->bios == NULL) { if (r == false || rdev->bios == NULL) {
DRM_ERROR("Unable to locate a BIOS ROM\n"); DRM_ERROR("Unable to locate a BIOS ROM\n");
rdev->bios = NULL; rdev->bios = NULL;
......
...@@ -450,7 +450,7 @@ static void radeon_cs_parser_fini(struct radeon_cs_parser *parser, int error, bo ...@@ -450,7 +450,7 @@ static void radeon_cs_parser_fini(struct radeon_cs_parser *parser, int error, bo
kfree(parser->track); kfree(parser->track);
kfree(parser->relocs); kfree(parser->relocs);
kfree(parser->relocs_ptr); kfree(parser->relocs_ptr);
kfree(parser->vm_bos); drm_free_large(parser->vm_bos);
for (i = 0; i < parser->nchunks; i++) for (i = 0; i < parser->nchunks; i++)
drm_free_large(parser->chunks[i].kdata); drm_free_large(parser->chunks[i].kdata);
kfree(parser->chunks); kfree(parser->chunks);
......
...@@ -314,7 +314,7 @@ unsigned radeon_ring_backup(struct radeon_device *rdev, struct radeon_ring *ring ...@@ -314,7 +314,7 @@ unsigned radeon_ring_backup(struct radeon_device *rdev, struct radeon_ring *ring
} }
/* and then save the content of the ring */ /* and then save the content of the ring */
*data = kmalloc_array(size, sizeof(uint32_t), GFP_KERNEL); *data = drm_malloc_ab(size, sizeof(uint32_t));
if (!*data) { if (!*data) {
mutex_unlock(&rdev->ring_lock); mutex_unlock(&rdev->ring_lock);
return 0; return 0;
...@@ -356,7 +356,7 @@ int radeon_ring_restore(struct radeon_device *rdev, struct radeon_ring *ring, ...@@ -356,7 +356,7 @@ int radeon_ring_restore(struct radeon_device *rdev, struct radeon_ring *ring,
} }
radeon_ring_unlock_commit(rdev, ring, false); radeon_ring_unlock_commit(rdev, ring, false);
kfree(data); drm_free_large(data);
return 0; return 0;
} }
......
...@@ -132,8 +132,8 @@ struct radeon_cs_reloc *radeon_vm_get_bos(struct radeon_device *rdev, ...@@ -132,8 +132,8 @@ struct radeon_cs_reloc *radeon_vm_get_bos(struct radeon_device *rdev,
struct radeon_cs_reloc *list; struct radeon_cs_reloc *list;
unsigned i, idx; unsigned i, idx;
list = kmalloc_array(vm->max_pde_used + 2, list = drm_malloc_ab(vm->max_pde_used + 2,
sizeof(struct radeon_cs_reloc), GFP_KERNEL); sizeof(struct radeon_cs_reloc));
if (!list) if (!list)
return NULL; return NULL;
......
...@@ -6256,7 +6256,7 @@ static void si_parse_pplib_clock_info(struct radeon_device *rdev, ...@@ -6256,7 +6256,7 @@ static void si_parse_pplib_clock_info(struct radeon_device *rdev,
if ((rps->class2 & ATOM_PPLIB_CLASSIFICATION2_ULV) && if ((rps->class2 & ATOM_PPLIB_CLASSIFICATION2_ULV) &&
index == 0) { index == 0) {
/* XXX disable for A0 tahiti */ /* XXX disable for A0 tahiti */
si_pi->ulv.supported = true; si_pi->ulv.supported = false;
si_pi->ulv.pl = *pl; si_pi->ulv.pl = *pl;
si_pi->ulv.one_pcie_lane_in_ulv = false; si_pi->ulv.one_pcie_lane_in_ulv = false;
si_pi->ulv.volt_change_delay = SISLANDS_ULVVOLTAGECHANGEDELAY_DFLT; si_pi->ulv.volt_change_delay = SISLANDS_ULVVOLTAGECHANGEDELAY_DFLT;
......
...@@ -74,7 +74,6 @@ ...@@ -74,7 +74,6 @@
{0x1002, 0x4C64, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV250|RADEON_IS_MOBILITY}, \ {0x1002, 0x4C64, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV250|RADEON_IS_MOBILITY}, \
{0x1002, 0x4C66, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV250|RADEON_IS_MOBILITY}, \ {0x1002, 0x4C66, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV250|RADEON_IS_MOBILITY}, \
{0x1002, 0x4C67, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV250|RADEON_IS_MOBILITY}, \ {0x1002, 0x4C67, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV250|RADEON_IS_MOBILITY}, \
{0x1002, 0x4C6E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280|RADEON_IS_MOBILITY}, \
{0x1002, 0x4E44, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R300}, \ {0x1002, 0x4E44, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R300}, \
{0x1002, 0x4E45, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R300}, \ {0x1002, 0x4E45, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R300}, \
{0x1002, 0x4E46, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R300}, \ {0x1002, 0x4E46, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R300}, \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册