Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+4 -19
+4 -14
drivers/gpu/drm/ast/ast_cursor.c
··· 37 37 */ 38 38 39 39 /* define for signature structure */ 40 + #define AST_HWC_SIGNATURE_SIZE SZ_32 40 41 #define AST_HWC_SIGNATURE_CHECKSUM 0x00 41 42 #define AST_HWC_SIGNATURE_SizeX 0x04 42 43 #define AST_HWC_SIGNATURE_SizeY 0x08 ··· 290 289 struct ast_cursor_plane *ast_cursor_plane = &ast->cursor_plane; 291 290 struct ast_plane *ast_plane = &ast_cursor_plane->base; 292 291 struct drm_plane *cursor_plane = &ast_plane->base; 293 - size_t size; 292 + unsigned long size; 294 293 void __iomem *vaddr; 295 294 long offset; 296 295 int ret; 297 296 298 - /* 299 - * Allocate backing storage for cursors. The BOs are permanently 300 - * pinned to the top end of the VRAM. 301 - */ 302 - 303 - size = roundup(AST_HWC_SIZE + AST_HWC_SIGNATURE_SIZE, PAGE_SIZE); 304 - 305 - if (ast->vram_fb_available < size) 306 - return -ENOMEM; 307 - 308 - vaddr = ast->vram + ast->vram_fb_available - size; 297 + size = ast_cursor_vram_size(); 309 298 offset = ast_cursor_vram_offset(ast); 310 299 if (offset < 0) 311 300 return offset; 301 + vaddr = ast->vram + offset; 312 302 313 303 ret = ast_plane_init(dev, ast_plane, vaddr, offset, size, 314 304 0x01, &ast_cursor_plane_funcs, ··· 311 319 } 312 320 drm_plane_helper_add(cursor_plane, &ast_cursor_plane_helper_funcs); 313 321 drm_plane_enable_fb_damage_clips(cursor_plane); 314 - 315 - ast->vram_fb_available -= size; 316 322 317 323 return 0; 318 324 }
-4
drivers/gpu/drm/ast/ast_drv.h
··· 112 112 113 113 #define AST_MAX_HWC_WIDTH 64 114 114 #define AST_MAX_HWC_HEIGHT 64 115 - 116 115 #define AST_HWC_PITCH (AST_MAX_HWC_WIDTH * SZ_2) 117 116 #define AST_HWC_SIZE (AST_MAX_HWC_HEIGHT * AST_HWC_PITCH) 118 - 119 - #define AST_HWC_SIGNATURE_SIZE 32 120 117 121 118 /* 122 119 * Planes ··· 180 183 void __iomem *vram; 181 184 unsigned long vram_base; 182 185 unsigned long vram_size; 183 - unsigned long vram_fb_available; 184 186 185 187 struct mutex modeset_lock; /* Protects access to modeset I/O registers in ioregs */ 186 188
-1
drivers/gpu/drm/ast/ast_mm.c
··· 92 92 93 93 ast->vram_base = base; 94 94 ast->vram_size = vram_size; 95 - ast->vram_fb_available = vram_size; 96 95 97 96 return 0; 98 97 }