]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/gpu/drm/nouveau/nv50_display.c
drm/omap: remove warn from debugfs
[karo-tx-linux.git] / drivers / gpu / drm / nouveau / nv50_display.c
index 4e384a2f99c3627ea0fc6e31f5f0e34ac95e71e8..58af547b0b930e2ea64e74b0966c7a81e11fba54 100644 (file)
@@ -651,7 +651,7 @@ nv50_crtc_set_dither(struct nouveau_crtc *nv_crtc, bool update)
        nv_connector = nouveau_crtc_connector_get(nv_crtc);
        connector = &nv_connector->base;
        if (nv_connector->dithering_mode == DITHERING_MODE_AUTO) {
-               if (nv_crtc->base.fb->depth > connector->display_info.bpc * 3)
+               if (nv_crtc->base.primary->fb->depth > connector->display_info.bpc * 3)
                        mode = DITHERING_MODE_DYNAMIC2X2;
        } else {
                mode = nv_connector->dithering_mode;
@@ -785,7 +785,8 @@ nv50_crtc_set_scale(struct nouveau_crtc *nv_crtc, bool update)
 
                if (update) {
                        nv50_display_flip_stop(crtc);
-                       nv50_display_flip_next(crtc, crtc->fb, NULL, 1);
+                       nv50_display_flip_next(crtc, crtc->primary->fb,
+                                              NULL, 1);
                }
        }
 
@@ -1028,20 +1029,21 @@ nv50_crtc_commit(struct drm_crtc *crtc)
        }
 
        nv50_crtc_cursor_show_hide(nv_crtc, nv_crtc->cursor.visible, true);
-       nv50_display_flip_next(crtc, crtc->fb, NULL, 1);
+       nv50_display_flip_next(crtc, crtc->primary->fb, NULL, 1);
 }
 
 static bool
 nv50_crtc_mode_fixup(struct drm_crtc *crtc, const struct drm_display_mode *mode,
                     struct drm_display_mode *adjusted_mode)
 {
+       drm_mode_set_crtcinfo(adjusted_mode, CRTC_INTERLACE_HALVE_V);
        return true;
 }
 
 static int
 nv50_crtc_swap_fbs(struct drm_crtc *crtc, struct drm_framebuffer *old_fb)
 {
-       struct nouveau_framebuffer *nvfb = nouveau_framebuffer(crtc->fb);
+       struct nouveau_framebuffer *nvfb = nouveau_framebuffer(crtc->primary->fb);
        struct nv50_head *head = nv50_head(crtc);
        int ret;
 
@@ -1138,7 +1140,7 @@ nv50_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *umode,
        nv50_crtc_set_dither(nv_crtc, false);
        nv50_crtc_set_scale(nv_crtc, false);
        nv50_crtc_set_color_vibrance(nv_crtc, false);
-       nv50_crtc_set_image(nv_crtc, crtc->fb, x, y, false);
+       nv50_crtc_set_image(nv_crtc, crtc->primary->fb, x, y, false);
        return 0;
 }
 
@@ -1150,7 +1152,7 @@ nv50_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y,
        struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc);
        int ret;
 
-       if (!crtc->fb) {
+       if (!crtc->primary->fb) {
                NV_DEBUG(drm, "No FB bound\n");
                return 0;
        }
@@ -1160,8 +1162,8 @@ nv50_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y,
                return ret;
 
        nv50_display_flip_stop(crtc);
-       nv50_crtc_set_image(nv_crtc, crtc->fb, x, y, true);
-       nv50_display_flip_next(crtc, crtc->fb, NULL, 1);
+       nv50_crtc_set_image(nv_crtc, crtc->primary->fb, x, y, true);
+       nv50_display_flip_next(crtc, crtc->primary->fb, NULL, 1);
        return 0;
 }
 
@@ -2199,16 +2201,6 @@ nv50_display_destroy(struct drm_device *dev)
 int
 nv50_display_create(struct drm_device *dev)
 {
-       static const u16 oclass[] = {
-               NVF0_DISP_CLASS,
-               NVE0_DISP_CLASS,
-               NVD0_DISP_CLASS,
-               NVA3_DISP_CLASS,
-               NV94_DISP_CLASS,
-               NVA0_DISP_CLASS,
-               NV84_DISP_CLASS,
-               NV50_DISP_CLASS,
-       };
        struct nouveau_device *device = nouveau_dev(dev);
        struct nouveau_drm *drm = nouveau_drm(dev);
        struct dcb_table *dcb = &drm->vbios.dcb;
@@ -2225,6 +2217,7 @@ nv50_display_create(struct drm_device *dev)
        nouveau_display(dev)->dtor = nv50_display_destroy;
        nouveau_display(dev)->init = nv50_display_init;
        nouveau_display(dev)->fini = nv50_display_fini;
+       disp->core = nouveau_display(dev)->core;
 
        /* small shared memory area we use for notifiers and semaphores */
        ret = nouveau_bo_new(dev, 4096, 0x1000, TTM_PL_FLAG_VRAM,
@@ -2240,17 +2233,6 @@ nv50_display_create(struct drm_device *dev)
                        nouveau_bo_ref(NULL, &disp->sync);
        }
 
-       if (ret)
-               goto out;
-
-       /* attempt to allocate a supported evo display class */
-       ret = -ENODEV;
-       for (i = 0; ret && i < ARRAY_SIZE(oclass); i++) {
-               ret = nouveau_object_new(nv_object(drm), NVDRM_DEVICE,
-                                        0xd1500000, oclass[i], NULL, 0,
-                                        &disp->core);
-       }
-
        if (ret)
                goto out;