From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx> We'll be wanting to duplicate other states besides the one pointed to by crtc->state & co., so pass the duplicated state in explicitly. @r@ identifier F =~ "^__drm_atomic_helper_.*_duplicate_state$"; identifier O, S; type T, TS; @@ F(T O, TS *S + ,const TS *old_state ) { <... - O->state + old_state ...> } @@ identifier r.F; expression E; @@ F(E, ... + ,E->state ) Signed-off-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx> --- drivers/gpu/drm/arm/malidp_crtc.c | 3 ++- drivers/gpu/drm/arm/malidp_planes.c | 3 ++- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c | 3 ++- drivers/gpu/drm/drm_atomic_helper.c | 30 ++++++++++++++++---------- drivers/gpu/drm/drm_dp_mst_topology.c | 3 ++- drivers/gpu/drm/exynos/exynos_drm_plane.c | 3 ++- drivers/gpu/drm/i915/intel_atomic.c | 6 ++++-- drivers/gpu/drm/i915/intel_atomic_plane.c | 2 +- drivers/gpu/drm/i915/intel_sdvo.c | 4 +++- drivers/gpu/drm/imx/ipuv3-crtc.c | 3 ++- drivers/gpu/drm/imx/ipuv3-plane.c | 3 ++- drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 3 ++- drivers/gpu/drm/mediatek/mtk_drm_plane.c | 3 ++- drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c | 3 ++- drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 3 ++- drivers/gpu/drm/nouveau/nouveau_connector.c | 3 ++- drivers/gpu/drm/nouveau/nv50_display.c | 6 ++++-- drivers/gpu/drm/rcar-du/rcar_du_plane.c | 3 ++- drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 3 ++- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 3 ++- drivers/gpu/drm/tegra/dc.c | 6 ++++-- drivers/gpu/drm/tegra/dsi.c | 3 ++- drivers/gpu/drm/tegra/sor.c | 3 ++- drivers/gpu/drm/vc4/vc4_crtc.c | 3 ++- drivers/gpu/drm/vc4/vc4_plane.c | 3 ++- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 7 +++--- include/drm/drm_atomic_helper.h | 12 +++++++---- 27 files changed, 85 insertions(+), 45 deletions(-) diff --git a/drivers/gpu/drm/arm/malidp_crtc.c b/drivers/gpu/drm/arm/malidp_crtc.c index 3615d18a7ddf..037514f42a83 100644 --- a/drivers/gpu/drm/arm/malidp_crtc.c +++ b/drivers/gpu/drm/arm/malidp_crtc.c @@ -427,7 +427,8 @@ static struct drm_crtc_state *malidp_crtc_duplicate_state(struct drm_crtc *crtc) if (!state) return NULL; - __drm_atomic_helper_crtc_duplicate_state(crtc, &state->base); + __drm_atomic_helper_crtc_duplicate_state(crtc, &state->base, + crtc->state); memcpy(state->gamma_coeffs, old_state->gamma_coeffs, sizeof(state->gamma_coeffs)); memcpy(state->coloradj_coeffs, old_state->coloradj_coeffs, diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c index 600fa7bd7f52..fe744396bc99 100644 --- a/drivers/gpu/drm/arm/malidp_planes.c +++ b/drivers/gpu/drm/arm/malidp_planes.c @@ -98,7 +98,8 @@ drm_plane_state *malidp_duplicate_plane_state(struct drm_plane *plane) return NULL; m_state = to_malidp_plane_state(plane->state); - __drm_atomic_helper_plane_duplicate_state(plane, &state->base); + __drm_atomic_helper_plane_duplicate_state(plane, &state->base, + plane->state); state->rotmem_size = m_state->rotmem_size; state->format = m_state->format; state->n_planes = m_state->n_planes; diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c index 441769c5bcd4..bb7c5eb9526a 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c @@ -385,7 +385,8 @@ atmel_hlcdc_crtc_duplicate_state(struct drm_crtc *crtc) state = kmalloc(sizeof(*state), GFP_KERNEL); if (!state) return NULL; - __drm_atomic_helper_crtc_duplicate_state(crtc, &state->base); + __drm_atomic_helper_crtc_duplicate_state(crtc, &state->base, + crtc->state); cur = drm_crtc_state_to_atmel_hlcdc_crtc_state(crtc->state); state->output_mode = cur->output_mode; diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index bc7d3a5a50f7..0745a08a6cc2 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -3374,9 +3374,10 @@ EXPORT_SYMBOL(drm_atomic_helper_crtc_reset); * This is useful for drivers that subclass the CRTC state. */ void __drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc, - struct drm_crtc_state *state) + struct drm_crtc_state *state, + const struct drm_crtc_state *old_state) { - memcpy(state, crtc->state, sizeof(*state)); + memcpy(state, old_state, sizeof(*state)); if (state->mode_blob) drm_property_blob_get(state->mode_blob); @@ -3414,7 +3415,8 @@ drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc) state = kmalloc(sizeof(*state), GFP_KERNEL); if (state) - __drm_atomic_helper_crtc_duplicate_state(crtc, state); + __drm_atomic_helper_crtc_duplicate_state(crtc, state, + crtc->state); return state; } @@ -3484,9 +3486,10 @@ EXPORT_SYMBOL(drm_atomic_helper_plane_reset); * drivers that subclass the plane state. */ void __drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane, - struct drm_plane_state *state) + struct drm_plane_state *state, + const struct drm_plane_state *old_state) { - memcpy(state, plane->state, sizeof(*state)); + memcpy(state, old_state, sizeof(*state)); if (state->fb) drm_framebuffer_get(state->fb); @@ -3512,7 +3515,8 @@ drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane) state = kmalloc(sizeof(*state), GFP_KERNEL); if (state) - __drm_atomic_helper_plane_duplicate_state(plane, state); + __drm_atomic_helper_plane_duplicate_state(plane, state, + plane->state); return state; } @@ -3606,9 +3610,10 @@ EXPORT_SYMBOL(drm_atomic_helper_connector_reset); */ void __drm_atomic_helper_connector_duplicate_state(struct drm_connector *connector, - struct drm_connector_state *state) + struct drm_connector_state *state, + const struct drm_connector_state *old_state) { - memcpy(state, connector->state, sizeof(*state)); + memcpy(state, old_state, sizeof(*state)); if (state->crtc) drm_connector_get(connector); } @@ -3631,7 +3636,9 @@ drm_atomic_helper_connector_duplicate_state(struct drm_connector *connector) state = kmalloc(sizeof(*state), GFP_KERNEL); if (state) - __drm_atomic_helper_connector_duplicate_state(connector, state); + __drm_atomic_helper_connector_duplicate_state(connector, + state, + connector->state); return state; } @@ -3845,8 +3852,9 @@ EXPORT_SYMBOL(drm_atomic_helper_legacy_gamma_set); * This is useful for drivers that subclass the private state. */ void __drm_atomic_helper_private_obj_duplicate_state(struct drm_private_obj *obj, - struct drm_private_state *state) + struct drm_private_state *state, + const struct drm_private_state *old_state) { - memcpy(state, obj->state, sizeof(*state)); + memcpy(state, old_state, sizeof(*state)); } EXPORT_SYMBOL(__drm_atomic_helper_private_obj_duplicate_state); diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c index 91510098f60e..140c24258b7b 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -3003,7 +3003,8 @@ drm_dp_mst_duplicate_state(struct drm_private_obj *obj) if (!state) return NULL; - __drm_atomic_helper_private_obj_duplicate_state(obj, &state->base); + __drm_atomic_helper_private_obj_duplicate_state(obj, &state->base, + obj->state); return &state->base; } diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c index 611b6fd65433..1807f4c7bcf6 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_plane.c +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c @@ -156,7 +156,8 @@ exynos_drm_plane_duplicate_state(struct drm_plane *plane) if (!copy) return NULL; - __drm_atomic_helper_plane_duplicate_state(plane, ©->base); + __drm_atomic_helper_plane_duplicate_state(plane, ©->base, + plane->state); return ©->base; } diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c index 36d4e635e4ce..e5d5a558c84a 100644 --- a/drivers/gpu/drm/i915/intel_atomic.c +++ b/drivers/gpu/drm/i915/intel_atomic.c @@ -146,7 +146,8 @@ intel_digital_connector_duplicate_state(struct drm_connector *connector) if (!state) return NULL; - __drm_atomic_helper_connector_duplicate_state(connector, &state->base); + __drm_atomic_helper_connector_duplicate_state(connector, &state->base, + connector->state); return &state->base; } @@ -168,7 +169,8 @@ intel_crtc_duplicate_state(struct drm_crtc *crtc) if (!crtc_state) return NULL; - __drm_atomic_helper_crtc_duplicate_state(crtc, &crtc_state->base); + __drm_atomic_helper_crtc_duplicate_state(crtc, &crtc_state->base, + crtc->state); crtc_state->update_pipe = false; crtc_state->disable_lp_wm = false; diff --git a/drivers/gpu/drm/i915/intel_atomic_plane.c b/drivers/gpu/drm/i915/intel_atomic_plane.c index 7cdbe9ae2c96..41a7354c14d3 100644 --- a/drivers/gpu/drm/i915/intel_atomic_plane.c +++ b/drivers/gpu/drm/i915/intel_atomic_plane.c @@ -83,7 +83,7 @@ intel_plane_duplicate_state(struct drm_plane *plane) state = &intel_state->base; - __drm_atomic_helper_plane_duplicate_state(plane, state); + __drm_atomic_helper_plane_duplicate_state(plane, state, plane->state); intel_state->vma = NULL; diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c index f902922d4ae6..0d14807b38a5 100644 --- a/drivers/gpu/drm/i915/intel_sdvo.c +++ b/drivers/gpu/drm/i915/intel_sdvo.c @@ -2187,7 +2187,9 @@ intel_sdvo_connector_duplicate_state(struct drm_connector *connector) if (!state) return NULL; - __drm_atomic_helper_connector_duplicate_state(connector, &state->base.base); + __drm_atomic_helper_connector_duplicate_state(connector, + &state->base.base, + connector->state); return &state->base.base; } diff --git a/drivers/gpu/drm/imx/ipuv3-crtc.c b/drivers/gpu/drm/imx/ipuv3-crtc.c index 53e0b24beda6..44598b6a5cfc 100644 --- a/drivers/gpu/drm/imx/ipuv3-crtc.c +++ b/drivers/gpu/drm/imx/ipuv3-crtc.c @@ -137,7 +137,8 @@ static struct drm_crtc_state *imx_drm_crtc_duplicate_state(struct drm_crtc *crtc if (!state) return NULL; - __drm_atomic_helper_crtc_duplicate_state(crtc, &state->base); + __drm_atomic_helper_crtc_duplicate_state(crtc, &state->base, + crtc->state); WARN_ON(state->base.crtc != crtc); state->base.crtc = crtc; diff --git a/drivers/gpu/drm/imx/ipuv3-plane.c b/drivers/gpu/drm/imx/ipuv3-plane.c index 49546222c6d3..3b3c979c4f6d 100644 --- a/drivers/gpu/drm/imx/ipuv3-plane.c +++ b/drivers/gpu/drm/imx/ipuv3-plane.c @@ -288,7 +288,8 @@ struct drm_plane_state *ipu_plane_duplicate_state(struct drm_plane *plane) state = kmalloc(sizeof(*state), GFP_KERNEL); if (state) - __drm_atomic_helper_plane_duplicate_state(plane, &state->base); + __drm_atomic_helper_plane_duplicate_state(plane, &state->base, + plane->state); return &state->base; } diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c index fc65c57dda8c..4bdc612fbe89 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c @@ -134,7 +134,8 @@ static struct drm_crtc_state *mtk_drm_crtc_duplicate_state(struct drm_crtc *crtc if (!state) return NULL; - __drm_atomic_helper_crtc_duplicate_state(crtc, &state->base); + __drm_atomic_helper_crtc_duplicate_state(crtc, &state->base, + crtc->state); WARN_ON(state->base.crtc != crtc); state->base.crtc = crtc; diff --git a/drivers/gpu/drm/mediatek/mtk_drm_plane.c b/drivers/gpu/drm/mediatek/mtk_drm_plane.c index e405e89ed5e5..9ecc23f67cc7 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_plane.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_plane.c @@ -59,7 +59,8 @@ static struct drm_plane_state *mtk_plane_duplicate_state(struct drm_plane *plane if (!state) return NULL; - __drm_atomic_helper_plane_duplicate_state(plane, &state->base); + __drm_atomic_helper_plane_duplicate_state(plane, &state->base, + plane->state); WARN_ON(state->base.plane != plane); diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c index 4322a502555a..49c7410d0ef6 100644 --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c @@ -901,7 +901,8 @@ mdp5_crtc_duplicate_state(struct drm_crtc *crtc) if (!mdp5_cstate) return NULL; - __drm_atomic_helper_crtc_duplicate_state(crtc, &mdp5_cstate->base); + __drm_atomic_helper_crtc_duplicate_state(crtc, &mdp5_cstate->base, + crtc->state); return &mdp5_cstate->base; } diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c index fe3a4de1a433..de00c9ad14fd 100644 --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c @@ -226,7 +226,8 @@ mdp5_plane_duplicate_state(struct drm_plane *plane) if (!mdp5_state) return NULL; - __drm_atomic_helper_plane_duplicate_state(plane, &mdp5_state->base); + __drm_atomic_helper_plane_duplicate_state(plane, &mdp5_state->base, + plane->state); return &mdp5_state->base; } diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c index 147b22163f9f..dc1880eb00bf 100644 --- a/drivers/gpu/drm/nouveau/nouveau_connector.c +++ b/drivers/gpu/drm/nouveau/nouveau_connector.c @@ -234,7 +234,8 @@ nouveau_conn_atomic_duplicate_state(struct drm_connector *connector) struct nouveau_conn_atom *asyc; if (!(asyc = kmalloc(sizeof(*asyc), GFP_KERNEL))) return NULL; - __drm_atomic_helper_connector_duplicate_state(connector, &asyc->state); + __drm_atomic_helper_connector_duplicate_state(connector, &asyc->state, + connector->state); asyc->dither = armc->dither; asyc->scaler = armc->scaler; asyc->procamp = armc->procamp; diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c index 42a85c14aea0..6ca8d97e7dbc 100644 --- a/drivers/gpu/drm/nouveau/nv50_display.c +++ b/drivers/gpu/drm/nouveau/nv50_display.c @@ -1011,7 +1011,8 @@ nv50_wndw_atomic_duplicate_state(struct drm_plane *plane) struct nv50_wndw_atom *asyw; if (!(asyw = kmalloc(sizeof(*asyw), GFP_KERNEL))) return NULL; - __drm_atomic_helper_plane_duplicate_state(plane, &asyw->state); + __drm_atomic_helper_plane_duplicate_state(plane, &asyw->state, + plane->state); asyw->interval = 1; asyw->sema = armw->sema; asyw->ntfy = armw->ntfy; @@ -2263,7 +2264,8 @@ nv50_head_atomic_duplicate_state(struct drm_crtc *crtc) struct nv50_head_atom *asyh; if (!(asyh = kmalloc(sizeof(*asyh), GFP_KERNEL))) return NULL; - __drm_atomic_helper_crtc_duplicate_state(crtc, &asyh->state); + __drm_atomic_helper_crtc_duplicate_state(crtc, &asyh->state, + crtc->state); asyh->view = armh->view; asyh->mode = armh->mode; asyh->lut = armh->lut; diff --git a/drivers/gpu/drm/rcar-du/rcar_du_plane.c b/drivers/gpu/drm/rcar-du/rcar_du_plane.c index dcde6288da6c..a856507f5717 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_plane.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_plane.c @@ -623,7 +623,8 @@ rcar_du_plane_atomic_duplicate_state(struct drm_plane *plane) if (copy == NULL) return NULL; - __drm_atomic_helper_plane_duplicate_state(plane, ©->state); + __drm_atomic_helper_plane_duplicate_state(plane, ©->state, + plane->state); return ©->state; } diff --git a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c index f870445ebc8d..21a30775edb7 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c @@ -316,7 +316,8 @@ rcar_du_vsp_plane_atomic_duplicate_state(struct drm_plane *plane) if (copy == NULL) return NULL; - __drm_atomic_helper_plane_duplicate_state(plane, ©->state); + __drm_atomic_helper_plane_duplicate_state(plane, ©->state, + plane->state); return ©->state; } diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index ee876a9631f0..9f586f698e52 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -1112,7 +1112,8 @@ static struct drm_crtc_state *vop_crtc_duplicate_state(struct drm_crtc *crtc) if (!rockchip_state) return NULL; - __drm_atomic_helper_crtc_duplicate_state(crtc, &rockchip_state->base); + __drm_atomic_helper_crtc_duplicate_state(crtc, &rockchip_state->base, + crtc->state); return &rockchip_state->base; } diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index 0cb9b90e2e68..d725115d011d 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -457,7 +457,8 @@ static struct drm_plane_state *tegra_plane_atomic_duplicate_state(struct drm_pla if (!copy) return NULL; - __drm_atomic_helper_plane_duplicate_state(plane, ©->base); + __drm_atomic_helper_plane_duplicate_state(plane, ©->base, + plane->state); copy->tiling = state->tiling; copy->format = state->format; copy->swap = state->swap; @@ -1042,7 +1043,8 @@ tegra_crtc_atomic_duplicate_state(struct drm_crtc *crtc) if (!copy) return NULL; - __drm_atomic_helper_crtc_duplicate_state(crtc, ©->base); + __drm_atomic_helper_crtc_duplicate_state(crtc, ©->base, + crtc->state); copy->clk = state->clk; copy->pclk = state->pclk; copy->div = state->div; diff --git a/drivers/gpu/drm/tegra/dsi.c b/drivers/gpu/drm/tegra/dsi.c index 3dea1216bafd..ce646493e939 100644 --- a/drivers/gpu/drm/tegra/dsi.c +++ b/drivers/gpu/drm/tegra/dsi.c @@ -809,7 +809,8 @@ tegra_dsi_connector_duplicate_state(struct drm_connector *connector) return NULL; __drm_atomic_helper_connector_duplicate_state(connector, - ©->base); + ©->base, + connector->state); return ©->base; } diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c index a8f528925009..02c3439c2e96 100644 --- a/drivers/gpu/drm/tegra/sor.c +++ b/drivers/gpu/drm/tegra/sor.c @@ -1334,7 +1334,8 @@ tegra_sor_connector_duplicate_state(struct drm_connector *connector) if (!copy) return NULL; - __drm_atomic_helper_connector_duplicate_state(connector, ©->base); + __drm_atomic_helper_connector_duplicate_state(connector, ©->base, + connector->state); return ©->base; } diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c index 9e0c1500375c..28bdfb5adb9e 100644 --- a/drivers/gpu/drm/vc4/vc4_crtc.c +++ b/drivers/gpu/drm/vc4/vc4_crtc.c @@ -821,7 +821,8 @@ static struct drm_crtc_state *vc4_crtc_duplicate_state(struct drm_crtc *crtc) if (!vc4_state) return NULL; - __drm_atomic_helper_crtc_duplicate_state(crtc, &vc4_state->base); + __drm_atomic_helper_crtc_duplicate_state(crtc, &vc4_state->base, + crtc->state); return &vc4_state->base; } diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c index 8853e9a4f005..43b388a42c1e 100644 --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c @@ -187,7 +187,8 @@ static struct drm_plane_state *vc4_plane_duplicate_state(struct drm_plane *plane memset(&vc4_state->lbm, 0, sizeof(vc4_state->lbm)); - __drm_atomic_helper_plane_duplicate_state(plane, &vc4_state->base); + __drm_atomic_helper_plane_duplicate_state(plane, &vc4_state->base, + plane->state); if (vc4_state->dlist) { vc4_state->dlist = kmemdup(vc4_state->dlist, diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c index 1cd67b10a0d9..dc3b4a9e3d25 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c @@ -612,7 +612,7 @@ vmw_du_crtc_duplicate_state(struct drm_crtc *crtc) state = &vcs->base; - __drm_atomic_helper_crtc_duplicate_state(crtc, state); + __drm_atomic_helper_crtc_duplicate_state(crtc, state, crtc->state); return state; } @@ -701,7 +701,7 @@ vmw_du_plane_duplicate_state(struct drm_plane *plane) state = &vps->base; - __drm_atomic_helper_plane_duplicate_state(plane, state); + __drm_atomic_helper_plane_duplicate_state(plane, state, plane->state); return state; } @@ -796,7 +796,8 @@ vmw_du_connector_duplicate_state(struct drm_connector *connector) state = &vcs->base; - __drm_atomic_helper_connector_duplicate_state(connector, state); + __drm_atomic_helper_connector_duplicate_state(connector, state, + connector->state); return state; } diff --git a/include/drm/drm_atomic_helper.h b/include/drm/drm_atomic_helper.h index 7db3438ff735..0adacaca0941 100644 --- a/include/drm/drm_atomic_helper.h +++ b/include/drm/drm_atomic_helper.h @@ -152,7 +152,8 @@ drm_atomic_helper_best_encoder(struct drm_connector *connector); /* default implementations for state handling */ void drm_atomic_helper_crtc_reset(struct drm_crtc *crtc); void __drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc, - struct drm_crtc_state *state); + struct drm_crtc_state *state, + const struct drm_crtc_state *old_state); struct drm_crtc_state * drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc); void __drm_atomic_helper_crtc_destroy_state(struct drm_crtc_state *state); @@ -161,7 +162,8 @@ void drm_atomic_helper_crtc_destroy_state(struct drm_crtc *crtc, void drm_atomic_helper_plane_reset(struct drm_plane *plane); void __drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane, - struct drm_plane_state *state); + struct drm_plane_state *state, + const struct drm_plane_state *old_state); struct drm_plane_state * drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane); void __drm_atomic_helper_plane_destroy_state(struct drm_plane_state *state); @@ -173,7 +175,8 @@ void __drm_atomic_helper_connector_reset(struct drm_connector *connector, void drm_atomic_helper_connector_reset(struct drm_connector *connector); void __drm_atomic_helper_connector_duplicate_state(struct drm_connector *connector, - struct drm_connector_state *state); + struct drm_connector_state *state, + const struct drm_connector_state *old_state); struct drm_connector_state * drm_atomic_helper_connector_duplicate_state(struct drm_connector *connector); struct drm_atomic_state * @@ -188,7 +191,8 @@ int drm_atomic_helper_legacy_gamma_set(struct drm_crtc *crtc, uint32_t size, struct drm_modeset_acquire_ctx *ctx); void __drm_atomic_helper_private_obj_duplicate_state(struct drm_private_obj *obj, - struct drm_private_state *state); + struct drm_private_state *state, + const struct drm_private_state *old_state); /** * drm_atomic_crtc_for_each_plane - iterate over planes currently attached to CRTC -- 2.13.0 _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel