]> git.ipfire.org Git - thirdparty/linux.git/blobdiff - drivers/gpu/drm/nouveau/dispnv04/crtc.c
Merge tag 'drm-misc-next-2020-06-19' of git://anongit.freedesktop.org/drm/drm-misc...
[thirdparty/linux.git] / drivers / gpu / drm / nouveau / dispnv04 / crtc.c
index 27f511b9987b16f6124f1db5bd2fe2266c8da2e7..640738f3196ce8fe931c72fa2ef6633e22adf691 100644 (file)
@@ -605,15 +605,16 @@ static int
 nv_crtc_swap_fbs(struct drm_crtc *crtc, struct drm_framebuffer *old_fb)
 {
        struct nv04_display *disp = nv04_display(crtc->dev);
-       struct nouveau_framebuffer *nvfb = nouveau_framebuffer(crtc->primary->fb);
+       struct drm_framebuffer *fb = crtc->primary->fb;
+       struct nouveau_bo *nvbo = nouveau_gem_object(fb->obj[0]);
        struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc);
        int ret;
 
-       ret = nouveau_bo_pin(nvfb->nvbo, TTM_PL_FLAG_VRAM, false);
+       ret = nouveau_bo_pin(nvbo, TTM_PL_FLAG_VRAM, false);
        if (ret == 0) {
                if (disp->image[nv_crtc->index])
                        nouveau_bo_unpin(disp->image[nv_crtc->index]);
-               nouveau_bo_ref(nvfb->nvbo, &disp->image[nv_crtc->index]);
+               nouveau_bo_ref(nvbo, &disp->image[nv_crtc->index]);
        }
 
        return ret;
@@ -822,8 +823,8 @@ nv04_crtc_do_mode_set_base(struct drm_crtc *crtc,
        struct drm_device *dev = crtc->dev;
        struct nouveau_drm *drm = nouveau_drm(dev);
        struct nv04_crtc_reg *regp = &nv04_display(dev)->mode_reg.crtc_reg[nv_crtc->index];
+       struct nouveau_bo *nvbo;
        struct drm_framebuffer *drm_fb;
-       struct nouveau_framebuffer *fb;
        int arb_burst, arb_lwm;
 
        NV_DEBUG(drm, "index %d\n", nv_crtc->index);
@@ -839,13 +840,12 @@ nv04_crtc_do_mode_set_base(struct drm_crtc *crtc,
         */
        if (atomic) {
                drm_fb = passed_fb;
-               fb = nouveau_framebuffer(passed_fb);
        } else {
                drm_fb = crtc->primary->fb;
-               fb = nouveau_framebuffer(crtc->primary->fb);
        }
 
-       nv_crtc->fb.offset = fb->nvbo->bo.offset;
+       nvbo = nouveau_gem_object(drm_fb->obj[0]);
+       nv_crtc->fb.offset = nvbo->bo.offset;
 
        if (nv_crtc->lut.depth != drm_fb->format->depth) {
                nv_crtc->lut.depth = drm_fb->format->depth;
@@ -1143,8 +1143,9 @@ nv04_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,
        const int swap_interval = (flags & DRM_MODE_PAGE_FLIP_ASYNC) ? 0 : 1;
        struct drm_device *dev = crtc->dev;
        struct nouveau_drm *drm = nouveau_drm(dev);
-       struct nouveau_bo *old_bo = nouveau_framebuffer(crtc->primary->fb)->nvbo;
-       struct nouveau_bo *new_bo = nouveau_framebuffer(fb)->nvbo;
+       struct drm_framebuffer *old_fb = crtc->primary->fb;
+       struct nouveau_bo *old_bo = nouveau_gem_object(old_fb->obj[0]);
+       struct nouveau_bo *new_bo = nouveau_gem_object(fb->obj[0]);
        struct nv04_page_flip_state *s;
        struct nouveau_channel *chan;
        struct nouveau_cli *cli;