radeon_hd: re-rework some pll code

* Grab pseudo pll SS info for early
  Spread Spectrum access
* display_crtc_ss now takes a pll vs
  a display for easy pll access
This commit is contained in:
Alexander von Gluck IV
2012-08-07 15:36:34 -05:00
parent 772f5f839c
commit d96e687652
4 changed files with 18 additions and 12 deletions
@@ -255,9 +255,6 @@ radeon_init_accelerant(int device)
// probe firmware information // probe firmware information
radeon_gpu_probe(); radeon_gpu_probe();
// program external pll clock
pll_external_init();
// find GPIO pins from AtomBIOS // find GPIO pins from AtomBIOS
gpio_probe(); gpio_probe();
@@ -280,6 +277,9 @@ radeon_init_accelerant(int device)
// setup encoders on each connector if needed // setup encoders on each connector if needed
encoder_init(); encoder_init();
// program external pll clock
pll_external_init();
// setup link on any DisplayPort connectors // setup link on any DisplayPort connectors
dp_setup_connectors(); dp_setup_connectors();
@@ -843,7 +843,7 @@ display_crtc_set_dtd(uint8 crtcID, display_mode* mode)
void void
display_crtc_ss(uint8 crtcID, int command) display_crtc_ss(pll_info* pll, int command)
{ {
TRACE("%s\n", __func__); TRACE("%s\n", __func__);
radeon_shared_info &info = *gInfo->shared_info; radeon_shared_info &info = *gInfo->shared_info;
@@ -867,9 +867,6 @@ display_crtc_ss(uint8 crtcID, int command)
union enableSS args; union enableSS args;
memset(&args, 0, sizeof(args)); memset(&args, 0, sizeof(args));
uint32 connectorIndex = gDisplay[crtcID]->connectorIndex;
pll_info* pll = &gConnector[connectorIndex]->encoder.pll;
if (info.dceMajor >= 5) { if (info.dceMajor >= 5) {
args.v3.usSpreadSpectrumAmountFrac = B_HOST_TO_LENDIAN_INT16(0); args.v3.usSpreadSpectrumAmountFrac = B_HOST_TO_LENDIAN_INT16(0);
args.v3.ucSpreadSpectrumType args.v3.ucSpreadSpectrumType
+2 -1
View File
@@ -12,6 +12,7 @@
#include <video_configuration.h> #include <video_configuration.h>
#include "accelerant.h" #include "accelerant.h"
#include "pll.h"
status_t init_registers(register_info* reg, uint8 crtid); status_t init_registers(register_info* reg, uint8 crtid);
@@ -20,7 +21,7 @@ status_t detect_displays();
void debug_displays(); void debug_displays();
uint32 display_get_encoder_mode(uint32 connectorIndex); uint32 display_get_encoder_mode(uint32 connectorIndex);
void display_crtc_ss(uint8 crtcID, int command); void display_crtc_ss(pll_info* pll, int command);
void display_crtc_lock(uint8 crtcID, int command); void display_crtc_lock(uint8 crtcID, int command);
void display_crtc_blank(uint8 crtcID, int command); void display_crtc_blank(uint8 crtcID, int command);
void display_crtc_dpms(uint8 crtcID, int mode); void display_crtc_dpms(uint8 crtcID, int mode);
+12 -4
View File
@@ -691,7 +691,7 @@ pll_set(display_mode* mode, uint8 crtcID)
break; break;
} }
display_crtc_ss(crtcID, ATOM_DISABLE); display_crtc_ss(pll, ATOM_DISABLE);
// disable ss // disable ss
uint8 tableMajor; uint8 tableMajor;
@@ -826,7 +826,7 @@ pll_set(display_mode* mode, uint8 crtcID)
status_t result = atom_execute_table(gAtomContext, index, (uint32*)&args); status_t result = atom_execute_table(gAtomContext, index, (uint32*)&args);
//display_crtc_ss(crtcID, ATOM_ENABLE); //display_crtc_ss(pll, ATOM_ENABLE);
// Not yet, lets avoid this. // Not yet, lets avoid this.
return result; return result;
@@ -906,9 +906,17 @@ pll_external_init()
if (info.dceMajor >= 6) { if (info.dceMajor >= 6) {
pll_external_set(gInfo->displayClockFrequency); pll_external_set(gInfo->displayClockFrequency);
} else if (info.dceMajor >= 4) { } else if (info.dceMajor >= 4) {
// TODO: SS enabled? disable // Create our own pseudo pll
pll_info pll;
bool ssPresent = pll_asic_ss_probe(&pll, ASIC_INTERNAL_SS_ON_DCPLL)
== B_OK ? true : false;
if (ssPresent)
display_crtc_ss(&pll, ATOM_DISABLE);
pll_external_set(gInfo->displayClockFrequency); pll_external_set(gInfo->displayClockFrequency);
// TODO: SS enabled? enable #if 0
if (ssPresent)
display_crtc_ss(&pll, ATOM_ENABLE);
#endif
} }
} }