disp: msm: compat: add kernel 7.2 backward-compatibility shims - #23
Open
yashgupta2126 wants to merge 1 commit into
Open
yashgupta2126 wants to merge 1 commit into
yashgupta2126 wants to merge 1 commit into
Conversation
Kernel 7.2 introduced several breaking API changes that prevent
sde-dlkm from compiling. Add a new compat header
include/linux/msm_drm_compat.h that centralises all version-guarded
shims, and include it at the affected call sites.
All shims are gated on LINUX_VERSION_CODE >= KERNEL_VERSION(7, 2, 0)
so there is no functional change on kernel < 7.2.
Changes covered:
1. struct drm_atomic_state renamed to struct drm_atomic_commit.
All associated APIs renamed accordingly:
drm_atomic_state_init/get/put/alloc/clear
drm_atomic_state_default_clear/default_release
Fix: #define aliases mapping old names to new names.
Include compat header in msm_drv.h so all TUs pick it up.
2. drm_atomic_private_obj_init() dropped its initial state argument.
Fix: inline wrapper absorbs the removed argument without touching
call sites.
3. drm_private_state_funcs gained atomic_create_state callback.
Fix: dp_mst_drm.c adds the callback under a version guard.
4. thermal_of_cooling_device_register() gained a new u32 cdev_id
argument as its 2nd parameter.
Fix: inline wrapper accepts the old 4-arg form and forwards to the
new 5-arg API with cdev_id=0 (preserving legacy behaviour). Inline
is defined before the #define to avoid macro recursion.
Include compat header in msm_cooling_device.c.
5. drm_panel_init() made static/unexported.
sde-dlkm kzalloc-s a bare drm_panel and calls drm_panel_init().
Fix: inline __msm_drm_panel_init_compat() replicates the last
exported body (INIT_LIST_HEAD list/followers, mutex_init, field
assignments), shadowed by a #define at call sites.
6. qcom_clk_set_flags() and CLKFLAG_RETAIN_MEM/CLKFLAG_NORETAIN_MEM
removed from <linux/clk/qcom.h>. The header still exists with a
different API so the __has_include guard in sde_power_handle.c
passes, but the symbol is no longer declared or exported.
Fix: no-op stubs in compat header; the retain-mem hint is advisory
only and safe to elide. Include compat header in sde_power_handle.c.
Signed-off-by: Yash Gupta <yash.gupta@oss.qualcomm.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Kernel 7.2 introduced several breaking API changes that prevent sde-dlkm from compiling. Add a new compat header
include/linux/msm_drm_compat.h that centralises all version-guarded shims, and include it at the affected call sites.
All shims are gated on LINUX_VERSION_CODE >= KERNEL_VERSION(7, 2, 0) so there is no functional change on kernel < 7.2.
Changes covered:
struct drm_atomic_state renamed to struct drm_atomic_commit. All associated APIs renamed accordingly: drm_atomic_state_init/get/put/alloc/clear drm_atomic_state_default_clear/default_release Fix: #define aliases mapping old names to new names. Include compat header in msm_drv.h so all TUs pick it up.
drm_atomic_private_obj_init() dropped its initial state argument. Fix: inline wrapper absorbs the removed argument without touching call sites.
drm_private_state_funcs gained atomic_create_state callback. Fix: dp_mst_drm.c adds the callback under a version guard.
thermal_of_cooling_device_register() gained a new u32 cdev_id argument as its 2nd parameter. Fix: inline wrapper accepts the old 4-arg form and forwards to the new 5-arg API with cdev_id=0 (preserving legacy behaviour). Inline is defined before the #define to avoid macro recursion. Include compat header in msm_cooling_device.c.
drm_panel_init() made static/unexported. sde-dlkm kzalloc-s a bare drm_panel and calls drm_panel_init(). Fix: inline __msm_drm_panel_init_compat() replicates the last exported body (INIT_LIST_HEAD list/followers, mutex_init, field assignments), shadowed by a #define at call sites.
qcom_clk_set_flags() and CLKFLAG_RETAIN_MEM/CLKFLAG_NORETAIN_MEM removed from <linux/clk/qcom.h>. The header still exists with a different API so the __has_include guard in sde_power_handle.c passes, but the symbol is no longer declared or exported. Fix: no-op stubs in compat header; the retain-mem hint is advisory only and safe to elide. Include compat header in sde_power_handle.c.