On 24/10/2025 14:40, Thomas Zimmermann wrote:
Hi

Am 24.10.25 um 13:53 schrieb Tvrtko Ursulin:

On 24/10/2025 12:04, Jocelyn Falempe wrote:
On a lenovo se100 server, when using i915 GPU for rendering, and the
ast driver for display, the graphic output is corrupted, and almost
unusable.

Adding a clflush call in the vmap function fixes this issue
completely.

AST is importing i915 allocated buffer in this use case, or how exactly is the relationship?

Wondering if some path is not calling dma_buf_begin/end_cpu_access().

Yes, ast doesn't call begin/end_cpu_access in [1].

Jocelyn, if that fixes the issue, feel free to send me a patch for review.

[1] https://elixir.bootlin.com/linux/v6.17.4/source/drivers/gpu/drm/ast/ ast_mode.c

I tried the following patch, but that doesn't fix the graphical issue:

diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
index b4e8edc7c767..e50f95a4c8a9 100644
--- a/drivers/gpu/drm/ast/ast_mode.c
+++ b/drivers/gpu/drm/ast/ast_mode.c
@@ -564,6 +564,7 @@ static void ast_primary_plane_helper_atomic_update(struct drm_plane *plane, struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
        struct drm_rect damage;
        struct drm_atomic_helper_damage_iter iter;
+       int ret;

if (!old_fb || (fb->format != old_fb->format) || crtc_state->mode_changed) { struct ast_crtc_state *ast_crtc_state = to_ast_crtc_state(crtc_state); @@ -572,11 +573,16 @@ static void ast_primary_plane_helper_atomic_update(struct drm_plane *plane, ast_set_vbios_color_reg(ast, fb->format, ast_crtc_state->vmode);
        }

+       ret = drm_gem_fb_begin_cpu_access(fb, DMA_FROM_DEVICE);
+       pr_info("AST begin_cpu_access %d\n", ret);
+
drm_atomic_helper_damage_iter_init(&iter, old_plane_state, plane_state);
        drm_atomic_for_each_plane_damage(&iter, &damage) {
ast_handle_damage(ast_plane, shadow_plane_state->data, fb, &damage);
        }

+       drm_gem_fb_end_cpu_access(fb, DMA_FROM_DEVICE);
+
        /*
         * Some BMCs stop scanning out the video signal after the driver
         * reprogrammed the offset. This stalls display output for several



Best regards,

--

Jocelyn


Best regards
Thomas


Regards,

Tvrtko


Signed-off-by: Jocelyn Falempe <[email protected]>
---
  drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c b/drivers/ gpu/drm/i915/gem/i915_gem_dmabuf.c
index f4f1c979d1b9..f6a8c1cbe4d1 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c
@@ -77,6 +77,7 @@ static int i915_gem_dmabuf_vmap(struct dma_buf *dma_buf,
          return PTR_ERR(vaddr);
        iosys_map_set_vaddr(map, vaddr);
+    drm_clflush_virt_range(vaddr, dma_buf->size);
        return 0;
  }

base-commit: 0790925dadad0997580df6e32cdccd54316807f2



Reply via email to