aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/ast/ast_cursor.c
diff options
context:
space:
mode:
authorThomas Zimmermann <[email protected]>2025-03-24 09:44:10 +0000
committerThomas Zimmermann <[email protected]>2025-04-07 13:08:48 +0000
commit23fd03aa6c08fbf1ba0644aae8c30b6166fe39e8 (patch)
tree5f7feb36b51f1a97f03fc418b92f30b37a2ac677 /drivers/gpu/drm/ast/ast_cursor.c
parentdrm/ast: Fix comment on modeset lock (diff)
downloadkernel-23fd03aa6c08fbf1ba0644aae8c30b6166fe39e8.tar.gz
kernel-23fd03aa6c08fbf1ba0644aae8c30b6166fe39e8.zip
drm/ast: Remove vaddr field from struct ast_plane
The vaddr field in struct ast_plane serves no purpose. Its value can be calculated easily from the VRAM base plus the plane offset. Do so and remove the field. In ast_primary_plane_helper_get_scanout_buffer(), remove the test for vaddr being NULL. This cannot legally happen. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Jocelyn Falempe <[email protected]> Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'drivers/gpu/drm/ast/ast_cursor.c')
-rw-r--r--drivers/gpu/drm/ast/ast_cursor.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/gpu/drm/ast/ast_cursor.c b/drivers/gpu/drm/ast/ast_cursor.c
index 5ee724bfd682..2d3ad7610c2e 100644
--- a/drivers/gpu/drm/ast/ast_cursor.c
+++ b/drivers/gpu/drm/ast/ast_cursor.c
@@ -91,7 +91,7 @@ static u32 ast_cursor_calculate_checksum(const void *src, unsigned int width, un
static void ast_set_cursor_image(struct ast_device *ast, const u8 *src,
unsigned int width, unsigned int height)
{
- u8 __iomem *dst = ast->cursor_plane.base.vaddr;
+ u8 __iomem *dst = ast_plane_vaddr(&ast->cursor_plane.base);
u32 csum;
csum = ast_cursor_calculate_checksum(src, width, height);
@@ -193,7 +193,7 @@ static void ast_cursor_plane_helper_atomic_update(struct drm_plane *plane,
struct ast_device *ast = to_ast_device(plane->dev);
struct drm_rect damage;
u64 dst_off = ast_plane->offset;
- u8 __iomem *dst = ast_plane->vaddr; /* TODO: Use mapping abstraction properly */
+ u8 __iomem *dst = ast_plane_vaddr(ast_plane); /* TODO: Use mapping abstraction properly */
u8 __iomem *sig = dst + AST_HWC_SIZE; /* TODO: Use mapping abstraction properly */
unsigned int offset_x, offset_y;
u16 x, y;
@@ -291,7 +291,6 @@ int ast_cursor_plane_init(struct ast_device *ast)
struct ast_plane *ast_plane = &ast_cursor_plane->base;
struct drm_plane *cursor_plane = &ast_plane->base;
unsigned long size;
- void __iomem *vaddr;
long offset;
int ret;
@@ -299,9 +298,8 @@ int ast_cursor_plane_init(struct ast_device *ast)
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,
+ ret = ast_plane_init(dev, ast_plane, offset, size,
0x01, &ast_cursor_plane_funcs,
ast_cursor_plane_formats, ARRAY_SIZE(ast_cursor_plane_formats),
NULL, DRM_PLANE_TYPE_CURSOR);