Skip to content

Commit 7484a5b

Browse files
author
Jocelyn Falempe
committed
drm/ast: Fix start address computation
During the driver conversion to shmem, the start address for the scanout buffer was set to the base PCI address. In most cases it works because only the lower 24bits are used, and due to alignment it was almost always 0. But on some unlucky hardware, it's not the case, and some uninitialized memory is displayed on the BMC. With shmem, the primary plane is always at offset 0 in GPU memory. * v2: rewrite the patch to set the offset to 0. (Thomas Zimmermann) * v3: move the change to plane_init() and also fix the cursor plane. (Jammy Huang) Tested on a sr645 affected by this bug. Fixes: f2fa5a9 ("drm/ast: Convert ast to SHMEM") Signed-off-by: Jocelyn Falempe <[email protected]> Reviewed-by: Thomas Zimmermann <[email protected]> Reviewed-by: Jammy Huang <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 3efc61d commit 7484a5b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpu/drm/ast/ast_mode.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ static int ast_primary_plane_init(struct ast_private *ast)
714714
struct ast_plane *ast_primary_plane = &ast->primary_plane;
715715
struct drm_plane *primary_plane = &ast_primary_plane->base;
716716
void __iomem *vaddr = ast->vram;
717-
u64 offset = ast->vram_base;
717+
u64 offset = 0; /* with shmem, the primary plane is always at offset 0 */
718718
unsigned long cursor_size = roundup(AST_HWC_SIZE + AST_HWC_SIGNATURE_SIZE, PAGE_SIZE);
719719
unsigned long size = ast->vram_fb_available - cursor_size;
720720
int ret;
@@ -972,7 +972,7 @@ static int ast_cursor_plane_init(struct ast_private *ast)
972972
return -ENOMEM;
973973

974974
vaddr = ast->vram + ast->vram_fb_available - size;
975-
offset = ast->vram_base + ast->vram_fb_available - size;
975+
offset = ast->vram_fb_available - size;
976976

977977
ret = ast_plane_init(dev, ast_cursor_plane, vaddr, offset, size,
978978
0x01, &ast_cursor_plane_funcs,

0 commit comments

Comments
 (0)