aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nvd0_display.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2011-10-16 20:38:10 -0400
committerBen Skeggs <bskeggs@redhat.com>2011-12-21 04:01:20 -0500
commit488ff207f98650c6a1f077e432b541f3cdcb7ab8 (patch)
tree5ffa2dec2fa355ad49ce1032ccdc5b7c9faf3b1c /drivers/gpu/drm/nouveau/nvd0_display.c
parent6322175530c89ab719cea28202f96a3660491727 (diff)
drm/nouveau: no need to pass parameters into set_scale/dither
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvd0_display.c')
-rw-r--r--drivers/gpu/drm/nouveau/nvd0_display.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/gpu/drm/nouveau/nvd0_display.c b/drivers/gpu/drm/nouveau/nvd0_display.c
index cb006a718e70..9e96eb12133a 100644
--- a/drivers/gpu/drm/nouveau/nvd0_display.c
+++ b/drivers/gpu/drm/nouveau/nvd0_display.c
@@ -107,13 +107,14 @@ nvd0_display_crtc_get(struct drm_encoder *encoder)
107 * CRTC 107 * CRTC
108 *****************************************************************************/ 108 *****************************************************************************/
109static int 109static int
110nvd0_crtc_set_dither(struct nouveau_crtc *nv_crtc, bool on, bool update) 110nvd0_crtc_set_dither(struct nouveau_crtc *nv_crtc, bool update)
111{ 111{
112 struct nouveau_connector *nv_connector;
112 struct drm_device *dev = nv_crtc->base.dev; 113 struct drm_device *dev = nv_crtc->base.dev;
113 u32 *push, mode; 114 u32 *push, mode = 0;
114 115
115 mode = 0x00000000; 116 nv_connector = nouveau_crtc_connector_get(nv_crtc);
116 if (on) { 117 if (nv_connector->use_dithering) {
117 /* 0x11: 6bpc dynamic 2x2 118 /* 0x11: 6bpc dynamic 2x2
118 * 0x13: 8bpc dynamic 2x2 119 * 0x13: 8bpc dynamic 2x2
119 * 0x19: 6bpc static 2x2 120 * 0x19: 6bpc static 2x2
@@ -139,7 +140,7 @@ nvd0_crtc_set_dither(struct nouveau_crtc *nv_crtc, bool on, bool update)
139} 140}
140 141
141static int 142static int
142nvd0_crtc_set_scale(struct nouveau_crtc *nv_crtc, int type, bool update) 143nvd0_crtc_set_scale(struct nouveau_crtc *nv_crtc, bool update)
143{ 144{
144 struct drm_display_mode *mode = &nv_crtc->base.mode; 145 struct drm_display_mode *mode = &nv_crtc->base.mode;
145 struct drm_device *dev = nv_crtc->base.dev; 146 struct drm_device *dev = nv_crtc->base.dev;
@@ -155,7 +156,7 @@ nvd0_crtc_set_scale(struct nouveau_crtc *nv_crtc, int type, bool update)
155 u32 xratio = (native->hdisplay << 19) / mode->hdisplay; 156 u32 xratio = (native->hdisplay << 19) / mode->hdisplay;
156 u32 yratio = (native->vdisplay << 19) / mode->vdisplay; 157 u32 yratio = (native->vdisplay << 19) / mode->vdisplay;
157 158
158 switch (type) { 159 switch (nv_connector->scaling_mode) {
159 case DRM_MODE_SCALE_ASPECT: 160 case DRM_MODE_SCALE_ASPECT:
160 if (xratio > yratio) { 161 if (xratio > yratio) {
161 outX = (mode->hdisplay * yratio) >> 19; 162 outX = (mode->hdisplay * yratio) >> 19;
@@ -378,8 +379,8 @@ nvd0_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *umode,
378 } 379 }
379 380
380 nv_connector = nouveau_crtc_connector_get(nv_crtc); 381 nv_connector = nouveau_crtc_connector_get(nv_crtc);
381 nvd0_crtc_set_dither(nv_crtc, nv_connector->use_dithering, false); 382 nvd0_crtc_set_dither(nv_crtc, false);
382 nvd0_crtc_set_scale(nv_crtc, nv_connector->scaling_mode, false); 383 nvd0_crtc_set_scale(nv_crtc, false);
383 nvd0_crtc_set_image(nv_crtc, crtc->fb, x, y, false); 384 nvd0_crtc_set_image(nv_crtc, crtc->fb, x, y, false);
384 return 0; 385 return 0;
385} 386}