diff options
-rw-r--r-- | src/radeon.h | 1 | ||||
-rw-r--r-- | src/radeon_atombios.c | 41 | ||||
-rw-r--r-- | src/radeon_output.c | 8 | ||||
-rw-r--r-- | src/radeon_probe.h | 35 |
4 files changed, 77 insertions, 8 deletions
diff --git a/src/radeon.h b/src/radeon.h index 2a6f150e..7705b2a3 100644 --- a/src/radeon.h +++ b/src/radeon.h @@ -805,6 +805,7 @@ typedef struct { Bool want_vblank_interrupts; RADEONBIOSConnector BiosConnector[RADEON_MAX_BIOS_CONNECTOR]; + radeon_encoder_ptr encoders[RADEON_MAX_BIOS_CONNECTOR]; RADEONBIOSInitTable BiosTable; /* save crtc state for console restore */ diff --git a/src/radeon_atombios.c b/src/radeon_atombios.c index feebdba2..f79cb2d0 100644 --- a/src/radeon_atombios.c +++ b/src/radeon_atombios.c @@ -1569,6 +1569,44 @@ static void RADEONApplyATOMQuirks(ScrnInfoPtr pScrn, int index) } } +uint32_t +radeon_get_device_index(uint32_t device_support) +{ + uint32_t device_index = 0; + + if (device_support == 0) + return 0; + + while ((device_support & 1) == 0) { + device_support >>= 1; + device_index++; + } + return device_index; +} + +radeon_encoder_ptr +radeon_add_encoder(ScrnInfoPtr pScrn, uint32_t encoder_id, uint32_t device_support) +{ + RADEONInfoPtr info = RADEONPTR (pScrn); + uint32_t device_index = radeon_get_device_index(device_support); + + if (device_support == 0) + return NULL; + + if (info->encoders[device_index] != NULL) + return info->encoders[device_index]; + else { + info->encoders[device_index] = (radeon_encoder_ptr)xcalloc(1,sizeof(radeon_encoder_rec)); + if (info->encoders[device_index] != NULL) { + info->encoders[device_index]->encoder_id = encoder_id; + // add dev_priv stuff + return info->encoders[device_index]; + } else + return NULL; + } + +} + Bool RADEONGetATOMConnectorInfoFromBIOSObject (ScrnInfoPtr pScrn) { @@ -1666,6 +1704,9 @@ RADEONGetATOMConnectorInfoFromBIOSObject (ScrnInfoPtr pScrn) else info->BiosConnector[i].linkb = FALSE; + info->BiosConnector[i].encoders[radeon_get_device_index(path->usDeviceTag)] = + radeon_add_encoder(pScrn, enc_obj_id, path->usDeviceTag); + switch(enc_obj_id) { case ENCODER_OBJECT_ID_INTERNAL_LVDS: info->BiosConnector[i].LVDSType = LVDS_INT; diff --git a/src/radeon_output.c b/src/radeon_output.c index bf7fa8ac..efbfdfeb 100644 --- a/src/radeon_output.c +++ b/src/radeon_output.c @@ -2712,7 +2712,7 @@ Bool RADEONSetupConnectors(ScrnInfoPtr pScrn) RADEONInfoPtr info = RADEONPTR(pScrn); xf86OutputPtr output; char *optstr; - int i = 0; + int i, j; int num_vga = 0; int num_dvi = 0; int num_hdmi = 0; @@ -2722,6 +2722,9 @@ Bool RADEONSetupConnectors(ScrnInfoPtr pScrn) * The information should be correct even on a OEM card. */ for (i = 0; i < RADEON_MAX_BIOS_CONNECTOR; i++) { + info->encoders[i] = NULL; + for (j = 0; j < RADEON_MAX_BIOS_CONNECTOR; j++) + info->BiosConnector[i].encoders[j] = NULL; info->BiosConnector[i].valid = FALSE; info->BiosConnector[i].load_detection = TRUE; info->BiosConnector[i].shared_ddc = FALSE; @@ -2858,6 +2861,9 @@ Bool RADEONSetupConnectors(ScrnInfoPtr pScrn) radeon_output->shared_ddc = info->BiosConnector[i].shared_ddc; radeon_output->load_detection = info->BiosConnector[i].load_detection; radeon_output->linkb = info->BiosConnector[i].linkb; + radeon_output->connector_id = info->BiosConnector[i].connector_object; + for (j = 0; j < RADEON_MAX_BIOS_CONNECTOR; j++) + radeon_output->encoders[j] = info->BiosConnector[i].encoders[j]; radeon_output->LVDSType = info->BiosConnector[i].LVDSType; diff --git a/src/radeon_probe.h b/src/radeon_probe.h index 9cde2741..36f64832 100644 --- a/src/radeon_probe.h +++ b/src/radeon_probe.h @@ -52,6 +52,9 @@ extern DriverRec RADEON; +#define RADEON_MAX_CRTC 2 +#define RADEON_MAX_BIOS_CONNECTOR 16 + typedef enum { MT_UNKNOWN = -1, @@ -207,6 +210,11 @@ typedef struct _RADEONCrtcPrivateRec { Bool enabled; } RADEONCrtcPrivateRec, *RADEONCrtcPrivatePtr; +typedef struct _radeon_encoder { + uint16_t encoder_id; + void *dev_priv; +} radeon_encoder_rec, *radeon_encoder_ptr; + typedef struct { RADEONDacType DACType; RADEONTmdsType TMDSType; @@ -223,6 +231,7 @@ typedef struct { Bool load_detection; Bool linkb; uint16_t connector_object; + radeon_encoder_ptr encoders[RADEON_MAX_BIOS_CONNECTOR]; } RADEONBIOSConnector; typedef struct _RADEONOutputPrivateRec { @@ -234,12 +243,10 @@ typedef struct _RADEONOutputPrivateRec { RADEONDviType DVIType; RADEONTmdsType TMDSType; RADEONLvdsType LVDSType; - RADEONConnectorType ConnectorType; RADEONMonitorType MonType; int crtc_num; int DDCReg; - I2CBusPtr pI2CBus; - RADEONI2CBusRec ddc_i2c; + uint32_t ps2_tvdac_adj; uint32_t pal_tvdac_adj; uint32_t ntsc_tvdac_adj; @@ -282,9 +289,26 @@ typedef struct _RADEONOutputPrivateRec { char *name; int output_id; - int devices; + //int devices; Bool enabled; + + // re-org + uint16_t connector_id; + uint32_t devices; + uint32_t active_device; + radeon_encoder_ptr encoders[RADEON_MAX_BIOS_CONNECTOR]; + //RADEONConnectorType connector_type; + RADEONConnectorType ConnectorType; + // DDC info + I2CBusPtr pI2CBus; + RADEONI2CBusRec ddc_i2c; + // router info + // HDP info + // shared_ddc Bool shared_ddc; + // cvtv pin + // preferred mode + } RADEONOutputPrivateRec, *RADEONOutputPrivatePtr; struct avivo_pll_state { @@ -588,9 +612,6 @@ typedef struct { } RADEONSaveRec, *RADEONSavePtr; -#define RADEON_MAX_CRTC 2 -#define RADEON_MAX_BIOS_CONNECTOR 16 - typedef struct { Bool HasSecondary; |