44 #include "rs600_reg_safe.h"
49 static const u32 crtc_offsets[2] =
110 DRM_DEBUG(
"Update pending now high. Unlocking vupdate_lock.\n");
122 int requested_index = rdev->
pm.requested_power_state_index;
125 u32 tmp, dyn_pwrmgt_sclk_length, dyn_sclk_vol_cntl;
126 u32 hdp_dyn_cntl, dyn_backbias_cntl;
132 tmp |= voltage->
gpio.mask;
134 tmp &= ~(voltage->
gpio.mask);
141 tmp &= ~voltage->
gpio.mask;
143 tmp |= voltage->
gpio.mask;
171 if (voltage->
delay) {
205 rdev->
asic->pm.set_pcie_lanes &&
207 rdev->
pm.power_state[rdev->
pm.current_power_state_index].pcie_lanes)) {
210 DRM_DEBUG(
"Setting: p: %d\n", ps->
pcie_lanes);
254 bool connected =
false;
309 switch (radeon_connector->
hpd.hpd) {
321 enable |= 1 << radeon_connector->
hpd.hpd;
335 switch (radeon_connector->
hpd.hpd) {
347 disable |= 1 << radeon_connector->
hpd.hpd;
365 dev_info(rdev->
dev,
"(%s:%d) RBBM_STATUS=0x%08X\n", __func__, __LINE__, status);
385 dev_info(rdev->
dev,
"(%s:%d) RBBM_STATUS=0x%08X\n", __func__, __LINE__, status);
393 dev_info(rdev->
dev,
"(%s:%d) RBBM_STATUS=0x%08X\n", __func__, __LINE__, status);
401 dev_info(rdev->
dev,
"(%s:%d) RBBM_STATUS=0x%08X\n", __func__, __LINE__, status);
439 if (rdev->
gart.robj) {
440 WARN(1,
"RS600 GART already initialized\n");
448 rdev->
gart.table_size = rdev->
gart.num_gpu_pages * 8;
458 dev_err(rdev->
dev,
"No VRAM object for PCIE GART.\n");
473 for (i = 0; i < 19; i++) {
490 for (i = 1; i < 8; i++)
495 rdev->
gart.table_addr);
510 DRM_INFO(
"PCIE GART of %uM enabled (table at 0x%016llX).\n",
511 (
unsigned)(rdev->
mc.gtt_size >> 20),
512 (
unsigned long long)rdev->
gart.table_addr);
513 rdev->
gart.ready =
true;
531 rs600_gart_disable(rdev);
535 #define R600_PTE_VALID (1 << 0)
536 #define R600_PTE_SYSTEM (1 << 1)
537 #define R600_PTE_SNOOPED (1 << 2)
538 #define R600_PTE_READABLE (1 << 5)
539 #define R600_PTE_WRITEABLE (1 << 6)
545 if (i < 0 || i > rdev->
gart.num_gpu_pages) {
548 addr = addr & 0xFFFFFFFFFFFFF000ULL;
551 writeq(addr, ptr + (i * 8));
570 if (!rdev->
irq.installed) {
571 WARN(1,
"Can't enable IRQ/MSI because no handler is installed\n");
578 if (rdev->
irq.crtc_vblank_int[0] ||
582 if (rdev->
irq.crtc_vblank_int[1] ||
586 if (rdev->
irq.hpd[0]) {
589 if (rdev->
irq.hpd[1]) {
592 if (rdev->
irq.afmt[0]) {
631 rdev->
irq.stat_regs.r500.disp_int = 0;
643 rdev->
irq.stat_regs.r500.hdmi0_status = 0;
648 return irqs & irq_mask;
666 bool queue_hotplug =
false;
667 bool queue_hdmi =
false;
669 status = rs600_irq_ack(rdev);
671 !rdev->
irq.stat_regs.r500.disp_int &&
672 !rdev->
irq.stat_regs.r500.hdmi0_status) {
676 rdev->
irq.stat_regs.r500.disp_int ||
677 rdev->
irq.stat_regs.r500.hdmi0_status) {
684 if (rdev->
irq.crtc_vblank_int[0]) {
686 rdev->
pm.vblank_sync =
true;
693 if (rdev->
irq.crtc_vblank_int[1]) {
695 rdev->
pm.vblank_sync =
true;
702 queue_hotplug =
true;
706 queue_hotplug =
true;
711 DRM_DEBUG(
"HDMI0\n");
713 status = rs600_irq_ack(rdev);
761 dev_warn(rdev->
dev,
"Wait MC idle timeout before updating MC.\n");
770 rdev->
mc.vram_is_ddr =
true;
771 rdev->
mc.vram_width = 128;
773 rdev->
mc.mc_vram_size = rdev->
mc.real_vram_size;
774 rdev->
mc.visible_vram_size = rdev->
mc.aper_size;
779 rdev->
mc.gtt_base_align = 0;
788 u32 d1mode_priority_a_cnt, d2mode_priority_a_cnt;
793 if (rdev->
mode_info.crtcs[0]->base.enabled)
794 mode0 = &rdev->
mode_info.crtcs[0]->base.mode;
795 if (rdev->
mode_info.crtcs[1]->base.enabled)
796 mode1 = &rdev->
mode_info.crtcs[1]->base.mode;
829 DRM_ERROR(
"Failed to register debugfs file for RBBM !\n");
834 rdev->
config.
r300.reg_safe_bm = rs600_reg_safe_bm;
847 dev_warn(rdev->
dev,
"Wait MC idle timeout before updating MC.\n");
867 rs600_mc_program(rdev);
871 rs600_gpu_init(rdev);
874 r = rs600_gart_enable(rdev);
885 dev_err(rdev->
dev,
"failed initializing CP fences (%d).\n", r);
895 dev_err(rdev->
dev,
"failed initializing CP (%d).\n", r);
901 dev_err(rdev->
dev,
"IB initialization failed (%d).\n", r);
907 dev_err(rdev->
dev,
"failed initializing audio\n");
919 rs600_gart_disable(rdev);
924 dev_warn(rdev->
dev,
"GPU reset failed ! (0xE40=0x%08X, 0x7C0=0x%08X)\n",
936 r = rs600_startup(rdev);
949 rs600_gart_disable(rdev);
960 rs600_gart_fini(rdev);
991 dev_err(rdev->
dev,
"Expecting atombios for RS600 GPU\n");
997 "GPU reset failed ! (0xE40=0x%08X, 0x7C0=0x%08X)\n",
1008 rs600_mc_init(rdev);
1009 rs600_debugfs(rdev);
1021 r = rs600_gart_init(rdev);
1027 r = rs600_startup(rdev);
1030 dev_err(rdev->
dev,
"Disabling GPU acceleration\n");
1034 rs600_gart_fini(rdev);