提交 a56f31a0 编写于 作者: L Linus Torvalds

Merge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6

* 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
  drm/radeon/kms: Silent spurious error message
  drm/radeon/kms: fix bad cast/shift in evergreen.c
  drm/radeon/kms: make TV/DFP table info less verbose
  drm/radeon/kms: leave certain CP int bits enabled
  drm/radeon/kms: avoid corner case issue with unmappable vram V2
...@@ -1137,7 +1137,7 @@ static void evergreen_gpu_init(struct radeon_device *rdev) ...@@ -1137,7 +1137,7 @@ static void evergreen_gpu_init(struct radeon_device *rdev)
WREG32(RCU_IND_INDEX, 0x203); WREG32(RCU_IND_INDEX, 0x203);
efuse_straps_3 = RREG32(RCU_IND_DATA); efuse_straps_3 = RREG32(RCU_IND_DATA);
efuse_box_bit_127_124 = (u8)(efuse_straps_3 & 0xF0000000) >> 28; efuse_box_bit_127_124 = (u8)((efuse_straps_3 & 0xF0000000) >> 28);
switch(efuse_box_bit_127_124) { switch(efuse_box_bit_127_124) {
case 0x0: case 0x0:
...@@ -1407,6 +1407,7 @@ int evergreen_mc_init(struct radeon_device *rdev) ...@@ -1407,6 +1407,7 @@ int evergreen_mc_init(struct radeon_device *rdev)
rdev->mc.mc_vram_size = RREG32(CONFIG_MEMSIZE) * 1024 * 1024; rdev->mc.mc_vram_size = RREG32(CONFIG_MEMSIZE) * 1024 * 1024;
rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE) * 1024 * 1024; rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE) * 1024 * 1024;
rdev->mc.visible_vram_size = rdev->mc.aper_size; rdev->mc.visible_vram_size = rdev->mc.aper_size;
rdev->mc.active_vram_size = rdev->mc.visible_vram_size;
r600_vram_gtt_location(rdev, &rdev->mc); r600_vram_gtt_location(rdev, &rdev->mc);
radeon_update_bandwidth_info(rdev); radeon_update_bandwidth_info(rdev);
...@@ -1520,7 +1521,7 @@ void evergreen_disable_interrupt_state(struct radeon_device *rdev) ...@@ -1520,7 +1521,7 @@ void evergreen_disable_interrupt_state(struct radeon_device *rdev)
{ {
u32 tmp; u32 tmp;
WREG32(CP_INT_CNTL, 0); WREG32(CP_INT_CNTL, CNTX_BUSY_INT_ENABLE | CNTX_EMPTY_INT_ENABLE);
WREG32(GRBM_INT_CNTL, 0); WREG32(GRBM_INT_CNTL, 0);
WREG32(INT_MASK + EVERGREEN_CRTC0_REGISTER_OFFSET, 0); WREG32(INT_MASK + EVERGREEN_CRTC0_REGISTER_OFFSET, 0);
WREG32(INT_MASK + EVERGREEN_CRTC1_REGISTER_OFFSET, 0); WREG32(INT_MASK + EVERGREEN_CRTC1_REGISTER_OFFSET, 0);
......
...@@ -1030,6 +1030,7 @@ int r100_cp_init(struct radeon_device *rdev, unsigned ring_size) ...@@ -1030,6 +1030,7 @@ int r100_cp_init(struct radeon_device *rdev, unsigned ring_size)
return r; return r;
} }
rdev->cp.ready = true; rdev->cp.ready = true;
rdev->mc.active_vram_size = rdev->mc.real_vram_size;
return 0; return 0;
} }
...@@ -1047,6 +1048,7 @@ void r100_cp_fini(struct radeon_device *rdev) ...@@ -1047,6 +1048,7 @@ void r100_cp_fini(struct radeon_device *rdev)
void r100_cp_disable(struct radeon_device *rdev) void r100_cp_disable(struct radeon_device *rdev)
{ {
/* Disable ring */ /* Disable ring */
rdev->mc.active_vram_size = rdev->mc.visible_vram_size;
rdev->cp.ready = false; rdev->cp.ready = false;
WREG32(RADEON_CP_CSQ_MODE, 0); WREG32(RADEON_CP_CSQ_MODE, 0);
WREG32(RADEON_CP_CSQ_CNTL, 0); WREG32(RADEON_CP_CSQ_CNTL, 0);
...@@ -2295,6 +2297,7 @@ void r100_vram_init_sizes(struct radeon_device *rdev) ...@@ -2295,6 +2297,7 @@ void r100_vram_init_sizes(struct radeon_device *rdev)
/* FIXME we don't use the second aperture yet when we could use it */ /* FIXME we don't use the second aperture yet when we could use it */
if (rdev->mc.visible_vram_size > rdev->mc.aper_size) if (rdev->mc.visible_vram_size > rdev->mc.aper_size)
rdev->mc.visible_vram_size = rdev->mc.aper_size; rdev->mc.visible_vram_size = rdev->mc.aper_size;
rdev->mc.active_vram_size = rdev->mc.visible_vram_size;
config_aper_size = RREG32(RADEON_CONFIG_APER_SIZE); config_aper_size = RREG32(RADEON_CONFIG_APER_SIZE);
if (rdev->flags & RADEON_IS_IGP) { if (rdev->flags & RADEON_IS_IGP) {
uint32_t tom; uint32_t tom;
......
...@@ -1248,6 +1248,7 @@ int r600_mc_init(struct radeon_device *rdev) ...@@ -1248,6 +1248,7 @@ int r600_mc_init(struct radeon_device *rdev)
rdev->mc.mc_vram_size = RREG32(CONFIG_MEMSIZE); rdev->mc.mc_vram_size = RREG32(CONFIG_MEMSIZE);
rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE); rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE);
rdev->mc.visible_vram_size = rdev->mc.aper_size; rdev->mc.visible_vram_size = rdev->mc.aper_size;
rdev->mc.active_vram_size = rdev->mc.visible_vram_size;
r600_vram_gtt_location(rdev, &rdev->mc); r600_vram_gtt_location(rdev, &rdev->mc);
if (rdev->flags & RADEON_IS_IGP) { if (rdev->flags & RADEON_IS_IGP) {
...@@ -1917,6 +1918,7 @@ void r600_pciep_wreg(struct radeon_device *rdev, u32 reg, u32 v) ...@@ -1917,6 +1918,7 @@ void r600_pciep_wreg(struct radeon_device *rdev, u32 reg, u32 v)
*/ */
void r600_cp_stop(struct radeon_device *rdev) void r600_cp_stop(struct radeon_device *rdev)
{ {
rdev->mc.active_vram_size = rdev->mc.visible_vram_size;
WREG32(R_0086D8_CP_ME_CNTL, S_0086D8_CP_ME_HALT(1)); WREG32(R_0086D8_CP_ME_CNTL, S_0086D8_CP_ME_HALT(1));
} }
...@@ -2910,7 +2912,7 @@ static void r600_disable_interrupt_state(struct radeon_device *rdev) ...@@ -2910,7 +2912,7 @@ static void r600_disable_interrupt_state(struct radeon_device *rdev)
{ {
u32 tmp; u32 tmp;
WREG32(CP_INT_CNTL, 0); WREG32(CP_INT_CNTL, CNTX_BUSY_INT_ENABLE | CNTX_EMPTY_INT_ENABLE);
WREG32(GRBM_INT_CNTL, 0); WREG32(GRBM_INT_CNTL, 0);
WREG32(DxMODE_INT_MASK, 0); WREG32(DxMODE_INT_MASK, 0);
if (ASIC_IS_DCE3(rdev)) { if (ASIC_IS_DCE3(rdev)) {
......
...@@ -532,6 +532,7 @@ int r600_blit_init(struct radeon_device *rdev) ...@@ -532,6 +532,7 @@ int r600_blit_init(struct radeon_device *rdev)
memcpy(ptr + rdev->r600_blit.ps_offset, r6xx_ps, r6xx_ps_size * 4); memcpy(ptr + rdev->r600_blit.ps_offset, r6xx_ps, r6xx_ps_size * 4);
radeon_bo_kunmap(rdev->r600_blit.shader_obj); radeon_bo_kunmap(rdev->r600_blit.shader_obj);
radeon_bo_unreserve(rdev->r600_blit.shader_obj); radeon_bo_unreserve(rdev->r600_blit.shader_obj);
rdev->mc.active_vram_size = rdev->mc.real_vram_size;
return 0; return 0;
} }
...@@ -539,6 +540,7 @@ void r600_blit_fini(struct radeon_device *rdev) ...@@ -539,6 +540,7 @@ void r600_blit_fini(struct radeon_device *rdev)
{ {
int r; int r;
rdev->mc.active_vram_size = rdev->mc.visible_vram_size;
if (rdev->r600_blit.shader_obj == NULL) if (rdev->r600_blit.shader_obj == NULL)
return; return;
/* If we can't reserve the bo, unref should be enough to destroy /* If we can't reserve the bo, unref should be enough to destroy
......
...@@ -344,6 +344,7 @@ struct radeon_mc { ...@@ -344,6 +344,7 @@ struct radeon_mc {
* about vram size near mc fb location */ * about vram size near mc fb location */
u64 mc_vram_size; u64 mc_vram_size;
u64 visible_vram_size; u64 visible_vram_size;
u64 active_vram_size;
u64 gtt_size; u64 gtt_size;
u64 gtt_start; u64 gtt_start;
u64 gtt_end; u64 gtt_end;
......
...@@ -1558,39 +1558,39 @@ radeon_atombios_get_tv_info(struct radeon_device *rdev) ...@@ -1558,39 +1558,39 @@ radeon_atombios_get_tv_info(struct radeon_device *rdev)
switch (tv_info->ucTV_BootUpDefaultStandard) { switch (tv_info->ucTV_BootUpDefaultStandard) {
case ATOM_TV_NTSC: case ATOM_TV_NTSC:
tv_std = TV_STD_NTSC; tv_std = TV_STD_NTSC;
DRM_INFO("Default TV standard: NTSC\n"); DRM_DEBUG_KMS("Default TV standard: NTSC\n");
break; break;
case ATOM_TV_NTSCJ: case ATOM_TV_NTSCJ:
tv_std = TV_STD_NTSC_J; tv_std = TV_STD_NTSC_J;
DRM_INFO("Default TV standard: NTSC-J\n"); DRM_DEBUG_KMS("Default TV standard: NTSC-J\n");
break; break;
case ATOM_TV_PAL: case ATOM_TV_PAL:
tv_std = TV_STD_PAL; tv_std = TV_STD_PAL;
DRM_INFO("Default TV standard: PAL\n"); DRM_DEBUG_KMS("Default TV standard: PAL\n");
break; break;
case ATOM_TV_PALM: case ATOM_TV_PALM:
tv_std = TV_STD_PAL_M; tv_std = TV_STD_PAL_M;
DRM_INFO("Default TV standard: PAL-M\n"); DRM_DEBUG_KMS("Default TV standard: PAL-M\n");
break; break;
case ATOM_TV_PALN: case ATOM_TV_PALN:
tv_std = TV_STD_PAL_N; tv_std = TV_STD_PAL_N;
DRM_INFO("Default TV standard: PAL-N\n"); DRM_DEBUG_KMS("Default TV standard: PAL-N\n");
break; break;
case ATOM_TV_PALCN: case ATOM_TV_PALCN:
tv_std = TV_STD_PAL_CN; tv_std = TV_STD_PAL_CN;
DRM_INFO("Default TV standard: PAL-CN\n"); DRM_DEBUG_KMS("Default TV standard: PAL-CN\n");
break; break;
case ATOM_TV_PAL60: case ATOM_TV_PAL60:
tv_std = TV_STD_PAL_60; tv_std = TV_STD_PAL_60;
DRM_INFO("Default TV standard: PAL-60\n"); DRM_DEBUG_KMS("Default TV standard: PAL-60\n");
break; break;
case ATOM_TV_SECAM: case ATOM_TV_SECAM:
tv_std = TV_STD_SECAM; tv_std = TV_STD_SECAM;
DRM_INFO("Default TV standard: SECAM\n"); DRM_DEBUG_KMS("Default TV standard: SECAM\n");
break; break;
default: default:
tv_std = TV_STD_NTSC; tv_std = TV_STD_NTSC;
DRM_INFO("Unknown TV standard; defaulting to NTSC\n"); DRM_DEBUG_KMS("Unknown TV standard; defaulting to NTSC\n");
break; break;
} }
} }
......
...@@ -913,47 +913,47 @@ radeon_combios_get_tv_info(struct radeon_device *rdev) ...@@ -913,47 +913,47 @@ radeon_combios_get_tv_info(struct radeon_device *rdev)
switch (RBIOS8(tv_info + 7) & 0xf) { switch (RBIOS8(tv_info + 7) & 0xf) {
case 1: case 1:
tv_std = TV_STD_NTSC; tv_std = TV_STD_NTSC;
DRM_INFO("Default TV standard: NTSC\n"); DRM_DEBUG_KMS("Default TV standard: NTSC\n");
break; break;
case 2: case 2:
tv_std = TV_STD_PAL; tv_std = TV_STD_PAL;
DRM_INFO("Default TV standard: PAL\n"); DRM_DEBUG_KMS("Default TV standard: PAL\n");
break; break;
case 3: case 3:
tv_std = TV_STD_PAL_M; tv_std = TV_STD_PAL_M;
DRM_INFO("Default TV standard: PAL-M\n"); DRM_DEBUG_KMS("Default TV standard: PAL-M\n");
break; break;
case 4: case 4:
tv_std = TV_STD_PAL_60; tv_std = TV_STD_PAL_60;
DRM_INFO("Default TV standard: PAL-60\n"); DRM_DEBUG_KMS("Default TV standard: PAL-60\n");
break; break;
case 5: case 5:
tv_std = TV_STD_NTSC_J; tv_std = TV_STD_NTSC_J;
DRM_INFO("Default TV standard: NTSC-J\n"); DRM_DEBUG_KMS("Default TV standard: NTSC-J\n");
break; break;
case 6: case 6:
tv_std = TV_STD_SCART_PAL; tv_std = TV_STD_SCART_PAL;
DRM_INFO("Default TV standard: SCART-PAL\n"); DRM_DEBUG_KMS("Default TV standard: SCART-PAL\n");
break; break;
default: default:
tv_std = TV_STD_NTSC; tv_std = TV_STD_NTSC;
DRM_INFO DRM_DEBUG_KMS
("Unknown TV standard; defaulting to NTSC\n"); ("Unknown TV standard; defaulting to NTSC\n");
break; break;
} }
switch ((RBIOS8(tv_info + 9) >> 2) & 0x3) { switch ((RBIOS8(tv_info + 9) >> 2) & 0x3) {
case 0: case 0:
DRM_INFO("29.498928713 MHz TV ref clk\n"); DRM_DEBUG_KMS("29.498928713 MHz TV ref clk\n");
break; break;
case 1: case 1:
DRM_INFO("28.636360000 MHz TV ref clk\n"); DRM_DEBUG_KMS("28.636360000 MHz TV ref clk\n");
break; break;
case 2: case 2:
DRM_INFO("14.318180000 MHz TV ref clk\n"); DRM_DEBUG_KMS("14.318180000 MHz TV ref clk\n");
break; break;
case 3: case 3:
DRM_INFO("27.000000000 MHz TV ref clk\n"); DRM_DEBUG_KMS("27.000000000 MHz TV ref clk\n");
break; break;
default: default:
break; break;
...@@ -1324,7 +1324,7 @@ bool radeon_legacy_get_tmds_info_from_combios(struct radeon_encoder *encoder, ...@@ -1324,7 +1324,7 @@ bool radeon_legacy_get_tmds_info_from_combios(struct radeon_encoder *encoder,
if (tmds_info) { if (tmds_info) {
ver = RBIOS8(tmds_info); ver = RBIOS8(tmds_info);
DRM_INFO("DFP table revision: %d\n", ver); DRM_DEBUG_KMS("DFP table revision: %d\n", ver);
if (ver == 3) { if (ver == 3) {
n = RBIOS8(tmds_info + 5) + 1; n = RBIOS8(tmds_info + 5) + 1;
if (n > 4) if (n > 4)
...@@ -1408,7 +1408,7 @@ bool radeon_legacy_get_ext_tmds_info_from_combios(struct radeon_encoder *encoder ...@@ -1408,7 +1408,7 @@ bool radeon_legacy_get_ext_tmds_info_from_combios(struct radeon_encoder *encoder
offset = combios_get_table_offset(dev, COMBIOS_EXT_TMDS_INFO_TABLE); offset = combios_get_table_offset(dev, COMBIOS_EXT_TMDS_INFO_TABLE);
if (offset) { if (offset) {
ver = RBIOS8(offset); ver = RBIOS8(offset);
DRM_INFO("External TMDS Table revision: %d\n", ver); DRM_DEBUG_KMS("External TMDS Table revision: %d\n", ver);
tmds->slave_addr = RBIOS8(offset + 4 + 2); tmds->slave_addr = RBIOS8(offset + 4 + 2);
tmds->slave_addr >>= 1; /* 7 bit addressing */ tmds->slave_addr >>= 1; /* 7 bit addressing */
gpio = RBIOS8(offset + 4 + 3); gpio = RBIOS8(offset + 4 + 3);
......
...@@ -69,7 +69,7 @@ void radeon_ttm_placement_from_domain(struct radeon_bo *rbo, u32 domain) ...@@ -69,7 +69,7 @@ void radeon_ttm_placement_from_domain(struct radeon_bo *rbo, u32 domain)
u32 c = 0; u32 c = 0;
rbo->placement.fpfn = 0; rbo->placement.fpfn = 0;
rbo->placement.lpfn = 0; rbo->placement.lpfn = rbo->rdev->mc.active_vram_size >> PAGE_SHIFT;
rbo->placement.placement = rbo->placements; rbo->placement.placement = rbo->placements;
rbo->placement.busy_placement = rbo->placements; rbo->placement.busy_placement = rbo->placements;
if (domain & RADEON_GEM_DOMAIN_VRAM) if (domain & RADEON_GEM_DOMAIN_VRAM)
......
...@@ -124,11 +124,8 @@ static inline int radeon_bo_wait(struct radeon_bo *bo, u32 *mem_type, ...@@ -124,11 +124,8 @@ static inline int radeon_bo_wait(struct radeon_bo *bo, u32 *mem_type,
int r; int r;
r = ttm_bo_reserve(&bo->tbo, true, no_wait, false, 0); r = ttm_bo_reserve(&bo->tbo, true, no_wait, false, 0);
if (unlikely(r != 0)) { if (unlikely(r != 0))
if (r != -ERESTARTSYS)
dev_err(bo->rdev->dev, "%p reserve failed for wait\n", bo);
return r; return r;
}
spin_lock(&bo->tbo.lock); spin_lock(&bo->tbo.lock);
if (mem_type) if (mem_type)
*mem_type = bo->tbo.mem.mem_type; *mem_type = bo->tbo.mem.mem_type;
......
...@@ -693,6 +693,7 @@ void rs600_mc_init(struct radeon_device *rdev) ...@@ -693,6 +693,7 @@ void rs600_mc_init(struct radeon_device *rdev)
rdev->mc.real_vram_size = RREG32(RADEON_CONFIG_MEMSIZE); rdev->mc.real_vram_size = RREG32(RADEON_CONFIG_MEMSIZE);
rdev->mc.mc_vram_size = rdev->mc.real_vram_size; rdev->mc.mc_vram_size = rdev->mc.real_vram_size;
rdev->mc.visible_vram_size = rdev->mc.aper_size; rdev->mc.visible_vram_size = rdev->mc.aper_size;
rdev->mc.active_vram_size = rdev->mc.visible_vram_size;
rdev->mc.igp_sideport_enabled = radeon_atombios_sideport_present(rdev); rdev->mc.igp_sideport_enabled = radeon_atombios_sideport_present(rdev);
base = RREG32_MC(R_000004_MC_FB_LOCATION); base = RREG32_MC(R_000004_MC_FB_LOCATION);
base = G_000004_MC_FB_START(base) << 16; base = G_000004_MC_FB_START(base) << 16;
......
...@@ -157,6 +157,7 @@ void rs690_mc_init(struct radeon_device *rdev) ...@@ -157,6 +157,7 @@ void rs690_mc_init(struct radeon_device *rdev)
rdev->mc.aper_base = pci_resource_start(rdev->pdev, 0); rdev->mc.aper_base = pci_resource_start(rdev->pdev, 0);
rdev->mc.aper_size = pci_resource_len(rdev->pdev, 0); rdev->mc.aper_size = pci_resource_len(rdev->pdev, 0);
rdev->mc.visible_vram_size = rdev->mc.aper_size; rdev->mc.visible_vram_size = rdev->mc.aper_size;
rdev->mc.active_vram_size = rdev->mc.visible_vram_size;
base = RREG32_MC(R_000100_MCCFG_FB_LOCATION); base = RREG32_MC(R_000100_MCCFG_FB_LOCATION);
base = G_000100_MC_FB_START(base) << 16; base = G_000100_MC_FB_START(base) << 16;
rdev->mc.igp_sideport_enabled = radeon_atombios_sideport_present(rdev); rdev->mc.igp_sideport_enabled = radeon_atombios_sideport_present(rdev);
......
...@@ -267,6 +267,7 @@ static void rv770_mc_program(struct radeon_device *rdev) ...@@ -267,6 +267,7 @@ static void rv770_mc_program(struct radeon_device *rdev)
*/ */
void r700_cp_stop(struct radeon_device *rdev) void r700_cp_stop(struct radeon_device *rdev)
{ {
rdev->mc.active_vram_size = rdev->mc.visible_vram_size;
WREG32(CP_ME_CNTL, (CP_ME_HALT | CP_PFP_HALT)); WREG32(CP_ME_CNTL, (CP_ME_HALT | CP_PFP_HALT));
} }
...@@ -992,6 +993,7 @@ int rv770_mc_init(struct radeon_device *rdev) ...@@ -992,6 +993,7 @@ int rv770_mc_init(struct radeon_device *rdev)
rdev->mc.mc_vram_size = RREG32(CONFIG_MEMSIZE); rdev->mc.mc_vram_size = RREG32(CONFIG_MEMSIZE);
rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE); rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE);
rdev->mc.visible_vram_size = rdev->mc.aper_size; rdev->mc.visible_vram_size = rdev->mc.aper_size;
rdev->mc.active_vram_size = rdev->mc.visible_vram_size;
r600_vram_gtt_location(rdev, &rdev->mc); r600_vram_gtt_location(rdev, &rdev->mc);
radeon_update_bandwidth_info(rdev); radeon_update_bandwidth_info(rdev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册