diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2011-10-16 20:38:10 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2011-12-21 04:01:20 -0500 |
commit | 488ff207f98650c6a1f077e432b541f3cdcb7ab8 (patch) | |
tree | 5ffa2dec2fa355ad49ce1032ccdc5b7c9faf3b1c /drivers/gpu/drm/nouveau/nvd0_display.c | |
parent | 6322175530c89ab719cea28202f96a3660491727 (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.c | 17 |
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 | *****************************************************************************/ |
109 | static int | 109 | static int |
110 | nvd0_crtc_set_dither(struct nouveau_crtc *nv_crtc, bool on, bool update) | 110 | nvd0_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 | ||
141 | static int | 142 | static int |
142 | nvd0_crtc_set_scale(struct nouveau_crtc *nv_crtc, int type, bool update) | 143 | nvd0_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 | } |