Skip to contentSkip to conversation

drm/ast: Init iosys_map pointer as I/O memory for damage handling

PATCH In review Thomas Zimmermann 2 participants 2 messages Dec 16, 2022 – Dec 20, 2022

Subsystems (3)
lore
Share & tools
lore

Thomas Zimmermann

author maintainer
#0 lore raw

PATCH 1/1 drm/ast: Init iosys_map pointer as I/O memory for damage handling

Ast hardware scans out the primary plane from video memory, which is in I/O-memory space. Hence init the damage handler's iosys_map pointer as I/O memory.

Not all platforms support accessing I/O memory as system memory, although it's usually not a problem in ast's x86-based systems.

The error report is at [1].

Fixes f2fa5a99ca81 ("drm/ast: Convert ast to SHMEM")
Cc Thomas Zimmermann <[email protected]>
Cc Jocelyn Falempe <[email protected]>
Cc Dave Airlie <[email protected]>
---
 drivers/gpu/drm/ast/ast_mode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/ast/ast_mode.c +1 -1
index c7443317c747..e82e9a8d85e5 100644
@@ -636,7 +636,7 @@ static void ast_handle_damage(struct ast_plane *ast_plane, struct iosys_map *src
 			      struct drm_framebuffer *fb,
 			      const struct drm_rect *clip)
 {
-	struct iosys_map dst = IOSYS_MAP_INIT_VADDR(ast_plane->vaddr);
+	struct iosys_map dst = IOSYS_MAP_INIT_VADDR_IOMEM(ast_plane->vaddr);
 
 	iosys_map_incr(&dst, drm_fb_clip_offset(fb->pitches[0], fb->format, clip));
 	drm_fb_memcpy(&dst, fb->pitches, src, fb, clip);
Signature · 1 line
2.38.1
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 26 lines · Thomas Zimmermann

Ast hardware scans out the primary plane from video memory, which is in I/O-memory space. Hence init the damage handler's iosys_map pointer as I/O memory.

Not all platforms support accessing I/O memory as system memory, although it's usually not a problem in ast's x86-based systems.

The error report is at [1].

Fixes f2fa5a99ca81 ("drm/ast: Convert ast to SHMEM")
Cc Thomas Zimmermann <[email protected]>
Cc Jocelyn Falempe <[email protected]>
Cc Dave Airlie <[email protected]>
---
  drivers/gpu/drm/ast/ast_mode.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/ast/ast_mode.c +0 -0
index c7443317c747..e82e9a8d85e5 100644

drivers/gpu/drm/ast/ast_mode.c static void ast_handle_damage(struct ast_plane *ast_plane, struct iosys_map *src · line 642

Quoted 8 lines
drivers/gpu/drm/ast/ast_mode.c +1 -1
@@ -636,7 +636,7 @@ static void ast_handle_damage(struct ast_plane *ast_plane, struct iosys_map *src
  			      struct drm_framebuffer *fb,
  			      const struct drm_rect *clip)
  {
-	struct iosys_map dst = IOSYS_MAP_INIT_VADDR(ast_plane->vaddr);
+	struct iosys_map dst = IOSYS_MAP_INIT_VADDR_IOMEM(ast_plane->vaddr);
 
  	iosys_map_incr(&dst, drm_fb_clip_offset(fb->pitches[0], fb->format, clip));
  	drm_fb_memcpy(&dst, fb->pitches, src, fb, clip);

It looks good to me.

Signature · 1 line
Jocelyn