]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/vkms: Use offset-adjusted shadow-plane mappings and output
authorThomas Zimmermann <tzimmermann@suse.de>
Tue, 3 Aug 2021 12:59:28 +0000 (14:59 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Sun, 8 Aug 2021 18:27:52 +0000 (20:27 +0200)
For framebuffers with non-zero offset fields, shadow-plane helpers
provide a pointer to the first byte of the contained data. Use it in
vkms.

Also provide use the offset-adjusted data address for the writeback
job's output buffers. Output framebuffers with non-zero offsets now
have their content written to the correct location.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20210803125928.27780-12-tzimmermann@suse.de
drivers/gpu/drm/vkms/vkms_composer.c
drivers/gpu/drm/vkms/vkms_drv.h
drivers/gpu/drm/vkms/vkms_plane.c
drivers/gpu/drm/vkms/vkms_writeback.c

index 49f109c3a2b35dedccaadabe0b0748d5a56395de..9e8204be9a146ba33915d2b8f659ac6efbac3b5e 100644 (file)
@@ -257,7 +257,7 @@ void vkms_composer_worker(struct work_struct *work)
                return;
 
        if (wb_pending)
-               vaddr_out = crtc_state->active_writeback->map[0].vaddr;
+               vaddr_out = crtc_state->active_writeback->data[0].vaddr;
 
        ret = compose_active_planes(&vaddr_out, primary_composer,
                                    crtc_state);
index 8bc9e3f52e1f3412a95559c9061ea97afa79953d..d48c23d40ce5f6bcab5fd885f948ab6e9aad24a7 100644 (file)
@@ -22,6 +22,7 @@
 
 struct vkms_writeback_job {
        struct dma_buf_map map[DRM_FORMAT_MAX_PLANES];
+       struct dma_buf_map data[DRM_FORMAT_MAX_PLANES];
 };
 
 struct vkms_composer {
index 8a56fbf572b0c4f59c3c27b901dea4eac734328e..32409e15244b583c6da688203aadabf633bc37aa 100644 (file)
@@ -111,7 +111,7 @@ static void vkms_plane_atomic_update(struct drm_plane *plane,
        memcpy(&composer->src, &new_state->src, sizeof(struct drm_rect));
        memcpy(&composer->dst, &new_state->dst, sizeof(struct drm_rect));
        memcpy(&composer->fb, fb, sizeof(struct drm_framebuffer));
-       memcpy(&composer->map, &shadow_plane_state->map, sizeof(composer->map));
+       memcpy(&composer->map, &shadow_plane_state->data, sizeof(composer->map));
        drm_framebuffer_get(&composer->fb);
        composer->offset = fb->offsets[0];
        composer->pitch = fb->pitches[0];
index 3a8e2ed93e7c62c0d17399393aa87145802ab29c..8694227f555f36cc031bff109405dc074fad6d43 100644 (file)
@@ -75,7 +75,7 @@ static int vkms_wb_prepare_job(struct drm_writeback_connector *wb_connector,
        if (!vkmsjob)
                return -ENOMEM;
 
-       ret = drm_gem_fb_vmap(job->fb, vkmsjob->map, NULL);
+       ret = drm_gem_fb_vmap(job->fb, vkmsjob->map, vkmsjob->data);
        if (ret) {
                DRM_ERROR("vmap failed: %d\n", ret);
                goto err_kfree;