drm/nv04: Make CRTC base changes effective in the next hsync.
authorFrancisco Jerez <currojerez@riseup.net>
Fri, 22 Oct 2010 02:31:02 +0000 (04:31 +0200)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 3 Dec 2010 05:11:09 +0000 (15:11 +1000)
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_hw.c
drivers/gpu/drm/nouveau/nv04_crtc.c
drivers/gpu/drm/nouveau/nvreg.h

index b9672a05c411f12866035884acf8778a4742eb9c..979275836985afa869cb00bf2a051b3a6933c2a8 100644 (file)
@@ -953,7 +953,7 @@ nv_load_state_ext(struct drm_device *dev, int head,
                        NVWriteCRTC(dev, head, NV_PCRTC_850, regp->crtc_850);
 
                        reg900 = NVReadRAMDAC(dev, head, NV_PRAMDAC_900);
-                       if (regp->crtc_cfg == NV_PCRTC_CONFIG_START_ADDRESS_HSYNC)
+                       if (regp->crtc_cfg == NV10_PCRTC_CONFIG_START_ADDRESS_HSYNC)
                                NVWriteRAMDAC(dev, head, NV_PRAMDAC_900, reg900 | 0x10000);
                        else
                                NVWriteRAMDAC(dev, head, NV_PRAMDAC_900, reg900 & ~0x10000);
index 40e180741629e056f72445ffab06104760bd70ec..b61a7ff8b7b7755a8ccffc1316e7c8799600deb4 100644 (file)
@@ -551,7 +551,10 @@ nv_crtc_mode_set_regs(struct drm_crtc *crtc, struct drm_display_mode * mode)
        if (dev_priv->card_type >= NV_30)
                regp->gpio_ext = NVReadCRTC(dev, 0, NV_PCRTC_GPIO_EXT);
 
-       regp->crtc_cfg = NV_PCRTC_CONFIG_START_ADDRESS_HSYNC;
+       if (dev_priv->card_type >= NV_10)
+               regp->crtc_cfg = NV10_PCRTC_CONFIG_START_ADDRESS_HSYNC;
+       else
+               regp->crtc_cfg = NV04_PCRTC_CONFIG_START_ADDRESS_HSYNC;
 
        /* Some misc regs */
        if (dev_priv->card_type == NV_40) {
index 881f8a585613a82f190349d60f4a2dd2b6815adb..fe0f253089acf6e15de9d1dd93934fd23d315fdb 100644 (file)
 #define NV_PCRTC_START                                 0x00600800
 #define NV_PCRTC_CONFIG                                        0x00600804
 #      define NV_PCRTC_CONFIG_START_ADDRESS_NON_VGA            (1 << 0)
-#      define NV_PCRTC_CONFIG_START_ADDRESS_HSYNC              (2 << 0)
+#      define NV04_PCRTC_CONFIG_START_ADDRESS_HSYNC            (4 << 0)
+#      define NV10_PCRTC_CONFIG_START_ADDRESS_HSYNC            (2 << 0)
 #define NV_PCRTC_CURSOR_CONFIG                         0x00600810
 #      define NV_PCRTC_CURSOR_CONFIG_ENABLE_ENABLE             (1 << 0)
 #      define NV_PCRTC_CURSOR_CONFIG_DOUBLE_SCAN_ENABLE        (1 << 4)