From 3aa4e29eeaba371679f15063378744253eee315c Mon Sep 17 00:00:00 2001 From: Giuliano Procida Date: Tue, 1 Jul 2025 12:44:36 +0100 Subject: [PATCH] ANDROID: GKI: fix up CRC issue with struct drm_atomic_state In commit 93f581d7634f ("drm/gem: Test for imported GEM buffers with helper"), a new .h file is included in the drm include files, which messes with the definition of struct drm_atomic_state by moving some fields from "unknown" to "known". Fix this up by adding ANDROID_KABI_DECLONLY directives for every type affected in every affected source file. Fixes: 93f581d7634f ("drm/gem: Test for imported GEM buffers with helper") Change-Id: Ia1ecbc152650747bc321156d6920e42121eb34ee Signed-off-by: Giuliano Procida --- drivers/gpu/drm/drm_atomic.c | 5 +++++ drivers/gpu/drm/drm_client.c | 4 ++++ drivers/gpu/drm/drm_debugfs.c | 4 ++++ drivers/gpu/drm/drm_file.c | 4 ++++ drivers/gpu/drm/drm_framebuffer.c | 5 +++++ drivers/gpu/drm/drm_syncobj.c | 5 +++++ drivers/gpu/drm/ttm/ttm_bo.c | 5 +++++ drivers/gpu/drm/ttm/ttm_bo_util.c | 4 ++++ drivers/gpu/drm/ttm/ttm_bo_vm.c | 5 +++++ drivers/gpu/drm/ttm/ttm_device.c | 5 +++++ drivers/gpu/drm/ttm/ttm_range_manager.c | 5 +++++ drivers/gpu/drm/ttm/ttm_resource.c | 4 ++++ drivers/gpu/drm/ttm/ttm_tt.c | 4 ++++ 13 files changed, 59 insertions(+) diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index 0fc99da93afe..5056afdab939 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c @@ -46,6 +46,11 @@ #include "drm_crtc_internal.h" #include "drm_internal.h" +#include +ANDROID_KABI_DECLONLY(dma_buf); +ANDROID_KABI_DECLONLY(dma_buf_attachment); +ANDROID_KABI_DECLONLY(iosys_map); + void __drm_crtc_commit_free(struct kref *kref) { struct drm_crtc_commit *commit = diff --git a/drivers/gpu/drm/drm_client.c b/drivers/gpu/drm/drm_client.c index bfedcbf516db..e4c8fd1d4c02 100644 --- a/drivers/gpu/drm/drm_client.c +++ b/drivers/gpu/drm/drm_client.c @@ -23,6 +23,10 @@ #include "drm_crtc_internal.h" #include "drm_internal.h" +#include +ANDROID_KABI_DECLONLY(dma_buf); +ANDROID_KABI_DECLONLY(dma_buf_attachment); + /** * DOC: overview * diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c index 98a37dc3324e..d7f82257f4fd 100644 --- a/drivers/gpu/drm/drm_debugfs.c +++ b/drivers/gpu/drm/drm_debugfs.c @@ -45,6 +45,10 @@ #include "drm_crtc_internal.h" #include "drm_internal.h" +#include +ANDROID_KABI_DECLONLY(dma_buf); +ANDROID_KABI_DECLONLY(dma_buf_attachment); + /*************************************************** * Initialization, etc. **************************************************/ diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c index e2cf118ff01d..164f0f2c29f6 100644 --- a/drivers/gpu/drm/drm_file.c +++ b/drivers/gpu/drm/drm_file.c @@ -49,6 +49,10 @@ #include "drm_crtc_internal.h" #include "drm_internal.h" +#include +ANDROID_KABI_DECLONLY(dma_buf); +ANDROID_KABI_DECLONLY(dma_buf_attachment); + /* from BKL pushdown */ DEFINE_MUTEX(drm_global_mutex); diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c index 888aadb6a4ac..cec1bcb57c07 100644 --- a/drivers/gpu/drm/drm_framebuffer.c +++ b/drivers/gpu/drm/drm_framebuffer.c @@ -38,6 +38,11 @@ #include "drm_crtc_internal.h" #include "drm_internal.h" +#include +ANDROID_KABI_DECLONLY(dma_buf); +ANDROID_KABI_DECLONLY(dma_buf_attachment); +ANDROID_KABI_DECLONLY(iosys_map); + /** * DOC: overview * diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c index 8e3d2d7060f8..396dc12374d6 100644 --- a/drivers/gpu/drm/drm_syncobj.c +++ b/drivers/gpu/drm/drm_syncobj.c @@ -211,6 +211,11 @@ #include "drm_internal.h" +#include +ANDROID_KABI_DECLONLY(dma_buf); +ANDROID_KABI_DECLONLY(dma_buf_attachment); +ANDROID_KABI_DECLONLY(iosys_map); + struct syncobj_wait_entry { struct list_head node; struct task_struct *task; diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 320592435252..e384705fbdb3 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -46,6 +46,11 @@ #include "ttm_module.h" +#include +ANDROID_KABI_DECLONLY(dma_buf); +ANDROID_KABI_DECLONLY(dma_buf_attachment); +ANDROID_KABI_DECLONLY(sg_table); + static void ttm_bo_mem_space_debug(struct ttm_buffer_object *bo, struct ttm_placement *placement) { diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c index 3c07f4712d5c..fcad827d0947 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_util.c +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c @@ -37,6 +37,10 @@ #include +#include +ANDROID_KABI_DECLONLY(dma_buf); +ANDROID_KABI_DECLONLY(dma_buf_attachment); + struct ttm_transfer_obj { struct ttm_buffer_object base; struct ttm_buffer_object *bo; diff --git a/drivers/gpu/drm/ttm/ttm_bo_vm.c b/drivers/gpu/drm/ttm/ttm_bo_vm.c index 4212b8c91dd4..b00c5acc6b7d 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_vm.c +++ b/drivers/gpu/drm/ttm/ttm_bo_vm.c @@ -38,6 +38,11 @@ #include #include +#include +ANDROID_KABI_DECLONLY(dma_buf); +ANDROID_KABI_DECLONLY(dma_buf_attachment); +ANDROID_KABI_DECLONLY(sg_table); + static vm_fault_t ttm_bo_vm_fault_idle(struct ttm_buffer_object *bo, struct vm_fault *vmf) { diff --git a/drivers/gpu/drm/ttm/ttm_device.c b/drivers/gpu/drm/ttm/ttm_device.c index e7cc4954c1bc..68a4dfb5eafb 100644 --- a/drivers/gpu/drm/ttm/ttm_device.c +++ b/drivers/gpu/drm/ttm/ttm_device.c @@ -37,6 +37,11 @@ #include "ttm_module.h" +#include +ANDROID_KABI_DECLONLY(dma_buf); +ANDROID_KABI_DECLONLY(dma_buf_attachment); +ANDROID_KABI_DECLONLY(sg_table); + /* * ttm_global_mutex - protecting the global state */ diff --git a/drivers/gpu/drm/ttm/ttm_range_manager.c b/drivers/gpu/drm/ttm/ttm_range_manager.c index ae11d07eb63a..efcef5ec792d 100644 --- a/drivers/gpu/drm/ttm/ttm_range_manager.c +++ b/drivers/gpu/drm/ttm/ttm_range_manager.c @@ -37,6 +37,11 @@ #include #include +#include +ANDROID_KABI_DECLONLY(dma_buf); +ANDROID_KABI_DECLONLY(dma_buf_attachment); +ANDROID_KABI_DECLONLY(sg_table); + /* * Currently we use a spinlock for the lock, but a mutex *may* be * more appropriate to reduce scheduling latency if the range manager diff --git a/drivers/gpu/drm/ttm/ttm_resource.c b/drivers/gpu/drm/ttm/ttm_resource.c index 6d764ba88aab..d757006f2a0e 100644 --- a/drivers/gpu/drm/ttm/ttm_resource.c +++ b/drivers/gpu/drm/ttm/ttm_resource.c @@ -33,6 +33,10 @@ #include +#include +ANDROID_KABI_DECLONLY(dma_buf); +ANDROID_KABI_DECLONLY(dma_buf_attachment); + /* Detach the cursor from the bulk move list*/ static void ttm_resource_cursor_clear_bulk(struct ttm_resource_cursor *cursor) diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index 4b51b9023126..4b86c0c91b0c 100644 --- a/drivers/gpu/drm/ttm/ttm_tt.c +++ b/drivers/gpu/drm/ttm/ttm_tt.c @@ -45,6 +45,10 @@ #include "ttm_module.h" +#include +ANDROID_KABI_DECLONLY(dma_buf); +ANDROID_KABI_DECLONLY(dma_buf_attachment); + static unsigned long ttm_pages_limit; MODULE_PARM_DESC(pages_limit, "Limit for the allocated pages");