6.12-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Thomas Zimmermann <[email protected]>

[ Upstream commit a18b6e30ecd69096beda4a0c96d2570900c3879a ]

The screen_buffer field in struct fb_info contains the kernel address
of the first byte of framebuffer memory. Do not add the display offset.
This offset only describes scrolling during scanout.

Signed-off-by: Thomas Zimmermann <[email protected]>
Fixes: de2ba664c30f ("gpu: host1x: drm: Add memory manager and fb")
Cc: [email protected]
Cc: [email protected]
Cc: <[email protected]> # v3.10+
Signed-off-by: Thierry Reding <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Sasha Levin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
 drivers/gpu/drm/tegra/fbdev.c |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

--- a/drivers/gpu/drm/tegra/fbdev.c
+++ b/drivers/gpu/drm/tegra/fbdev.c
@@ -75,7 +75,6 @@ static int tegra_fbdev_probe(struct drm_
        struct fb_info *info = helper->info;
        unsigned int bytes_per_pixel;
        struct drm_framebuffer *fb;
-       unsigned long offset;
        struct tegra_bo *bo;
        size_t size;
        int err;
@@ -112,9 +111,6 @@ static int tegra_fbdev_probe(struct drm_
 
        drm_fb_helper_fill_info(info, helper, sizes);
 
-       offset = info->var.xoffset * bytes_per_pixel +
-                info->var.yoffset * fb->pitches[0];
-
        if (bo->pages) {
                bo->vaddr = vmap(bo->pages, bo->num_pages, VM_MAP,
                                 pgprot_writecombine(PAGE_KERNEL));
@@ -126,9 +122,9 @@ static int tegra_fbdev_probe(struct drm_
        }
 
        info->flags |= FBINFO_VIRTFB;
-       info->screen_buffer = bo->vaddr + offset;
+       info->screen_buffer = bo->vaddr;
        info->screen_size = size;
-       info->fix.smem_start = (unsigned long)(bo->iova + offset);
+       info->fix.smem_start = (unsigned long)(bo->iova);
        info->fix.smem_len = size;
 
        return 0;


Reply via email to