drm/nve0/disp: nvidia randomly decided to move the dithering method
authorBen Skeggs <bskeggs@redhat.com>
Mon, 5 Mar 2012 00:05:45 +0000 (10:05 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Thu, 22 Mar 2012 14:21:14 +0000 (00:21 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nvd0_display.c

index 421d301b3797a73c2345c7b4a5a219c427d2a0b9..d69642da8b5689cdc6e8a2ebe21ece57d6fb69ec 100644 (file)
@@ -363,10 +363,12 @@ nvd0_display_flip_next(struct drm_crtc *crtc, struct drm_framebuffer *fb,
 static int
 nvd0_crtc_set_dither(struct nouveau_crtc *nv_crtc, bool update)
 {
+       struct drm_nouveau_private *dev_priv = nv_crtc->base.dev->dev_private;
        struct drm_device *dev = nv_crtc->base.dev;
        struct nouveau_connector *nv_connector;
        struct drm_connector *connector;
        u32 *push, mode = 0x00;
+       u32 mthd;
 
        nv_connector = nouveau_crtc_connector_get(nv_crtc);
        connector = &nv_connector->base;
@@ -384,9 +386,14 @@ nvd0_crtc_set_dither(struct nouveau_crtc *nv_crtc, bool update)
                mode |= nv_connector->dithering_depth;
        }
 
+       if (dev_priv->card_type < NV_E0)
+               mthd = 0x0490 + (nv_crtc->index * 0x0300);
+       else
+               mthd = 0x04a0 + (nv_crtc->index * 0x0300);
+
        push = evo_wait(dev, EVO_MASTER, 4);
        if (push) {
-               evo_mthd(push, 0x0490 + (nv_crtc->index * 0x300), 1);
+               evo_mthd(push, mthd, 1);
                evo_data(push, mode);
                if (update) {
                        evo_mthd(push, 0x0080, 1);