diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2025-03-05 17:30:45 +0100 |
---|---|---|
committer | Thomas Zimmermann <tzimmermann@suse.de> | 2025-03-12 08:38:12 +0100 |
commit | e5f953b8eae7249bf50f86d79f80327621edc2d5 (patch) | |
tree | c58ac80ed770f2cf30c6dea9c244d5f1a45311f9 /drivers/gpu/drm/ast/ast_cursor.c | |
parent | ca7a8e8efc9cba4f131b65197bae5011d0a7a250 (diff) |
drm/ast: Remove vram_fb_available from struct ast_device
Helpers compute the offset and size of the available framebuffer
memory. Remove the obsolete field vram_fb_available from struct
ast_device. Also define the cursor-signature size next to its only
user.
v2:
- initialize plane size
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250305163207.267650-7-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/ast/ast_cursor.c')
-rw-r--r-- | drivers/gpu/drm/ast/ast_cursor.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/drivers/gpu/drm/ast/ast_cursor.c b/drivers/gpu/drm/ast/ast_cursor.c index 05e297f30b4e..cb0c48d47207 100644 --- a/drivers/gpu/drm/ast/ast_cursor.c +++ b/drivers/gpu/drm/ast/ast_cursor.c @@ -37,6 +37,7 @@ */ /* define for signature structure */ +#define AST_HWC_SIGNATURE_SIZE SZ_32 #define AST_HWC_SIGNATURE_CHECKSUM 0x00 #define AST_HWC_SIGNATURE_SizeX 0x04 #define AST_HWC_SIGNATURE_SizeY 0x08 @@ -289,25 +290,16 @@ int ast_cursor_plane_init(struct ast_device *ast) struct ast_cursor_plane *ast_cursor_plane = &ast->cursor_plane; struct ast_plane *ast_plane = &ast_cursor_plane->base; struct drm_plane *cursor_plane = &ast_plane->base; - size_t size; + unsigned long size; void __iomem *vaddr; long offset; int ret; - /* - * Allocate backing storage for cursors. The BOs are permanently - * pinned to the top end of the VRAM. - */ - - size = roundup(AST_HWC_SIZE + AST_HWC_SIGNATURE_SIZE, PAGE_SIZE); - - if (ast->vram_fb_available < size) - return -ENOMEM; - - vaddr = ast->vram + ast->vram_fb_available - size; + size = ast_cursor_vram_size(); offset = ast_cursor_vram_offset(ast); if (offset < 0) return offset; + vaddr = ast->vram + offset; ret = ast_plane_init(dev, ast_plane, vaddr, offset, size, 0x01, &ast_cursor_plane_funcs, @@ -320,7 +312,5 @@ int ast_cursor_plane_init(struct ast_device *ast) drm_plane_helper_add(cursor_plane, &ast_cursor_plane_helper_funcs); drm_plane_enable_fb_damage_clips(cursor_plane); - ast->vram_fb_available -= size; - return 0; } |