Commit 7a4ee320 authored by Dave Airlie's avatar Dave Airlie

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

a few more radeon fixes.

* 'drm-fixes-3.14' of git://people.freedesktop.org/~agd5f/linux:
  drm/radeon/dpm: fix typo in EVERGREEN_SMC_FIRMWARE_HEADER_softRegisters
  drm/radeon/cik: fix typo in documentation
  drm/radeon: silence GCC warning on 32 bit
  drm/radeon: resume old pm late
  drm/radeon: TTM must be init with cpu-visible VRAM, v2
parents 6d7c2a67 13714323
...@@ -3046,7 +3046,7 @@ static u32 cik_create_bitmask(u32 bit_width) ...@@ -3046,7 +3046,7 @@ static u32 cik_create_bitmask(u32 bit_width)
} }
/** /**
* cik_select_se_sh - select which SE, SH to address * cik_get_rb_disabled - computes the mask of disabled RBs
* *
* @rdev: radeon_device pointer * @rdev: radeon_device pointer
* @max_rb_num: max RBs (render backends) for the asic * @max_rb_num: max RBs (render backends) for the asic
...@@ -7902,6 +7902,7 @@ int cik_resume(struct radeon_device *rdev) ...@@ -7902,6 +7902,7 @@ int cik_resume(struct radeon_device *rdev)
/* init golden registers */ /* init golden registers */
cik_init_golden_registers(rdev); cik_init_golden_registers(rdev);
if (rdev->pm.pm_method == PM_METHOD_DPM)
radeon_pm_resume(rdev); radeon_pm_resume(rdev);
rdev->accel_working = true; rdev->accel_working = true;
......
...@@ -5299,6 +5299,7 @@ int evergreen_resume(struct radeon_device *rdev) ...@@ -5299,6 +5299,7 @@ int evergreen_resume(struct radeon_device *rdev)
/* init golden registers */ /* init golden registers */
evergreen_init_golden_registers(rdev); evergreen_init_golden_registers(rdev);
if (rdev->pm.pm_method == PM_METHOD_DPM)
radeon_pm_resume(rdev); radeon_pm_resume(rdev);
rdev->accel_working = true; rdev->accel_working = true;
......
...@@ -57,7 +57,7 @@ typedef struct SMC_Evergreen_MCRegisters SMC_Evergreen_MCRegisters; ...@@ -57,7 +57,7 @@ typedef struct SMC_Evergreen_MCRegisters SMC_Evergreen_MCRegisters;
#define EVERGREEN_SMC_FIRMWARE_HEADER_LOCATION 0x100 #define EVERGREEN_SMC_FIRMWARE_HEADER_LOCATION 0x100
#define EVERGREEN_SMC_FIRMWARE_HEADER_softRegisters 0x0 #define EVERGREEN_SMC_FIRMWARE_HEADER_softRegisters 0x8
#define EVERGREEN_SMC_FIRMWARE_HEADER_stateTable 0xC #define EVERGREEN_SMC_FIRMWARE_HEADER_stateTable 0xC
#define EVERGREEN_SMC_FIRMWARE_HEADER_mcRegisterTable 0x20 #define EVERGREEN_SMC_FIRMWARE_HEADER_mcRegisterTable 0x20
......
...@@ -2105,6 +2105,7 @@ int cayman_resume(struct radeon_device *rdev) ...@@ -2105,6 +2105,7 @@ int cayman_resume(struct radeon_device *rdev)
/* init golden registers */ /* init golden registers */
ni_init_golden_registers(rdev); ni_init_golden_registers(rdev);
if (rdev->pm.pm_method == PM_METHOD_DPM)
radeon_pm_resume(rdev); radeon_pm_resume(rdev);
rdev->accel_working = true; rdev->accel_working = true;
......
...@@ -3942,8 +3942,6 @@ int r100_resume(struct radeon_device *rdev) ...@@ -3942,8 +3942,6 @@ int r100_resume(struct radeon_device *rdev)
/* Initialize surface registers */ /* Initialize surface registers */
radeon_surface_init(rdev); radeon_surface_init(rdev);
radeon_pm_resume(rdev);
rdev->accel_working = true; rdev->accel_working = true;
r = r100_startup(rdev); r = r100_startup(rdev);
if (r) { if (r) {
......
...@@ -1430,8 +1430,6 @@ int r300_resume(struct radeon_device *rdev) ...@@ -1430,8 +1430,6 @@ int r300_resume(struct radeon_device *rdev)
/* Initialize surface registers */ /* Initialize surface registers */
radeon_surface_init(rdev); radeon_surface_init(rdev);
radeon_pm_resume(rdev);
rdev->accel_working = true; rdev->accel_working = true;
r = r300_startup(rdev); r = r300_startup(rdev);
if (r) { if (r) {
......
...@@ -325,8 +325,6 @@ int r420_resume(struct radeon_device *rdev) ...@@ -325,8 +325,6 @@ int r420_resume(struct radeon_device *rdev)
/* Initialize surface registers */ /* Initialize surface registers */
radeon_surface_init(rdev); radeon_surface_init(rdev);
radeon_pm_resume(rdev);
rdev->accel_working = true; rdev->accel_working = true;
r = r420_startup(rdev); r = r420_startup(rdev);
if (r) { if (r) {
......
...@@ -240,8 +240,6 @@ int r520_resume(struct radeon_device *rdev) ...@@ -240,8 +240,6 @@ int r520_resume(struct radeon_device *rdev)
/* Initialize surface registers */ /* Initialize surface registers */
radeon_surface_init(rdev); radeon_surface_init(rdev);
radeon_pm_resume(rdev);
rdev->accel_working = true; rdev->accel_working = true;
r = r520_startup(rdev); r = r520_startup(rdev);
if (r) { if (r) {
......
...@@ -2968,6 +2968,7 @@ int r600_resume(struct radeon_device *rdev) ...@@ -2968,6 +2968,7 @@ int r600_resume(struct radeon_device *rdev)
/* post card */ /* post card */
atom_asic_init(rdev->mode_info.atom_context); atom_asic_init(rdev->mode_info.atom_context);
if (rdev->pm.pm_method == PM_METHOD_DPM)
radeon_pm_resume(rdev); radeon_pm_resume(rdev);
rdev->accel_working = true; rdev->accel_working = true;
......
...@@ -1521,13 +1521,16 @@ int radeon_resume_kms(struct drm_device *dev, bool resume, bool fbcon) ...@@ -1521,13 +1521,16 @@ int radeon_resume_kms(struct drm_device *dev, bool resume, bool fbcon)
if (r) if (r)
DRM_ERROR("ib ring test failed (%d).\n", r); DRM_ERROR("ib ring test failed (%d).\n", r);
if (rdev->pm.dpm_enabled) { if ((rdev->pm.pm_method == PM_METHOD_DPM) && rdev->pm.dpm_enabled) {
/* do dpm late init */ /* do dpm late init */
r = radeon_pm_late_init(rdev); r = radeon_pm_late_init(rdev);
if (r) { if (r) {
rdev->pm.dpm_enabled = false; rdev->pm.dpm_enabled = false;
DRM_ERROR("radeon_pm_late_init failed, disabling dpm\n"); DRM_ERROR("radeon_pm_late_init failed, disabling dpm\n");
} }
} else {
/* resume old pm late */
radeon_pm_resume(rdev);
} }
radeon_restore_bios_scratch_regs(rdev); radeon_restore_bios_scratch_regs(rdev);
......
...@@ -714,6 +714,9 @@ int radeon_ttm_init(struct radeon_device *rdev) ...@@ -714,6 +714,9 @@ int radeon_ttm_init(struct radeon_device *rdev)
DRM_ERROR("Failed initializing VRAM heap.\n"); DRM_ERROR("Failed initializing VRAM heap.\n");
return r; return r;
} }
/* Change the size here instead of the init above so only lpfn is affected */
radeon_ttm_set_active_vram_size(rdev, rdev->mc.visible_vram_size);
r = radeon_bo_create(rdev, 256 * 1024, PAGE_SIZE, true, r = radeon_bo_create(rdev, 256 * 1024, PAGE_SIZE, true,
RADEON_GEM_DOMAIN_VRAM, RADEON_GEM_DOMAIN_VRAM,
NULL, &rdev->stollen_vga_memory); NULL, &rdev->stollen_vga_memory);
...@@ -935,7 +938,7 @@ static ssize_t radeon_ttm_gtt_read(struct file *f, char __user *buf, ...@@ -935,7 +938,7 @@ static ssize_t radeon_ttm_gtt_read(struct file *f, char __user *buf,
while (size) { while (size) {
loff_t p = *pos / PAGE_SIZE; loff_t p = *pos / PAGE_SIZE;
unsigned off = *pos & ~PAGE_MASK; unsigned off = *pos & ~PAGE_MASK;
ssize_t cur_size = min(size, PAGE_SIZE - off); size_t cur_size = min_t(size_t, size, PAGE_SIZE - off);
struct page *page; struct page *page;
void *ptr; void *ptr;
......
...@@ -474,8 +474,6 @@ int rs400_resume(struct radeon_device *rdev) ...@@ -474,8 +474,6 @@ int rs400_resume(struct radeon_device *rdev)
/* Initialize surface registers */ /* Initialize surface registers */
radeon_surface_init(rdev); radeon_surface_init(rdev);
radeon_pm_resume(rdev);
rdev->accel_working = true; rdev->accel_working = true;
r = rs400_startup(rdev); r = rs400_startup(rdev);
if (r) { if (r) {
......
...@@ -1048,8 +1048,6 @@ int rs600_resume(struct radeon_device *rdev) ...@@ -1048,8 +1048,6 @@ int rs600_resume(struct radeon_device *rdev)
/* Initialize surface registers */ /* Initialize surface registers */
radeon_surface_init(rdev); radeon_surface_init(rdev);
radeon_pm_resume(rdev);
rdev->accel_working = true; rdev->accel_working = true;
r = rs600_startup(rdev); r = rs600_startup(rdev);
if (r) { if (r) {
......
...@@ -756,8 +756,6 @@ int rs690_resume(struct radeon_device *rdev) ...@@ -756,8 +756,6 @@ int rs690_resume(struct radeon_device *rdev)
/* Initialize surface registers */ /* Initialize surface registers */
radeon_surface_init(rdev); radeon_surface_init(rdev);
radeon_pm_resume(rdev);
rdev->accel_working = true; rdev->accel_working = true;
r = rs690_startup(rdev); r = rs690_startup(rdev);
if (r) { if (r) {
......
...@@ -586,8 +586,6 @@ int rv515_resume(struct radeon_device *rdev) ...@@ -586,8 +586,6 @@ int rv515_resume(struct radeon_device *rdev)
/* Initialize surface registers */ /* Initialize surface registers */
radeon_surface_init(rdev); radeon_surface_init(rdev);
radeon_pm_resume(rdev);
rdev->accel_working = true; rdev->accel_working = true;
r = rv515_startup(rdev); r = rv515_startup(rdev);
if (r) { if (r) {
......
...@@ -1811,6 +1811,7 @@ int rv770_resume(struct radeon_device *rdev) ...@@ -1811,6 +1811,7 @@ int rv770_resume(struct radeon_device *rdev)
/* init golden registers */ /* init golden registers */
rv770_init_golden_registers(rdev); rv770_init_golden_registers(rdev);
if (rdev->pm.pm_method == PM_METHOD_DPM)
radeon_pm_resume(rdev); radeon_pm_resume(rdev);
rdev->accel_working = true; rdev->accel_working = true;
......
...@@ -6618,6 +6618,7 @@ int si_resume(struct radeon_device *rdev) ...@@ -6618,6 +6618,7 @@ int si_resume(struct radeon_device *rdev)
/* init golden registers */ /* init golden registers */
si_init_golden_registers(rdev); si_init_golden_registers(rdev);
if (rdev->pm.pm_method == PM_METHOD_DPM)
radeon_pm_resume(rdev); radeon_pm_resume(rdev);
rdev->accel_working = true; rdev->accel_working = true;
......
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