Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 269675
b: refs/heads/master
c: 28e2d12
h: refs/heads/master
i:
  269673: a5654f3
  269671: dd0bc74
v: v3
  • Loading branch information
Ben Skeggs committed Sep 20, 2011
1 parent 8e10878 commit fc59333
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 75a1fccf92ac6703e7cd4d2a2d1d25b87102402b
refs/heads/master: 28e2d12405f1afb34435a23d6bba223ff378de91
26 changes: 21 additions & 5 deletions trunk/drivers/gpu/drm/nouveau/nouveau_dp.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,33 +308,49 @@ struct dp_state {
static void
dp_set_link_config(struct drm_device *dev, struct dp_state *dp)
{
struct drm_nouveau_private *dev_priv = dev->dev_private;
int or = dp->or, link = dp->link;
u32 clk_sor, dp_ctrl;
u8 sink[2];
u8 *bios, headerlen, sink[2];
u32 dp_ctrl;

NV_DEBUG_KMS(dev, "%d lanes at %d KB/s\n", dp->link_nr, dp->link_bw);

/* set selected link rate on source */
switch (dp->link_bw) {
case 270000:
clk_sor = 0x00040000;
nv_mask(dev, 0x614300 + (or * 0x800), 0x000c0000, 0x00040000);
sink[0] = DP_LINK_BW_2_7;
break;
default:
clk_sor = 0x00000000;
nv_mask(dev, 0x614300 + (or * 0x800), 0x000c0000, 0x00000000);
sink[0] = DP_LINK_BW_1_62;
break;
}

/* offset +0x0a of each dp encoder table entry is a pointer to another
* table, that has (among other things) pointers to more scripts that
* need to be executed, this time depending on link speed.
*/
bios = nouveau_bios_dp_table(dev, dp->dcb, &headerlen);
if (bios && (bios = ROMPTR(&dev_priv->vbios, bios[10]))) {
u16 script = ROM16(bios[2]);
if (dp->link_bw != 270000)
script = ROM16(bios[6]);

nouveau_bios_run_init_table(dev, script, dp->dcb, dp->crtc);
}

/* configure lane count on the source */
dp_ctrl = ((1 << dp->link_nr) - 1) << 16;
sink[1] = dp->link_nr;
if (dp->enh_frame) {
dp_ctrl |= 0x00004000;
sink[1] |= DP_LANE_COUNT_ENHANCED_FRAME_EN;
}

nv_mask(dev, 0x614300 + (or * 0x800), 0x000c0000, clk_sor);
nv_mask(dev, NV50_SOR_DP_CTRL(or, link), 0x001f4000, dp_ctrl);

/* inform the sink of the new configuration */
auxch_tx(dev, dp->auxch, 8, DP_LINK_BW_SET, sink, 2);
}

Expand Down

0 comments on commit fc59333

Please sign in to comment.