提交 3b6d83d1 编写于 作者: B Ben Skeggs

drm/nvd0/disp: untested LVDS support

Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
上级 c6f2f71d
...@@ -816,26 +816,66 @@ nvd0_sor_commit(struct drm_encoder *encoder) ...@@ -816,26 +816,66 @@ nvd0_sor_commit(struct drm_encoder *encoder)
} }
static void static void
nvd0_sor_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, nvd0_sor_mode_set(struct drm_encoder *encoder, struct drm_display_mode *umode,
struct drm_display_mode *adjusted_mode) struct drm_display_mode *mode)
{ {
struct drm_nouveau_private *dev_priv = encoder->dev->dev_private;
struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder);
struct nouveau_crtc *nv_crtc = nouveau_crtc(encoder->crtc); struct nouveau_crtc *nv_crtc = nouveau_crtc(encoder->crtc);
struct nouveau_connector *nv_connector;
struct nvbios *bios = &dev_priv->vbios;
u32 mode_ctrl = (1 << nv_crtc->index); u32 mode_ctrl = (1 << nv_crtc->index);
u32 *push, or_config; u32 *push, or_config;
if (nv_encoder->dcb->sorconf.link & 1) { nv_connector = nouveau_encoder_connector_get(nv_encoder);
if (adjusted_mode->clock < 165000) switch (nv_encoder->dcb->type) {
mode_ctrl |= 0x00000100; case OUTPUT_TMDS:
else if (nv_encoder->dcb->sorconf.link & 1) {
mode_ctrl |= 0x00000500; if (mode->clock < 165000)
} else { mode_ctrl |= 0x00000100;
mode_ctrl |= 0x00000200; else
} mode_ctrl |= 0x00000500;
} else {
mode_ctrl |= 0x00000200;
}
or_config = (mode_ctrl & 0x00000f00) >> 8;
if (mode->clock >= 165000)
or_config |= 0x0100;
break;
case OUTPUT_LVDS:
or_config = (mode_ctrl & 0x00000f00) >> 8;
if (bios->fp_no_ddc) {
if (bios->fp.dual_link)
or_config |= 0x0100;
if (bios->fp.if_is_24bit)
or_config |= 0x0200;
} else {
if (nv_connector->dcb->type == DCB_CONNECTOR_LVDS_SPWG) {
if (((u8 *)nv_connector->edid)[121] == 2)
or_config |= 0x0100;
} else
if (mode->clock >= bios->fp.duallink_transition_clk) {
or_config |= 0x0100;
}
or_config = (mode_ctrl & 0x00000f00) >> 8; if (or_config & 0x0100) {
if (adjusted_mode->clock >= 165000) if (bios->fp.strapless_is_24bit & 2)
or_config |= 0x0100; or_config |= 0x0200;
} else {
if (bios->fp.strapless_is_24bit & 1)
or_config |= 0x0200;
}
if (nv_connector->base.display_info.bpc == 8)
or_config |= 0x0200;
}
break;
default:
BUG_ON(1);
break;
}
nvd0_sor_dpms(encoder, DRM_MODE_DPMS_ON); nvd0_sor_dpms(encoder, DRM_MODE_DPMS_ON);
...@@ -932,8 +972,16 @@ lookup_dcb(struct drm_device *dev, int id, u32 mc) ...@@ -932,8 +972,16 @@ lookup_dcb(struct drm_device *dev, int id, u32 mc)
type = OUTPUT_ANALOG; type = OUTPUT_ANALOG;
or = id; or = id;
} else { } else {
type = OUTPUT_TMDS; switch (mc & 0x00000f00) {
or = id - 4; case 0x00000000: type = OUTPUT_LVDS; break;
case 0x00000100: type = OUTPUT_TMDS; break;
case 0x00000200: type = OUTPUT_TMDS; break;
case 0x00000500: type = OUTPUT_TMDS; break;
default:
return NULL;
}
or = id - 4;
} }
for (i = 0; i < dev_priv->vbios.dcb.entries; i++) { for (i = 0; i < dev_priv->vbios.dcb.entries; i++) {
...@@ -1024,7 +1072,8 @@ nvd0_display_unk2_handler(struct drm_device *dev) ...@@ -1024,7 +1072,8 @@ nvd0_display_unk2_handler(struct drm_device *dev)
nv_wr32(dev, 0x612280 + (or * 0x800), 0x00000000); nv_wr32(dev, 0x612280 + (or * 0x800), 0x00000000);
break; break;
case OUTPUT_TMDS: case OUTPUT_TMDS:
if (disp->irq.pclk >= 165000) case OUTPUT_LVDS:
if (disp->irq.cfg & 0x00000100)
tmp = 0x00000101; tmp = 0x00000101;
else else
tmp = 0x00000000; tmp = 0x00000000;
...@@ -1298,6 +1347,7 @@ nvd0_display_create(struct drm_device *dev) ...@@ -1298,6 +1347,7 @@ nvd0_display_create(struct drm_device *dev)
switch (dcbe->type) { switch (dcbe->type) {
case OUTPUT_TMDS: case OUTPUT_TMDS:
case OUTPUT_LVDS:
nvd0_sor_create(connector, dcbe); nvd0_sor_create(connector, dcbe);
break; break;
case OUTPUT_ANALOG: case OUTPUT_ANALOG:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册