Skip to content

Commit

Permalink
drm/radeon/kms: add initial connector properties
Browse files Browse the repository at this point in the history
This adds:
coherent mode: TMDS coherent mode for atom cards.
scaling mode: LVDS scaler mode
load detect: DAC load detection, DVI-I, VGA, TV
tmds pll: legacy TMDS pll selection
tv standard: TV standard selection.

for later: other TV ones? dvi subconnector selection using std prop

[contains fixes pointed out on dri-devel for atom bios mixups
 by Michel]

Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Dave Airlie committed Sep 18, 2009
1 parent c88f9f0 commit 445282d
Show file tree
Hide file tree
Showing 7 changed files with 376 additions and 62 deletions.
15 changes: 4 additions & 11 deletions drivers/gpu/drm/radeon/radeon_atombios.c
Original file line number Diff line number Diff line change
Expand Up @@ -719,9 +719,8 @@ bool radeon_atom_get_clock_info(struct drm_device *dev)
return false;
}

struct radeon_encoder_int_tmds *radeon_atombios_get_tmds_info(struct
radeon_encoder
*encoder)
bool radeon_atombios_get_tmds_info(struct radeon_encoder *encoder,
struct radeon_encoder_int_tmds *tmds)
{
struct drm_device *dev = encoder->base.dev;
struct radeon_device *rdev = dev->dev_private;
Expand All @@ -732,7 +731,6 @@ struct radeon_encoder_int_tmds *radeon_atombios_get_tmds_info(struct
uint8_t frev, crev;
uint16_t maxfreq;
int i;
struct radeon_encoder_int_tmds *tmds = NULL;

atom_parse_data_header(mode_info->atom_context, index, NULL, &frev,
&crev, &data_offset);
Expand All @@ -742,12 +740,6 @@ struct radeon_encoder_int_tmds *radeon_atombios_get_tmds_info(struct
data_offset);

if (tmds_info) {
tmds =
kzalloc(sizeof(struct radeon_encoder_int_tmds), GFP_KERNEL);

if (!tmds)
return NULL;

maxfreq = le16_to_cpu(tmds_info->usMaxFrequency);
for (i = 0; i < 4; i++) {
tmds->tmds_pll[i].freq =
Expand All @@ -773,8 +765,9 @@ struct radeon_encoder_int_tmds *radeon_atombios_get_tmds_info(struct
break;
}
}
return true;
}
return tmds;
return false;
}

union lvds_info {
Expand Down
46 changes: 26 additions & 20 deletions drivers/gpu/drm/radeon/radeon_combios.c
Original file line number Diff line number Diff line change
Expand Up @@ -998,48 +998,37 @@ static const struct radeon_tmds_pll default_tmds_pll[CHIP_LAST][4] = {
{{15000, 0xb0155}, {0xffffffff, 0xb01cb}, {0, 0}, {0, 0}}, /* CHIP_RS480 */
};

static struct radeon_encoder_int_tmds
*radeon_legacy_get_tmds_info_from_table(struct radeon_device *rdev)
bool radeon_legacy_get_tmds_info_from_table(struct radeon_encoder *encoder,
struct radeon_encoder_int_tmds *tmds)
{
struct drm_device *dev = encoder->base.dev;
struct radeon_device *rdev = dev->dev_private;
int i;
struct radeon_encoder_int_tmds *tmds = NULL;

tmds = kzalloc(sizeof(struct radeon_encoder_int_tmds), GFP_KERNEL);

if (!tmds)
return NULL;

for (i = 0; i < 4; i++) {
tmds->tmds_pll[i].value =
default_tmds_pll[rdev->family][i].value;
default_tmds_pll[rdev->family][i].value;
tmds->tmds_pll[i].freq = default_tmds_pll[rdev->family][i].freq;
}

return tmds;
return true;
}

struct radeon_encoder_int_tmds *radeon_combios_get_tmds_info(struct
radeon_encoder
*encoder)
bool radeon_legacy_get_tmds_info_from_combios(struct radeon_encoder *encoder,
struct radeon_encoder_int_tmds *tmds)
{
struct drm_device *dev = encoder->base.dev;
struct radeon_device *rdev = dev->dev_private;
uint16_t tmds_info;
int i, n;
uint8_t ver;
struct radeon_encoder_int_tmds *tmds = NULL;

if (rdev->bios == NULL)
return radeon_legacy_get_tmds_info_from_table(rdev);
return false;

tmds_info = combios_get_table_offset(dev, COMBIOS_DFP_INFO_TABLE);

if (tmds_info) {
tmds =
kzalloc(sizeof(struct radeon_encoder_int_tmds), GFP_KERNEL);

if (!tmds)
return NULL;

ver = RBIOS8(tmds_info);
DRM_INFO("DFP table revision: %d\n", ver);
Expand Down Expand Up @@ -1077,6 +1066,23 @@ struct radeon_encoder_int_tmds *radeon_combios_get_tmds_info(struct
}
} else
DRM_INFO("No TMDS info found in BIOS\n");
return true;
}

struct radeon_encoder_int_tmds *radeon_combios_get_tmds_info(struct radeon_encoder *encoder)
{
struct radeon_encoder_int_tmds *tmds = NULL;
bool ret;

tmds = kzalloc(sizeof(struct radeon_encoder_int_tmds), GFP_KERNEL);

if (!tmds)
return NULL;

ret = radeon_legacy_get_tmds_info_from_combios(encoder, tmds);
if (ret == false)
radeon_legacy_get_tmds_info_from_table(encoder, tmds);

return tmds;
}

Expand Down
Loading

0 comments on commit 445282d

Please sign in to comment.