diff --git a/msm/msm_atomic.c b/msm/msm_atomic.c index f5fb5bbc7e..24c9b1b0e5 100644 --- a/msm/msm_atomic.c +++ b/msm/msm_atomic.c @@ -17,6 +17,7 @@ */ #include #include +#include #include "msm_drv.h" #include "msm_gem.h" @@ -419,7 +420,11 @@ static void msm_atomic_helper_commit_modeset_enables(struct drm_device *dev, crtc->base.id); if (funcs->atomic_enable) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)) funcs->atomic_enable(crtc, old_state); +#else + funcs->atomic_enable(crtc, old_crtc_state); +#endif else funcs->commit(crtc); } diff --git a/msm/sde/sde_connector.c b/msm/sde/sde_connector.c index 5c1ff0ebad..3096090483 100644 --- a/msm/sde/sde_connector.c +++ b/msm/sde/sde_connector.c @@ -19,6 +19,7 @@ #include "sde_rm.h" #include "sde_vm.h" #include +#include #define BL_NODE_NAME_SIZE 32 #define HDR10_PLUS_VSIF_TYPE_CODE 0x81 @@ -2618,14 +2619,22 @@ sde_connector_best_encoder(struct drm_connector *connector) return c_conn->encoder; } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)) static struct drm_encoder * sde_connector_atomic_best_encoder(struct drm_connector *connector, struct drm_atomic_state *state) +#else +static struct drm_encoder * +sde_connector_atomic_best_encoder(struct drm_connector *connector, + struct drm_connector_state *connector_state) +#endif { struct sde_connector *c_conn; struct drm_encoder *encoder = NULL; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)) struct drm_connector_state *connector_state = drm_atomic_get_new_connector_state(state, connector); +#endif if (!connector) { SDE_ERROR("invalid connector\n"); diff --git a/msm/sde/sde_crtc.c b/msm/sde/sde_crtc.c index 41cafc67cc..24d992940b 100644 --- a/msm/sde/sde_crtc.c +++ b/msm/sde/sde_crtc.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "sde_kms.h" #include "sde_hw_lm.h" @@ -3528,8 +3529,13 @@ static void _sde_crtc_clear_all_blend_stages(struct sde_crtc *sde_crtc) } } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)) static void sde_crtc_atomic_begin(struct drm_crtc *crtc, struct drm_atomic_state *state) +#else +static void sde_crtc_atomic_begin(struct drm_crtc *crtc, + struct drm_crtc_state *old_state) +#endif { struct sde_crtc *sde_crtc; struct drm_encoder *encoder; @@ -3538,7 +3544,9 @@ static void sde_crtc_atomic_begin(struct drm_crtc *crtc, struct sde_splash_display *splash_display; bool cont_splash_enabled = false; size_t i; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)) struct drm_crtc_state *old_state = drm_atomic_get_new_crtc_state(state, crtc); +#endif if (!crtc) { SDE_ERROR("invalid crtc\n"); @@ -3631,8 +3639,13 @@ end: SDE_ATRACE_END("crtc_atomic_begin"); } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)) static void sde_crtc_atomic_flush(struct drm_crtc *crtc, struct drm_atomic_state *state) +#else +static void sde_crtc_atomic_flush(struct drm_crtc *crtc, + struct drm_crtc_state *old_crtc_state) +#endif { struct drm_encoder *encoder; struct sde_crtc *sde_crtc; @@ -4599,8 +4612,13 @@ static void sde_crtc_disable(struct drm_crtc *crtc) mutex_unlock(&sde_crtc->crtc_lock); } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)) static void sde_crtc_enable(struct drm_crtc *crtc, struct drm_atomic_state *old_state) +#else +static void sde_crtc_enable(struct drm_crtc *crtc, + struct drm_crtc_state *old_crtc_state) +#endif { struct sde_crtc *sde_crtc; struct drm_encoder *encoder; @@ -5347,8 +5365,13 @@ static int _sde_crtc_check_plane_layout(struct drm_crtc *crtc, return 0; } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)) static int sde_crtc_atomic_check(struct drm_crtc *crtc, struct drm_atomic_state *atomic_state) +#else +static int sde_crtc_atomic_check(struct drm_crtc *crtc, + struct drm_crtc_state *state) +#endif { struct drm_device *dev; struct sde_crtc *sde_crtc; @@ -5359,7 +5382,9 @@ static int sde_crtc_atomic_check(struct drm_crtc *crtc, struct sde_multirect_plane_states *multirect_plane = NULL; struct drm_connector *conn; struct drm_connector_list_iter conn_iter; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)) struct drm_crtc_state *state = drm_atomic_get_new_crtc_state(atomic_state, crtc); +#endif if (!crtc) { SDE_ERROR("invalid crtc\n"); diff --git a/msm/sde/sde_plane.c b/msm/sde/sde_plane.c index ef55f709ff..d66ef655bd 100644 --- a/msm/sde/sde_plane.c +++ b/msm/sde/sde_plane.c @@ -22,6 +22,7 @@ #include #include #include +#include #include "msm_prop.h" #include "msm_drv.h" @@ -2703,13 +2704,20 @@ modeset_update: return ret; } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)) static int sde_plane_atomic_check(struct drm_plane *plane, struct drm_atomic_state *atomic_state) +#else +static int sde_plane_atomic_check(struct drm_plane *plane, + struct drm_plane_state *state) +#endif { int ret = 0; struct sde_plane *psde; struct sde_plane_state *pstate; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)) struct drm_plane_state *state = drm_atomic_get_new_plane_state(atomic_state, plane); +#endif if (!plane || !state) { SDE_ERROR("invalid arg(s), plane %d state %d\n", @@ -3389,8 +3397,13 @@ static void _sde_plane_atomic_disable(struct drm_plane *plane, multirect_index, SDE_SSPP_MULTIRECT_TIME_MX); } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)) static void _sde_plane_atomic_update(struct drm_plane *plane, struct drm_plane_state *old_state) +#else +static void sde_plane_atomic_update(struct drm_plane *plane, + struct drm_plane_state *old_state) +#endif { struct sde_plane *psde; struct drm_plane_state *state; @@ -3420,6 +3433,7 @@ static void _sde_plane_atomic_update(struct drm_plane *plane, } } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)) static void sde_plane_atomic_update(struct drm_plane *plane, struct drm_atomic_state *atomic_state) { @@ -3427,6 +3441,7 @@ static void sde_plane_atomic_update(struct drm_plane *plane, _sde_plane_atomic_update(plane, old_state); } +#endif void sde_plane_restore(struct drm_plane *plane) { @@ -3449,7 +3464,11 @@ void sde_plane_restore(struct drm_plane *plane) SDE_DEBUG_PLANE(psde, "\n"); /* last plane state is same as current state */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)) _sde_plane_atomic_update(plane, plane->state); +#else + sde_plane_atomic_update(plane, plane->state); +#endif } bool sde_plane_is_cache_required(struct drm_plane *plane,