summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/nouveau_connector.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2011-10-17 06:23:41 +0400
committerBen Skeggs <bskeggs@redhat.com>2011-12-21 13:01:21 +0400
commitde69185573586302ada2e59ba41835df36986277 (patch)
tree4c80ab38e936aa292985ac67498fe99648ab6628 /drivers/gpu/drm/nouveau/nouveau_connector.c
parent488ff207f98650c6a1f077e432b541f3cdcb7ab8 (diff)
downloadlinux-de69185573586302ada2e59ba41835df36986277.tar.xz
drm/nouveau: improve dithering properties, and implement proper auto mode
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_connector.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_connector.c37
1 files changed, 23 insertions, 14 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c
index 372955ddc591..a8da98fe1282 100644
--- a/drivers/gpu/drm/nouveau/nouveau_connector.c
+++ b/drivers/gpu/drm/nouveau/nouveau_connector.c
@@ -517,12 +517,16 @@ nouveau_connector_set_property(struct drm_connector *connector,
}
/* Dithering */
- if (property == dev->mode_config.dithering_mode_property) {
- if (value == DRM_MODE_DITHERING_ON)
- nv_connector->use_dithering = true;
- else
- nv_connector->use_dithering = false;
+ if (property == disp->dithering_mode) {
+ nv_connector->dithering_mode = value;
+ if (!nv_crtc || !nv_crtc->set_dither)
+ return 0;
+
+ return nv_crtc->set_dither(nv_crtc, true);
+ }
+ if (property == disp->dithering_depth) {
+ nv_connector->dithering_depth = value;
if (!nv_crtc || !nv_crtc->set_dither)
return 0;
@@ -918,7 +922,7 @@ nouveau_connector_create(struct drm_device *dev, int index)
drm_connector_init(dev, connector, funcs, type);
drm_connector_helper_add(connector, &nouveau_connector_helper_funcs);
- /* Check if we need dithering enabled */
+ /* parse lvds table now, we depend on bios->fp.* values later */
if (connector->connector_type == DRM_MODE_CONNECTOR_LVDS) {
bool dummy, is_24bit = false;
@@ -928,8 +932,6 @@ nouveau_connector_create(struct drm_device *dev, int index)
"LVDS\n");
goto fail;
}
-
- nv_connector->use_dithering = !is_24bit;
}
/* Init DVI-I specific properties */
@@ -940,8 +942,7 @@ nouveau_connector_create(struct drm_device *dev, int index)
}
/* Add overscan compensation options to digital outputs */
- if ((dev_priv->card_type == NV_50 ||
- dev_priv->card_type == NV_C0) &&
+ if (disp->underscan_property &&
(dcb->type == DCB_CONNECTOR_DVI_D ||
dcb->type == DCB_CONNECTOR_DVI_I ||
dcb->type == DCB_CONNECTOR_HDMI_0 ||
@@ -977,10 +978,18 @@ nouveau_connector_create(struct drm_device *dev, int index)
drm_connector_attach_property(connector,
dev->mode_config.scaling_mode_property,
nv_connector->scaling_mode);
- drm_connector_attach_property(connector,
- dev->mode_config.dithering_mode_property,
- nv_connector->use_dithering ?
- DRM_MODE_DITHERING_ON : DRM_MODE_DITHERING_OFF);
+ if (disp->dithering_mode) {
+ nv_connector->dithering_mode = DITHERING_MODE_AUTO;
+ drm_connector_attach_property(connector,
+ disp->dithering_mode,
+ nv_connector->dithering_mode);
+ }
+ if (disp->dithering_depth) {
+ nv_connector->dithering_depth = DITHERING_DEPTH_AUTO;
+ drm_connector_attach_property(connector,
+ disp->dithering_depth,
+ nv_connector->dithering_depth);
+ }
break;
}