drm/nouveau: Implement the pageflip ioctl.
[firefly-linux-kernel-4.4.55.git] / drivers / gpu / drm / nouveau / nv04_crtc.c
index c71abc2a34d5d9cf22a01d3c3bf455a29c5d1dbf..e4aea721971fc3d2bc3d1adbf1ab340407bc1a0e 100644 (file)
@@ -158,7 +158,6 @@ nv_crtc_dpms(struct drm_crtc *crtc, int mode)
 {
        struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc);
        struct drm_device *dev = crtc->dev;
-       struct drm_connector *connector;
        unsigned char seq1 = 0, crtc17 = 0;
        unsigned char crtc1A;
 
@@ -213,10 +212,6 @@ nv_crtc_dpms(struct drm_crtc *crtc, int mode)
        NVVgaSeqReset(dev, nv_crtc->index, false);
 
        NVWriteVgaCrtc(dev, nv_crtc->index, NV_CIO_CRE_RPC1_INDEX, crtc1A);
-
-       /* Update connector polling modes */
-       list_for_each_entry(connector, &dev->mode_config.connector_list, head)
-               nouveau_connector_set_polling(connector);
 }
 
 static bool
@@ -556,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) {
@@ -831,7 +829,7 @@ nv04_crtc_do_mode_set_base(struct drm_crtc *crtc,
        /* Update the framebuffer location. */
        regp->fb_start = nv_crtc->fb.offset & ~3;
        regp->fb_start += (y * drm_fb->pitch) + (x * drm_fb->bits_per_pixel / 8);
-       NVWriteCRTC(dev, nv_crtc->index, NV_PCRTC_START, regp->fb_start);
+       nv_set_crtc_base(dev, nv_crtc->index, regp->fb_start);
 
        /* Update the arbitration parameters. */
        nouveau_calc_arb(dev, crtc->mode.clock, drm_fb->bits_per_pixel,
@@ -991,6 +989,7 @@ static const struct drm_crtc_funcs nv04_crtc_funcs = {
        .cursor_move = nv04_crtc_cursor_move,
        .gamma_set = nv_crtc_gamma_set,
        .set_config = drm_crtc_helper_set_config,
+       .page_flip = nouveau_crtc_page_flip,
        .destroy = nv_crtc_destroy,
 };