Commit 9b5a3c0a authored by Dave Airlie's avatar Dave Airlie

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

Misc fixes for radeon, the irqs ones being most important.

* 'drm-fixes-3.14' of git://people.freedesktop.org/~agd5f/linux:
  drm/radeon: add missing include in btc_dpm.c
  drm/radeon/dpm: fix uninitialized read from stack in kv_dpm_late_enable
  drm/radeon: remove useless return
  drm/radeon/dpm: use stored max_vddc rather than looking it up
  drm/radeon/dpm: use the driver state for dpm debugfs
  drm/radeon: fix UVD IRQ support on 7xx
  drm/radeon: fix UVD IRQ support on SI
parents 7c4c62a0 d02f8575
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include "cypress_dpm.h" #include "cypress_dpm.h"
#include "btc_dpm.h" #include "btc_dpm.h"
#include "atom.h" #include "atom.h"
#include <linux/seq_file.h>
#define MC_CG_ARB_FREQ_F0 0x0a #define MC_CG_ARB_FREQ_F0 0x0a
#define MC_CG_ARB_FREQ_F1 0x0b #define MC_CG_ARB_FREQ_F1 0x0b
...@@ -2756,6 +2757,37 @@ void btc_dpm_fini(struct radeon_device *rdev) ...@@ -2756,6 +2757,37 @@ void btc_dpm_fini(struct radeon_device *rdev)
r600_free_extended_power_table(rdev); r600_free_extended_power_table(rdev);
} }
void btc_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev,
struct seq_file *m)
{
struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
struct radeon_ps *rps = &eg_pi->current_rps;
struct rv7xx_ps *ps = rv770_get_ps(rps);
struct rv7xx_pl *pl;
u32 current_index =
(RREG32(TARGET_AND_CURRENT_PROFILE_INDEX) & CURRENT_PROFILE_INDEX_MASK) >>
CURRENT_PROFILE_INDEX_SHIFT;
if (current_index > 2) {
seq_printf(m, "invalid dpm profile %d\n", current_index);
} else {
if (current_index == 0)
pl = &ps->low;
else if (current_index == 1)
pl = &ps->medium;
else /* current_index == 2 */
pl = &ps->high;
seq_printf(m, "uvd vclk: %d dclk: %d\n", rps->vclk, rps->dclk);
if (rdev->family >= CHIP_CEDAR) {
seq_printf(m, "power level %d sclk: %u mclk: %u vddc: %u vddci: %u\n",
current_index, pl->sclk, pl->mclk, pl->vddc, pl->vddci);
} else {
seq_printf(m, "power level %d sclk: %u mclk: %u vddc: %u\n",
current_index, pl->sclk, pl->mclk, pl->vddc);
}
}
}
u32 btc_dpm_get_sclk(struct radeon_device *rdev, bool low) u32 btc_dpm_get_sclk(struct radeon_device *rdev, bool low)
{ {
struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev); struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
......
...@@ -44,6 +44,10 @@ ...@@ -44,6 +44,10 @@
# define DYN_SPREAD_SPECTRUM_EN (1 << 23) # define DYN_SPREAD_SPECTRUM_EN (1 << 23)
# define AC_DC_SW (1 << 24) # define AC_DC_SW (1 << 24)
#define TARGET_AND_CURRENT_PROFILE_INDEX 0x66c
# define CURRENT_PROFILE_INDEX_MASK (0xf << 4)
# define CURRENT_PROFILE_INDEX_SHIFT 4
#define CG_BIF_REQ_AND_RSP 0x7f4 #define CG_BIF_REQ_AND_RSP 0x7f4
#define CG_CLIENT_REQ(x) ((x) << 0) #define CG_CLIENT_REQ(x) ((x) << 0)
#define CG_CLIENT_REQ_MASK (0xff << 0) #define CG_CLIENT_REQ_MASK (0xff << 0)
......
...@@ -1223,7 +1223,7 @@ int kv_dpm_enable(struct radeon_device *rdev) ...@@ -1223,7 +1223,7 @@ int kv_dpm_enable(struct radeon_device *rdev)
int kv_dpm_late_enable(struct radeon_device *rdev) int kv_dpm_late_enable(struct radeon_device *rdev)
{ {
int ret; int ret = 0;
if (rdev->irq.installed && if (rdev->irq.installed &&
r600_is_internal_thermal_sensor(rdev->pm.int_thermal_type)) { r600_is_internal_thermal_sensor(rdev->pm.int_thermal_type)) {
......
...@@ -3945,7 +3945,6 @@ static void ni_parse_pplib_clock_info(struct radeon_device *rdev, ...@@ -3945,7 +3945,6 @@ static void ni_parse_pplib_clock_info(struct radeon_device *rdev,
struct rv7xx_power_info *pi = rv770_get_pi(rdev); struct rv7xx_power_info *pi = rv770_get_pi(rdev);
struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev); struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
struct ni_ps *ps = ni_get_ps(rps); struct ni_ps *ps = ni_get_ps(rps);
u16 vddc;
struct rv7xx_pl *pl = &ps->performance_levels[index]; struct rv7xx_pl *pl = &ps->performance_levels[index];
ps->performance_level_count = index + 1; ps->performance_level_count = index + 1;
...@@ -3961,8 +3960,8 @@ static void ni_parse_pplib_clock_info(struct radeon_device *rdev, ...@@ -3961,8 +3960,8 @@ static void ni_parse_pplib_clock_info(struct radeon_device *rdev,
/* patch up vddc if necessary */ /* patch up vddc if necessary */
if (pl->vddc == 0xff01) { if (pl->vddc == 0xff01) {
if (radeon_atom_get_max_vddc(rdev, 0, 0, &vddc) == 0) if (pi->max_vddc)
pl->vddc = vddc; pl->vddc = pi->max_vddc;
} }
if (rps->class & ATOM_PPLIB_CLASSIFICATION_ACPI) { if (rps->class & ATOM_PPLIB_CLASSIFICATION_ACPI) {
...@@ -4322,7 +4321,8 @@ void ni_dpm_print_power_state(struct radeon_device *rdev, ...@@ -4322,7 +4321,8 @@ void ni_dpm_print_power_state(struct radeon_device *rdev,
void ni_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev, void ni_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev,
struct seq_file *m) struct seq_file *m)
{ {
struct radeon_ps *rps = rdev->pm.dpm.current_ps; struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
struct radeon_ps *rps = &eg_pi->current_rps;
struct ni_ps *ps = ni_get_ps(rps); struct ni_ps *ps = ni_get_ps(rps);
struct rv7xx_pl *pl; struct rv7xx_pl *pl;
u32 current_index = u32 current_index =
......
...@@ -3991,6 +3991,10 @@ int r600_irq_process(struct radeon_device *rdev) ...@@ -3991,6 +3991,10 @@ int r600_irq_process(struct radeon_device *rdev)
break; break;
} }
break; break;
case 124: /* UVD */
DRM_DEBUG("IH: UVD int: 0x%08x\n", src_data);
radeon_fence_process(rdev, R600_RING_TYPE_UVD_INDEX);
break;
case 176: /* CP_INT in ring buffer */ case 176: /* CP_INT in ring buffer */
case 177: /* CP_INT in IB1 */ case 177: /* CP_INT in IB1 */
case 178: /* CP_INT in IB2 */ case 178: /* CP_INT in IB2 */
......
...@@ -1555,7 +1555,7 @@ static struct radeon_asic btc_asic = { ...@@ -1555,7 +1555,7 @@ static struct radeon_asic btc_asic = {
.get_sclk = &btc_dpm_get_sclk, .get_sclk = &btc_dpm_get_sclk,
.get_mclk = &btc_dpm_get_mclk, .get_mclk = &btc_dpm_get_mclk,
.print_power_state = &rv770_dpm_print_power_state, .print_power_state = &rv770_dpm_print_power_state,
.debugfs_print_current_performance_level = &rv770_dpm_debugfs_print_current_performance_level, .debugfs_print_current_performance_level = &btc_dpm_debugfs_print_current_performance_level,
.force_performance_level = &rv770_dpm_force_performance_level, .force_performance_level = &rv770_dpm_force_performance_level,
.vblank_too_short = &btc_dpm_vblank_too_short, .vblank_too_short = &btc_dpm_vblank_too_short,
}, },
......
...@@ -551,6 +551,8 @@ void btc_dpm_fini(struct radeon_device *rdev); ...@@ -551,6 +551,8 @@ void btc_dpm_fini(struct radeon_device *rdev);
u32 btc_dpm_get_sclk(struct radeon_device *rdev, bool low); u32 btc_dpm_get_sclk(struct radeon_device *rdev, bool low);
u32 btc_dpm_get_mclk(struct radeon_device *rdev, bool low); u32 btc_dpm_get_mclk(struct radeon_device *rdev, bool low);
bool btc_dpm_vblank_too_short(struct radeon_device *rdev); bool btc_dpm_vblank_too_short(struct radeon_device *rdev);
void btc_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev,
struct seq_file *m);
int sumo_dpm_init(struct radeon_device *rdev); int sumo_dpm_init(struct radeon_device *rdev);
int sumo_dpm_enable(struct radeon_device *rdev); int sumo_dpm_enable(struct radeon_device *rdev);
int sumo_dpm_late_enable(struct radeon_device *rdev); int sumo_dpm_late_enable(struct radeon_device *rdev);
......
...@@ -2174,7 +2174,6 @@ static void rv7xx_parse_pplib_clock_info(struct radeon_device *rdev, ...@@ -2174,7 +2174,6 @@ static void rv7xx_parse_pplib_clock_info(struct radeon_device *rdev,
struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev); struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
struct rv7xx_ps *ps = rv770_get_ps(rps); struct rv7xx_ps *ps = rv770_get_ps(rps);
u32 sclk, mclk; u32 sclk, mclk;
u16 vddc;
struct rv7xx_pl *pl; struct rv7xx_pl *pl;
switch (index) { switch (index) {
...@@ -2214,8 +2213,8 @@ static void rv7xx_parse_pplib_clock_info(struct radeon_device *rdev, ...@@ -2214,8 +2213,8 @@ static void rv7xx_parse_pplib_clock_info(struct radeon_device *rdev,
/* patch up vddc if necessary */ /* patch up vddc if necessary */
if (pl->vddc == 0xff01) { if (pl->vddc == 0xff01) {
if (radeon_atom_get_max_vddc(rdev, 0, 0, &vddc) == 0) if (pi->max_vddc)
pl->vddc = vddc; pl->vddc = pi->max_vddc;
} }
if (rps->class & ATOM_PPLIB_CLASSIFICATION_ACPI) { if (rps->class & ATOM_PPLIB_CLASSIFICATION_ACPI) {
......
...@@ -6338,6 +6338,10 @@ int si_irq_process(struct radeon_device *rdev) ...@@ -6338,6 +6338,10 @@ int si_irq_process(struct radeon_device *rdev)
break; break;
} }
break; break;
case 124: /* UVD */
DRM_DEBUG("IH: UVD int: 0x%08x\n", src_data);
radeon_fence_process(rdev, R600_RING_TYPE_UVD_INDEX);
break;
case 146: case 146:
case 147: case 147:
addr = RREG32(VM_CONTEXT1_PROTECTION_FAULT_ADDR); addr = RREG32(VM_CONTEXT1_PROTECTION_FAULT_ADDR);
......
...@@ -6472,7 +6472,8 @@ void si_dpm_fini(struct radeon_device *rdev) ...@@ -6472,7 +6472,8 @@ void si_dpm_fini(struct radeon_device *rdev)
void si_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev, void si_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev,
struct seq_file *m) struct seq_file *m)
{ {
struct radeon_ps *rps = rdev->pm.dpm.current_ps; struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
struct radeon_ps *rps = &eg_pi->current_rps;
struct ni_ps *ps = ni_get_ps(rps); struct ni_ps *ps = ni_get_ps(rps);
struct rv7xx_pl *pl; struct rv7xx_pl *pl;
u32 current_index = u32 current_index =
......
...@@ -1807,7 +1807,7 @@ void sumo_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev ...@@ -1807,7 +1807,7 @@ void sumo_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev
struct seq_file *m) struct seq_file *m)
{ {
struct sumo_power_info *pi = sumo_get_pi(rdev); struct sumo_power_info *pi = sumo_get_pi(rdev);
struct radeon_ps *rps = rdev->pm.dpm.current_ps; struct radeon_ps *rps = &pi->current_rps;
struct sumo_ps *ps = sumo_get_ps(rps); struct sumo_ps *ps = sumo_get_ps(rps);
struct sumo_pl *pl; struct sumo_pl *pl;
u32 current_index = u32 current_index =
......
...@@ -1926,7 +1926,8 @@ void trinity_dpm_print_power_state(struct radeon_device *rdev, ...@@ -1926,7 +1926,8 @@ void trinity_dpm_print_power_state(struct radeon_device *rdev,
void trinity_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev, void trinity_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev,
struct seq_file *m) struct seq_file *m)
{ {
struct radeon_ps *rps = rdev->pm.dpm.current_ps; struct trinity_power_info *pi = trinity_get_pi(rdev);
struct radeon_ps *rps = &pi->current_rps;
struct trinity_ps *ps = trinity_get_ps(rps); struct trinity_ps *ps = trinity_get_ps(rps);
struct trinity_pl *pl; struct trinity_pl *pl;
u32 current_index = u32 current_index =
......
...@@ -57,7 +57,6 @@ void uvd_v2_2_fence_emit(struct radeon_device *rdev, ...@@ -57,7 +57,6 @@ void uvd_v2_2_fence_emit(struct radeon_device *rdev,
radeon_ring_write(ring, 0); radeon_ring_write(ring, 0);
radeon_ring_write(ring, PACKET0(UVD_GPCOM_VCPU_CMD, 0)); radeon_ring_write(ring, PACKET0(UVD_GPCOM_VCPU_CMD, 0));
radeon_ring_write(ring, 2); radeon_ring_write(ring, 2);
return;
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment