Skip to content

disp: msm: compat: add kernel 7.2 backward-compatibility shims - #23

Open
yashgupta2126 wants to merge 1 commit into
qualcomm-linux:mainfrom
yashgupta2126:7.2-fix
Open

yashgupta2126 wants to merge 1 commit into
qualcomm-linux:mainfrom
yashgupta2126:7.2-fix

Conversation

@yashgupta2126

Copy link
Copy Markdown

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.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant