Repository navigation
Closed
Description
This occurs because the header file <drm/drm_cache.h> is currently included conditionally, restricted only to x86 architectures:
Lines 23 to 25 in 750044c
| #if defined(CONFIG_X86) | |
| #include <drm/drm_cache.h> | |
| #endif |
However, the function copy_primary_pixels_on_xe utilizes drm_clflush_virt_range and drm_memcpy_from_wc (defined in that header), but the function definition itself is not guarded by the same architecture checks:
Lines 178 to 209 in 750044c
| #if KERNEL_VERSION(5, 18, 0) <= LINUX_VERSION_CODE || defined(EL8) || defined(EL9) | |
| static int copy_primary_pixels_on_xe(struct evdi_framebuffer *efb, | |
| char __user *buffer, | |
| int buf_byte_stride, | |
| int const max_x, | |
| int const max_y) | |
| { | |
| int y; | |
| struct drm_framebuffer *fb = &efb->base; | |
| const int byte_span = max_x * 4; | |
| struct iosys_map dst_mapping = IOSYS_MAP_INIT_VADDR(vmalloc(max_x * 4)); | |
| for (y = 0; y < max_y; ++y) { | |
| const int src_offset = fb->offsets[0] + fb->pitches[0] * y; | |
| struct iosys_map src_mapping = IOSYS_MAP_INIT_VADDR((char *)efb->obj->vmapping + src_offset); | |
| const int dst_offset = buf_byte_stride * y; | |
| char __user *dst = buffer + dst_offset; | |
| drm_clflush_virt_range(src_mapping.vaddr, byte_span); | |
| drm_memcpy_from_wc(&dst_mapping, &src_mapping, byte_span); | |
| if (copy_to_user(dst, dst_mapping.vaddr, byte_span)) | |
| return -EFAULT; | |
| src_mapping.vaddr += fb->pitches[0]; | |
| dst += buf_byte_stride; | |
| } | |
| vfree(dst_mapping.vaddr); | |
| return 0; | |
| } | |
| #endif |
This mismatch causes the build to fail when targeting non-x86 architectures (such as AArch64), as the compiler cannot find the definitions for the DRM cache functions.
> /build/source/module/evdi_painter.c: In function 'copy_primary_pixels_on_xe':
2026-02-09T14:17:28.3342031Z evdi> /build/source/module/evdi_painter.c:196:17: error: implicit declaration of function 'drm_clflush_virt_range' [-Wimplicit-function-declaration]
2026-02-09T14:17:28.3342707Z evdi> 196 | drm_clflush_virt_range(src_mapping.vaddr, byte_span);
2026-02-09T14:17:28.3343032Z evdi> | ^~~~~~~~~~~~~~~~~~~~~~
Ref: NixOS/nixpkgs#488694
Reacted by Tess Hoffman and Francois Rigaut
Metadata
Metadata
Assignees
Labels
No labels
Activity
zrhoffman commentedon Feb 16, 2026
I am on Asahi Linux (aarch64), and I can confirm that making the include unconditional gets it to compile for me:
synaptics-lspintzyk commentedon Feb 16, 2026
Good catch. Can you please submit PR?
Unconditionally include <drm/drm_cache.h>.
Unconditionally include <drm/drm_cache.h>.