drm/atomic: Remove deprecated atomic iterator macros.
Subsystems (17)
Maarten Lankhorst
maintainercover drm/atomic: Remove deprecated atomic iterator macros.
It's time to kill off for_each_obj_in_state, and convert the remainder to for_each_(old/new/both)_obj_in_state.
Maarten Lankhorst (16):
drm/simple-kms-helper: Fix the check for the mismatch between plane
and CRTC enabled.
drm/atomic: Use the correct iterator macro in atomic_remove_fb drm/atomic: Use the new helpers in drm_atomic_helper_disable_all() drm/atomic: Use new iterator macros in
drm_atomic_helper_wait_for_flip_done
drm/vmwgfx: Make check_modeset() use the new atomic iterator macros. drm/i915: Use correct iterator macro
drm/rcar-du: Use new iterator macros
drm/atmel-hlcdec: Use for_each_new_connector_in_state drm/rockchip: Use for_each_oldnew_plane_in_state in
vop_crtc_atomic_flush
drm/omapdrm: Fix omap_atomic_wait_for_completion drm/mali: Use new atomic iterator macros
drm/imx: Use atomic iterator macros
drm/mediatek: Convert to new iterator macros
drm/msm: Convert to use new iterator macros
drm/nouveau: Convert nouveau to use new iterator macros drm/atomic: Remove deprecated accessor macros
drivers/gpu/drm/arm/malidp_drv.c | 2 +- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c | 2 +- drivers/gpu/drm/drm_atomic_helper.c | 8 +-- drivers/gpu/drm/drm_framebuffer.c | 2 +- drivers/gpu/drm/drm_simple_kms_helper.c | 10 ++-- drivers/gpu/drm/i915/intel_hdmi.c | 2 +- drivers/gpu/drm/imx/imx-drm-core.c | 8 +-- drivers/gpu/drm/imx/ipuv3-plane.c | 2 +- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 6 +-- drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c | 4 +- drivers/gpu/drm/msm/msm_atomic.c | 16 +++--- drivers/gpu/drm/nouveau/nv50_display.c | 71 ++++++++++++------------ drivers/gpu/drm/omapdrm/omap_drv.c | 6 +-- drivers/gpu/drm/rcar-du/rcar_du_plane.c | 41 +++++++------- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 7 +-- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 3 +- include/drm/drm_atomic.h | 75 -------------------------- include/drm/drm_connector.h | 3 +- include/drm/drm_crtc.h | 8 +-- include/drm/drm_plane.h | 8 +-- 20 files changed, 106 insertions(+), 178 deletions(-)
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Maarten Lankhorst
maintainerPATCH 1/16 drm/simple-kms-helper: Fix the check for the mismatch between plane and CRTC enabled.
You can enable the CRTC and without adding the plane to the state and it will succeed. This should be prevented in the crtc check instead of the plane check, because the plane check may never run for atomic enable, but the crtc check always will.
This is based on a similar check in vmwgfx.
--- drivers/gpu/drm/drm_simple_kms_helper.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/gpu/drm/drm_simple_kms_helper.c +7 -3
@@ -37,6 +37,13 @@ static const struct drm_encoder_funcs drm_simple_kms_encoder_funcs = {static int drm_simple_kms_crtc_check (struct drm_crtc *crtc,struct drm_crtc_state *state) { +bool has_primary = state->plane_mask & +BIT (drm_plane_index (crtc->primary)); + +/* We always want to have an active plane with an active CRTC */ +if (has_primary != state->enable) +return -EINVAL ; +return drm_atomic_add_affected_planes (state->state, crtc); }
@@ -90,9 +97,6 @@ static int drm_simple_kms_plane_atomic_check(struct drm_plane *plane, pipe = container_of(plane, struct drm_simple_display_pipe, plane); crtc_state =drm_atomic_get_new_crtc_state (plane_state->state, &pipe->crtc); -if (crtc_state->enable != !!plane_state->crtc) -return -EINVAL ;/* plane must match crtc enable state */ -if (!crtc_state->enable)return 0 ;/* nothing to check when disabling or disabled */
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 01/16] drm/simple-kms-helper: Fix the check for the mismatch between plane and CRTC enabled.
Quoted 5 lines · Maarten Lankhorst
You can enable the CRTC and without adding the plane to the state and it will succeed. This should be prevented in the crtc check instead of the plane check, because the plane check may never run for atomic enable, but the crtc check always will.
Quoted 7 lines
This is based on a similar check in vmwgfx.
Signed-off-by Maarten Lankhorst <[email protected]>Cc Daniel Vetter <[email protected]>Cc Jani Nikula <[email protected]>Cc Sean Paul <[email protected]>Cc David Airlie <[email protected]>
Somehow this missed to cc: Noralf ... I guess get_maintainers is not quite smart enough.
Quoted 39 lines
--- drivers/gpu/drm/drm_simple_kms_helper.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)drivers/gpu/drm/drm_simple_kms_helper.c +7
-3@@ -37,6 +37,13 @@ static const struct drm_encoder_funcs drm_simple_kms_encoder_funcs = {static int drm_simple_kms_crtc_check (struct drm_crtc *crtc,struct drm_crtc_state *state) { +bool has_primary = state->plane_mask & +BIT (drm_plane_index (crtc->primary)); + +/* We always want to have an active plane with an active CRTC */ +if (has_primary != state->enable) +return -EINVAL ; +return drm_atomic_add_affected_planes (state->state, crtc); }@@ -90,9 +97,6 @@ static int drm_simple_kms_plane_atomic_check(struct drm_plane *plane, pipe = container_of(plane, struct drm_simple_display_pipe, plane); crtc_state =drm_atomic_get_new_crtc_state (plane_state->state, &pipe->crtc); -if (crtc_state->enable != !!plane_state->crtc) -return -EINVAL ;/* plane must match crtc enable state */ -if (!crtc_state->enable)return 0 ;/* nothing to check when disabling or disabled */ Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Maarten Lankhorst
maintainerPATCH 2/16 drm/atomic: Use the correct iterator macro in atomic_remove_fb
In reply to Maarten Lankhorstfor_each_obj_in_state will be removed, so use the new state here.
--- drivers/gpu/drm/drm_framebuffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_framebuffer.c +1 -1
@@ -817,7 +817,7 @@ static int atomic_remove_fb(struct drm_framebuffer *fb) plane->old_fb = plane->fb; } -for_each_connector_in_state (state, conn, conn_state, i) { +for_each_new_connector_in_state (state, conn, conn_state, i) { ret =drm_atomic_set_crtc_for_connector (conn_state,NULL );if (ret)
Signature · 6 lines
2.11.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 02/16] drm/atomic: Use the correct iterator macro in atomic_remove_fb
Quoted 7 lines · Maarten Lankhorst
for_each_obj_in_statewill be removed, so use the new state here.Signed-off-by Maarten Lankhorst <[email protected]>Cc Daniel Vetter <[email protected]>Cc Jani Nikula <[email protected]>Cc Sean Paul <[email protected]>Cc David Airlie <[email protected]>
Quoted 24 lines
--- drivers/gpu/drm/drm_framebuffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/drm_framebuffer.c +1
-1@@ -817,7 +817,7 @@ static int atomic_remove_fb(struct drm_framebuffer *fb) plane->old_fb = plane->fb; } -for_each_connector_in_state (state, conn, conn_state, i) { +for_each_new_connector_in_state (state, conn, conn_state, i) { ret =drm_atomic_set_crtc_for_connector (conn_state,NULL );if (ret)Signature · 6 lines
2.11.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Maarten Lankhorst
maintainerPATCH 3/16 drm/atomic: Use the new helpers in drm_atomic_helper_disable_all()
In reply to Maarten Lankhorstfor_each_obj_in_state will be removed, so don't use it here.
--- drivers/gpu/drm/drm_atomic_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_atomic_helper.c +2 -2
@@ -2715,13 +2715,13 @@ int drm_atomic_helper_disable_all(struct drm_device *dev, goto free; } -for_each_connector_in_state (state, conn, conn_state, i) { +for_each_new_connector_in_state (state, conn, conn_state, i) { ret =drm_atomic_set_crtc_for_connector (conn_state,NULL );if (ret <0 ) goto free; } -for_each_plane_in_state (state, plane, plane_state, i) { +for_each_new_plane_in_state (state, plane, plane_state, i) { ret =drm_atomic_set_crtc_for_plane (plane_state,NULL );if (ret <0 ) goto free;
Signature · 6 lines
2.11.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 03/16] drm/atomic: Use the new helpers in drm_atomic_helper_disable_all()
Quoted 7 lines · Maarten Lankhorst
for_each_obj_in_statewill be removed, so don't use it here.Signed-off-by Maarten Lankhorst <[email protected]>Cc Daniel Vetter <[email protected]>Cc Jani Nikula <[email protected]>Cc Sean Paul <[email protected]>Cc David Airlie <[email protected]>
Quoted 31 lines
--- drivers/gpu/drm/drm_atomic_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/drm_atomic_helper.c +2
-2@@ -2715,13 +2715,13 @@ int drm_atomic_helper_disable_all(struct drm_device *dev, goto free; } -for_each_connector_in_state (state, conn, conn_state, i) { +for_each_new_connector_in_state (state, conn, conn_state, i) { ret =drm_atomic_set_crtc_for_connector (conn_state,NULL );if (ret <0 ) goto free; } -for_each_plane_in_state (state, plane, plane_state, i) { +for_each_new_plane_in_state (state, plane, plane_state, i) { ret =drm_atomic_set_crtc_for_plane (plane_state,NULL );if (ret <0 ) goto free;Signature · 6 lines
2.11.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Maarten Lankhorst
maintainerPATCH 4/16 drm/atomic: Use new iterator macros in drm_atomic_helper_wait_for_flip_done
In reply to Maarten Lankhorstfor_each_obj_in_state is about to be removed, so use the correct new iterator macro.
--- drivers/gpu/drm/drm_atomic_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_atomic_helper.c +2 -2
@@ -1270,7 +1270,7 @@ void drm_atomic_helper_wait_for_flip_done(struct drm_device *dev,struct drm_crtc *crtc;int i; -for_each_crtc_in_state (old_state, crtc, crtc_state, i) { +for_each_new_crtc_in_state (old_state, crtc, crtc_state, i) {struct drm_crtc_commit *commit = old_state->crtcs[i].commit;int ret;
@@ -1426,7 +1426,7 @@ int drm_atomic_helper_async_check(struct drm_device *dev,if (!crtc->state->state)continue ; -for_each_plane_in_state (crtc->state->state, __plane, +for_each_new_plane_in_state (crtc->state->state, __plane, __plane_state, j) {if (__plane == plane)return -EINVAL ;
Signature · 6 lines
2.11.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [Intel-gfx] [PATCH 04/16] drm/atomic: Use new iterator macros in drm_atomic_helper_wait_for_flip_done
Quoted 17 lines · Maarten Lankhorst
for_each_obj_in_stateis about to be removed, so use the correct new iterator macro.Signed-off-by Maarten Lankhorst <[email protected]>Cc Daniel Vetter <[email protected]>Cc Jani Nikula <[email protected]>Cc Sean Paul <[email protected]>Cc David Airlie <[email protected]>--- drivers/gpu/drm/drm_atomic_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/drm_atomic_helper.c +0
-0
drivers/gpu/drm/drm_atomic_helper.c void drm_atomic_helper_wait_for_flip_done(struct drm_device *dev, · line 1273
Quoted 5 lines
drivers/gpu/drm/drm_atomic_helper.c +1
-1@@ -1270,7 +1270,7 @@ void drm_atomic_helper_wait_for_flip_done(struct drm_device *dev,struct drm_crtc *crtc;int i; -for_each_crtc_in_state (old_state, crtc, crtc_state, i) { +for_each_new_crtc_in_state (old_state, crtc, crtc_state, i) {
Hm, should we do an s/crtc_state/unused/ here, this is a bit confusing since we don't really care about whether we get the new or old state.
drivers/gpu/drm/drm_atomic_helper.c int drm_atomic_helper_async_check(struct drm_device *dev, · line 1429
Quoted 8 lines
drivers/gpu/drm/drm_atomic_helper.c +0
-1struct drm_crtc_commit *commit = old_state->crtcs[i].commit;int ret;@@ -1426,7 +1426,7 @@ int drm_atomic_helper_async_check(struct drm_device *dev,if (!crtc->state->state)continue ; - for_each_plane_in_state(crtc->state->state, __plane,
s/crtc->state->state/state/ ... somehow didn't spot that. And maybe split this hunk here out and Cc: Gustavo.
drivers/gpu/drm/drm_atomic_helper.c int drm_atomic_helper_async_check(struct drm_device *dev, · line 1432
Quoted 4 lines
drivers/gpu/drm/drm_atomic_helper.c +1
-0+for_each_new_plane_in_state (crtc->state->state, __plane, __plane_state, j) {if (__plane == plane)return -EINVAL ;
Thinking about this some more, this doesn't do anything at all, because crtc->state->state is always NULL once committed. I think this needs an entirely different patch, we probably need to check for crtc_commit->hw_done. This here doesn't do the right thing I think.
Anyway, on the first hunk only, with the bikeshed to rename the unused variable to "unused" applied:
Quoted 7 lines
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Maarten Lankhorst
maintainerPATCH 5/16 drm/vmwgfx: Make check_modeset() use the new atomic iterator macros.
In reply to Maarten LankhorstI don't think the checking of resources in this function is very atomic-like, but it should definitely not use a macro that's about to be removed.
--- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +1 -2
@@ -1536,8 +1536,7 @@ vmw_kms_atomic_check_modeset(struct drm_device *dev,struct vmw_private *dev_priv =vmw_priv (dev);int i; - -for_each_crtc_in_state (state, crtc, crtc_state, i) { +for_each_new_crtc_in_state (state, crtc, crtc_state, i) {unsigned long requested_bb_mem =0 ;if (dev_priv->active_display_unit == vmw_du_screen_target) {
Signature · 6 lines
2.11.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 05/16] drm/vmwgfx: Make check_modeset() use the new atomic iterator macros.
Quoted 29 lines · Maarten Lankhorst
I don't think the checking of resources in this function is very atomic-like, but it should definitely not use a macro that's about to be removed.
Signed-off-by Maarten Lankhorst <[email protected]>Cc VMware Graphics <[email protected]>Cc Sinclair Yeh <[email protected]>Cc Thomas Hellstrom <[email protected]>--- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +1
-2@@ -1536,8 +1536,7 @@ vmw_kms_atomic_check_modeset(struct drm_device *dev,struct vmw_private *dev_priv =vmw_priv (dev);int i; - -for_each_crtc_in_state (state, crtc, crtc_state, i) { +for_each_new_crtc_in_state (state, crtc, crtc_state, i) {unsigned long requested_bb_mem =0 ;if (dev_priv->active_display_unit == vmw_du_screen_target) {Signature · 1 line
2.11.0
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [Intel-gfx] [PATCH 05/16] drm/vmwgfx: Make check_modeset() use the new atomic iterator macros.
In reply to Maarten Lankhorstdrivers/gpu/drm/vmwgfx/vmwgfx_kms.c vmw_kms_atomic_check_modeset(struct drm_device *dev,
Quoted 17 lines · Maarten Lankhorst
I don't think the checking of resources in this function is very atomic-like, but it should definitely not use a macro that's about to be removed.
Signed-off-by Maarten Lankhorst <[email protected]>Cc VMware Graphics <[email protected]>Cc Sinclair Yeh <[email protected]>Cc Thomas Hellstrom <[email protected]>--- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +0
-0@@ -1536,8 +1536,7 @@ vmw_kms_atomic_check_modeset(struct drm_device *dev,
Afaics vmw_kms_atomic_check_modeset should be static. Feel free to include or not include that bikeshed.
Quoted 16 lines
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +1
-2struct vmw_private *dev_priv =vmw_priv (dev);int i; - -for_each_crtc_in_state (state, crtc, crtc_state, i) { +for_each_new_crtc_in_state (state, crtc, crtc_state, i) {unsigned long requested_bb_mem =0 ;if (dev_priv->active_display_unit == vmw_du_screen_target) {Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [Intel-gfx] [PATCH 05/16] drm/vmwgfx: Make check_modeset() use the new atomic iterator macros.
Quoted 22 lines · Daniel Vetter
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c vmw_kms_atomic_check_modeset(struct drm_device *dev,
Quoted 17 lines · Maarten Lankhorst
I don't think the checking of resources in this function is very atomic-like, but it should definitely not use a macro that's about to be removed.
Signed-off-by Maarten Lankhorst <[email protected]>Cc VMware Graphics <[email protected]>Cc Sinclair Yeh <[email protected]>Cc Thomas Hellstrom <[email protected]>--- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +0
-0@@ -1536,8 +1536,7 @@ vmw_kms_atomic_check_modeset(struct drm_device *dev,Afaics
vmw_kms_atomic_check_modesetshould be static. Feel free to include or not include that bikeshed.
Quoted 1 line
Reviewed-by Daniel Vetter <[email protected]>
Yeah, good point.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Maarten Lankhorst
maintainerPATCH 6/16 drm/i915: Use correct iterator macro
In reply to Maarten Lankhorstfor_each_cnonector_in_state will be removed, so use the right state here.
--- drivers/gpu/drm/i915/intel_hdmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_hdmi.c +1 -1
@@ -1321,7 +1321,7 @@ static bool hdmi_12bpc_possible(struct intel_crtc_state *crtc_state)if (crtc_state->output_types !=1 <<INTEL_OUTPUT_HDMI )return false; -for_each_connector_in_state (state, connector, connector_state, i) { +for_each_new_connector_in_state (state, connector, connector_state, i) {const struct drm_display_info *info = &connector->display_info;if (connector_state->crtc != crtc_state->base.crtc)
Signature · 6 lines
2.11.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 06/16] drm/i915: Use correct iterator macro
Quoted 7 lines · Maarten Lankhorst
for_each_cnonector_in_statewill be removed, so use the right state here.Signed-off-by Maarten Lankhorst <[email protected]>Cc Daniel Vetter <[email protected]>Cc Jani Nikula <[email protected]>
Quoted 24 lines
--- drivers/gpu/drm/i915/intel_hdmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/i915/intel_hdmi.c +1
-1@@ -1321,7 +1321,7 @@ static bool hdmi_12bpc_possible(struct intel_crtc_state *crtc_state)if (crtc_state->output_types !=1 <<INTEL_OUTPUT_HDMI )return false; -for_each_connector_in_state (state, connector, connector_state, i) { +for_each_new_connector_in_state (state, connector, connector_state, i) {const struct drm_display_info *info = &connector->display_info;if (connector_state->crtc != crtc_state->base.crtc)Signature · 6 lines
2.11.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Maarten Lankhorst
maintainerPATCH 7/16 drm/rcar-du: Use new iterator macros
In reply to Maarten Lankhorstfor_each_obj_in_state is about to be removed, so use the correct new iterator macros.
--- drivers/gpu/drm/rcar-du/rcar_du_plane.c | 41 ++++++++++++++++----------------- 1 file changed, 20 insertions(+), 21 deletions(-)
drivers/gpu/drm/rcar-du/rcar_du_plane.c +20 -21
@@ -51,12 +51,9 @@*/ static bool rcar_du_plane_needs_realloc (struct rcar_du_plane *plane, +const struct rcar_du_plane_state *cur_state,struct rcar_du_plane_state *new_state) { -struct rcar_du_plane_state *cur_state; - - cur_state =to_rcar_plane_state (plane->plane.state); -/* Lowering the number of planes doesn't strictly require reallocation * as the extra hardware plane will be freed when committing, but doing * so could lead to more fragmentation.
@@ -141,16 +138,17 @@ int rcar_du_atomic_check_planes(struct drm_device *dev,unsigned int groups =0 ;unsigned int i;struct drm_plane *drm_plane; -struct drm_plane_state *drm_plane_state; +struct drm_plane_state *old_drm_plane_state, *new_drm_plane_state;/* Check if hardware planes need to be reallocated. */ -for_each_plane_in_state (state, drm_plane, drm_plane_state, i) { -struct rcar_du_plane_state *plane_state; +for_each_oldnew_plane_in_state (state, drm_plane, old_drm_plane_state, new_drm_plane_state, i) { +struct rcar_du_plane_state *old_plane_state, *new_plane_state;struct rcar_du_plane *plane;unsigned int index; plane =to_rcar_plane (drm_plane); - plane_state =to_rcar_plane_state (drm_plane_state); + old_plane_state =to_rcar_plane_state (old_drm_plane_state); + new_plane_state =to_rcar_plane_state (new_drm_plane_state);dev_dbg (rcdu->dev,"%s: checking plane (%u,%tu)\n" , __func__, plane->group->index, plane - plane->group->planes);
@@ -159,19 +157,19 @@ int rcar_du_atomic_check_planes(struct drm_device *dev,* the full reallocation procedure. Just mark the hardware * plane(s) as freed. */ -if (!plane_state->format) { +if (!new_plane_state->format) {dev_dbg (rcdu->dev,"%s: plane is being disabled\n" , __func__); index = plane - plane->group->planes; group_freed_planes[plane->group->index] |=1 << index; - plane_state->hwindex =-1 ; + new_plane_state->hwindex =-1 ;continue ; }/* If the plane needs to be reallocated mark it as such, and * mark the hardware plane(s) as free. */ -if (rcar_du_plane_needs_realloc (plane, plane_state)) { +if (rcar_du_plane_needs_realloc (plane, old_plane_state, new_plane_state)) {dev_dbg (rcdu->dev,"%s: plane needs reallocation\n" , __func__); groups |=1 << plane->group->index;
@@ -179,7 +177,7 @@ int rcar_du_atomic_check_planes(struct drm_device *dev, index = plane - plane->group->planes; group_freed_planes[plane->group->index] |=1 << index; - plane_state->hwindex =-1 ; + new_plane_state->hwindex =-1 ; } }
@@ -226,16 +224,16 @@ int rcar_du_atomic_check_planes(struct drm_device *dev,continue ; } - plane_state =to_rcar_plane_state (plane->plane.state); + new_plane_state =to_rcar_plane_state (plane->plane.state); used_planes |=rcar_du_plane_hwmask (plane_state);dev_dbg (rcdu->dev,"%s: plane (%u,%tu) uses %u hwplanes (index %d)\n" , __func__, plane->group->index, plane - plane->group->planes, - plane_state->format ? - plane_state->format->planes :0 , - plane_state->hwindex); + new_plane_state->format ? + new_plane_state->format->planes :0 , + new_plane_state->hwindex); } group_free_planes[index] =0xff & ~used_planes;
@@ -246,15 +244,16 @@ int rcar_du_atomic_check_planes(struct drm_device *dev, }/* Reallocate hardware planes for each plane that needs it. */ -for_each_plane_in_state (state, drm_plane, drm_plane_state, i) { -struct rcar_du_plane_state *plane_state; +for_each_oldnew_plane_in_state (state, drm_plane, old_drm_plane_state, new_drm_plane_state, i) { +struct rcar_du_plane_state *old_plane_state, *new_plane_state;struct rcar_du_plane *plane;unsigned int crtc_planes;unsigned int free;int idx; plane =to_rcar_plane (drm_plane); - plane_state =to_rcar_plane_state (drm_plane_state); + old_plane_state =to_rcar_plane_state (old_drm_plane_state); + new_plane_state =to_rcar_plane_state (new_drm_plane_state);dev_dbg (rcdu->dev,"%s: allocating plane (%u,%tu)\n" , __func__, plane->group->index, plane - plane->group->planes);
@@ -263,7 +262,7 @@ int rcar_du_atomic_check_planes(struct drm_device *dev,* reallocated. */ if (!plane_state->format || - !rcar_du_plane_needs_realloc (plane, plane_state)) + !rcar_du_plane_needs_realloc (plane, old_plane_state, new_plane_state))continue ;/* Try to allocate the plane from the free planes currently
@@ -279,7 +278,7 @@ int rcar_du_atomic_check_planes(struct drm_device *dev, idx =rcar_du_plane_hwalloc (plane, plane_state, free & crtc_planes);if (idx <0 ) - idx =rcar_du_plane_hwalloc (plane, plane_state, + idx =rcar_du_plane_hwalloc (plane, new_plane_state, free);if (idx <0 ) { dev_dbg(rcdu->dev, "%s: no available hardware plane\n",
Signature · 6 lines
2.11.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 07/16] drm/rcar-du: Use new iterator macros
Quoted 6 lines · Maarten Lankhorst
for_each_obj_in_stateis about to be removed, so use the correct new iterator macros.Signed-off-by Maarten Lankhorst <[email protected]>Cc Laurent Pinchart <[email protected]>
Looks correct, but I think Laurent has a patch to rework/remove this. Found something below anyway.
Quoted 118 lines
--- drivers/gpu/drm/rcar-du/rcar_du_plane.c | 41 ++++++++++++++++----------------- 1 file changed, 20 insertions(+), 21 deletions(-)drivers/gpu/drm/rcar-du/rcar_du_plane.c +18
-19@@ -51,12 +51,9 @@*/ static bool rcar_du_plane_needs_realloc (struct rcar_du_plane *plane, +const struct rcar_du_plane_state *cur_state,struct rcar_du_plane_state *new_state) { -struct rcar_du_plane_state *cur_state; - - cur_state =to_rcar_plane_state (plane->plane.state); -/* Lowering the number of planes doesn't strictly require reallocation * as the extra hardware plane will be freed when committing, but doing * so could lead to more fragmentation. @@ -141,16 +138,17 @@ int rcar_du_atomic_check_planes(struct drm_device *dev,unsigned int groups =0 ;unsigned int i;struct drm_plane *drm_plane; -struct drm_plane_state *drm_plane_state; +struct drm_plane_state *old_drm_plane_state, *new_drm_plane_state;/* Check if hardware planes need to be reallocated. */ -for_each_plane_in_state (state, drm_plane, drm_plane_state, i) { -struct rcar_du_plane_state *plane_state; +for_each_oldnew_plane_in_state (state, drm_plane, old_drm_plane_state, new_drm_plane_state, i) { +struct rcar_du_plane_state *old_plane_state, *new_plane_state;struct rcar_du_plane *plane;unsigned int index; plane =to_rcar_plane (drm_plane); - plane_state =to_rcar_plane_state (drm_plane_state); + old_plane_state =to_rcar_plane_state (old_drm_plane_state); + new_plane_state =to_rcar_plane_state (new_drm_plane_state);dev_dbg (rcdu->dev,"%s: checking plane (%u,%tu)\n" , __func__, plane->group->index, plane - plane->group->planes);@@ -159,19 +157,19 @@ int rcar_du_atomic_check_planes(struct drm_device *dev,* the full reallocation procedure. Just mark the hardware * plane(s) as freed. */ -if (!plane_state->format) { +if (!new_plane_state->format) {dev_dbg (rcdu->dev,"%s: plane is being disabled\n" , __func__); index = plane - plane->group->planes; group_freed_planes[plane->group->index] |=1 << index; - plane_state->hwindex =-1 ; + new_plane_state->hwindex =-1 ;continue ; }/* If the plane needs to be reallocated mark it as such, and * mark the hardware plane(s) as free. */ -if (rcar_du_plane_needs_realloc (plane, plane_state)) { +if (rcar_du_plane_needs_realloc (plane, old_plane_state, new_plane_state)) {dev_dbg (rcdu->dev,"%s: plane needs reallocation\n" , __func__); groups |=1 << plane->group->index;@@ -179,7 +177,7 @@ int rcar_du_atomic_check_planes(struct drm_device *dev, index = plane - plane->group->planes; group_freed_planes[plane->group->index] |=1 << index; - plane_state->hwindex =-1 ; + new_plane_state->hwindex =-1 ; } }@@ -226,16 +224,16 @@ int rcar_du_atomic_check_planes(struct drm_device *dev,continue ; } - plane_state =to_rcar_plane_state (plane->plane.state); + new_plane_state =to_rcar_plane_state (plane->plane.state); used_planes |=rcar_du_plane_hwmask (plane_state);dev_dbg (rcdu->dev,"%s: plane (%u,%tu) uses %u hwplanes (index %d)\n" , __func__, plane->group->index, plane - plane->group->planes, - plane_state->format ? - plane_state->format->planes :0 , - plane_state->hwindex); + new_plane_state->format ? + new_plane_state->format->planes :0 , + new_plane_state->hwindex); } group_free_planes[index] =0xff & ~used_planes;@@ -246,15 +244,16 @@ int rcar_du_atomic_check_planes(struct drm_device *dev, }/* Reallocate hardware planes for each plane that needs it. */ -for_each_plane_in_state (state, drm_plane, drm_plane_state, i) { -struct rcar_du_plane_state *plane_state; +for_each_oldnew_plane_in_state (state, drm_plane, old_drm_plane_state, new_drm_plane_state, i) { +struct rcar_du_plane_state *old_plane_state, *new_plane_state;struct rcar_du_plane *plane;unsigned int crtc_planes;unsigned int free;int idx; plane =to_rcar_plane (drm_plane); - plane_state =to_rcar_plane_state (drm_plane_state); + old_plane_state =to_rcar_plane_state (old_drm_plane_state); + new_plane_state =to_rcar_plane_state (new_drm_plane_state);dev_dbg (rcdu->dev,"%s: allocating plane (%u,%tu)\n" , __func__, plane->group->index, plane - plane->group->planes);
drivers/gpu/drm/rcar-du/rcar_du_plane.c int rcar_du_atomic_check_planes(struct drm_device *dev, · line 264
Quoted 3 lines
drivers/gpu/drm/rcar-du/rcar_du_plane.c +0
-0@@ -263,7 +262,7 @@ int rcar_du_atomic_check_planes(struct drm_device *dev,* reallocated. */ if (!plane_state->format ||
I think you missed a few cases of replacing plane_state here. Does this compile?
-Daniel
Quoted 21 lines
drivers/gpu/drm/rcar-du/rcar_du_plane.c +2
-2- !rcar_du_plane_needs_realloc(plane, plane_state)) + !rcar_du_plane_needs_realloc(plane, old_plane_state, new_plane_state)) continue;/* Try to allocate the plane from the free planes currently @@ -279,7 +278,7 @@ int rcar_du_atomic_check_planes(struct drm_device *dev, idx =rcar_du_plane_hwalloc (plane, plane_state, free & crtc_planes);if (idx <0 ) - idx =rcar_du_plane_hwalloc (plane, plane_state, + idx =rcar_du_plane_hwalloc (plane, new_plane_state, free);if (idx <0 ) { dev_dbg(rcdu->dev, "%s: no available hardware plane\n",Signature · 6 lines
2.11.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Maarten Lankhorst
maintainerPATCH v2 7/16 drm/rcar-du: Use new iterator macros, v2.
Op 12-07-17 om 11:15 schreef Daniel Vetter:
Quoted 125 lines · Maarten Lankhorst
Quoted 6 lines
for_each_obj_in_stateis about to be removed, so use the correct new iterator macros.Signed-off-by Maarten Lankhorst <[email protected]>Cc Laurent Pinchart <[email protected]>Looks correct, but I think Laurent has a patch to rework/remove this. Found something below anyway.
Quoted 115 lines
--- drivers/gpu/drm/rcar-du/rcar_du_plane.c | 41 ++++++++++++++++----------------- 1 file changed, 20 insertions(+), 21 deletions(-)drivers/gpu/drm/rcar-du/rcar_du_plane.c +18
-19@@ -51,12 +51,9 @@*/ static bool rcar_du_plane_needs_realloc (struct rcar_du_plane *plane, +const struct rcar_du_plane_state *cur_state,struct rcar_du_plane_state *new_state) { -struct rcar_du_plane_state *cur_state; - - cur_state =to_rcar_plane_state (plane->plane.state); -/* Lowering the number of planes doesn't strictly require reallocation * as the extra hardware plane will be freed when committing, but doing * so could lead to more fragmentation. @@ -141,16 +138,17 @@ int rcar_du_atomic_check_planes(struct drm_device *dev,unsigned int groups =0 ;unsigned int i;struct drm_plane *drm_plane; -struct drm_plane_state *drm_plane_state; +struct drm_plane_state *old_drm_plane_state, *new_drm_plane_state;/* Check if hardware planes need to be reallocated. */ -for_each_plane_in_state (state, drm_plane, drm_plane_state, i) { -struct rcar_du_plane_state *plane_state; +for_each_oldnew_plane_in_state (state, drm_plane, old_drm_plane_state, new_drm_plane_state, i) { +struct rcar_du_plane_state *old_plane_state, *new_plane_state;struct rcar_du_plane *plane;unsigned int index; plane =to_rcar_plane (drm_plane); - plane_state =to_rcar_plane_state (drm_plane_state); + old_plane_state =to_rcar_plane_state (old_drm_plane_state); + new_plane_state =to_rcar_plane_state (new_drm_plane_state);dev_dbg (rcdu->dev,"%s: checking plane (%u,%tu)\n" , __func__, plane->group->index, plane - plane->group->planes);@@ -159,19 +157,19 @@ int rcar_du_atomic_check_planes(struct drm_device *dev,* the full reallocation procedure. Just mark the hardware * plane(s) as freed. */ -if (!plane_state->format) { +if (!new_plane_state->format) {dev_dbg (rcdu->dev,"%s: plane is being disabled\n" , __func__); index = plane - plane->group->planes; group_freed_planes[plane->group->index] |=1 << index; - plane_state->hwindex =-1 ; + new_plane_state->hwindex =-1 ;continue ; }/* If the plane needs to be reallocated mark it as such, and * mark the hardware plane(s) as free. */ -if (rcar_du_plane_needs_realloc (plane, plane_state)) { +if (rcar_du_plane_needs_realloc (plane, old_plane_state, new_plane_state)) {dev_dbg (rcdu->dev,"%s: plane needs reallocation\n" , __func__); groups |=1 << plane->group->index;@@ -179,7 +177,7 @@ int rcar_du_atomic_check_planes(struct drm_device *dev, index = plane - plane->group->planes; group_freed_planes[plane->group->index] |=1 << index; - plane_state->hwindex =-1 ; + new_plane_state->hwindex =-1 ; } }@@ -226,16 +224,16 @@ int rcar_du_atomic_check_planes(struct drm_device *dev,continue ; } - plane_state =to_rcar_plane_state (plane->plane.state); + new_plane_state =to_rcar_plane_state (plane->plane.state); used_planes |=rcar_du_plane_hwmask (plane_state);dev_dbg (rcdu->dev,"%s: plane (%u,%tu) uses %u hwplanes (index %d)\n" , __func__, plane->group->index, plane - plane->group->planes, - plane_state->format ? - plane_state->format->planes :0 , - plane_state->hwindex); + new_plane_state->format ? + new_plane_state->format->planes :0 , + new_plane_state->hwindex); } group_free_planes[index] =0xff & ~used_planes;@@ -246,15 +244,16 @@ int rcar_du_atomic_check_planes(struct drm_device *dev, }/* Reallocate hardware planes for each plane that needs it. */ -for_each_plane_in_state (state, drm_plane, drm_plane_state, i) { -struct rcar_du_plane_state *plane_state; +for_each_oldnew_plane_in_state (state, drm_plane, old_drm_plane_state, new_drm_plane_state, i) { +struct rcar_du_plane_state *old_plane_state, *new_plane_state;struct rcar_du_plane *plane;unsigned int crtc_planes;unsigned int free;int idx; plane =to_rcar_plane (drm_plane); - plane_state =to_rcar_plane_state (drm_plane_state); + old_plane_state =to_rcar_plane_state (old_drm_plane_state); + new_plane_state =to_rcar_plane_state (new_drm_plane_state);
Quoted 8 lines
drivers/gpu/drm/rcar-du/rcar_du_plane.c int rcar_du_atomic_check_planes(struct drm_device *dev, · line 264
Quoted 6 lines
drivers/gpu/drm/rcar-du/rcar_du_plane.c +0
-0dev_dbg (rcdu->dev,"%s: allocating plane (%u,%tu)\n" , __func__, plane->group->index, plane - plane->group->planes);@@ -263,7 +262,7 @@ int rcar_du_atomic_check_planes(struct drm_device *dev,* reallocated. */ if (!plane_state->format ||I think you missed a few cases of replacing
plane_statehere. Does this compile?
I fear not..
Have a working patch below. :)
----8<------for_each_obj_in_state is about to be removed, so use the correct new iterator macros.
Also look at new_plane_state instead of plane->state when looking up the hw planes in use. They should be the same except when reallocating, (in which case this code is skipped) and we should really stop looking at obj->state whenever possible.
Changes since v1:
- Actually compile correctly.
--- drivers/gpu/drm/rcar-du/rcar_du_plane.c | 57 ++++++++++++++++----------------- 1 file changed, 28 insertions(+), 29 deletions(-)
drivers/gpu/drm/rcar-du/rcar_du_plane.c +28 -29
@@ -51,12 +51,9 @@*/ static bool rcar_du_plane_needs_realloc (struct rcar_du_plane *plane, +const struct rcar_du_plane_state *cur_state,struct rcar_du_plane_state *new_state) { -struct rcar_du_plane_state *cur_state; - - cur_state =to_rcar_plane_state (plane->plane.state); -/* Lowering the number of planes doesn't strictly require reallocation * as the extra hardware plane will be freed when committing, but doing * so could lead to more fragmentation.
@@ -141,16 +138,17 @@ int rcar_du_atomic_check_planes(struct drm_device *dev,unsigned int groups =0 ;unsigned int i;struct drm_plane *drm_plane; -struct drm_plane_state *drm_plane_state; +struct drm_plane_state *old_drm_plane_state, *new_drm_plane_state;/* Check if hardware planes need to be reallocated. */ -for_each_plane_in_state (state, drm_plane, drm_plane_state, i) { -struct rcar_du_plane_state *plane_state; +for_each_oldnew_plane_in_state (state, drm_plane, old_drm_plane_state, new_drm_plane_state, i) { +struct rcar_du_plane_state *old_plane_state, *new_plane_state;struct rcar_du_plane *plane;unsigned int index; plane =to_rcar_plane (drm_plane); - plane_state =to_rcar_plane_state (drm_plane_state); + old_plane_state =to_rcar_plane_state (old_drm_plane_state); + new_plane_state =to_rcar_plane_state (new_drm_plane_state);dev_dbg (rcdu->dev,"%s: checking plane (%u,%tu)\n" , __func__, plane->group->index, plane - plane->group->planes);
@@ -159,19 +157,19 @@ int rcar_du_atomic_check_planes(struct drm_device *dev,* the full reallocation procedure. Just mark the hardware * plane(s) as freed. */ -if (!plane_state->format) { +if (!new_plane_state->format) {dev_dbg (rcdu->dev,"%s: plane is being disabled\n" , __func__); index = plane - plane->group->planes; group_freed_planes[plane->group->index] |=1 << index; - plane_state->hwindex =-1 ; + new_plane_state->hwindex =-1 ;continue ; }/* If the plane needs to be reallocated mark it as such, and * mark the hardware plane(s) as free. */ -if (rcar_du_plane_needs_realloc (plane, plane_state)) { +if (rcar_du_plane_needs_realloc (plane, old_plane_state, new_plane_state)) {dev_dbg (rcdu->dev,"%s: plane needs reallocation\n" , __func__); groups |=1 << plane->group->index;
@@ -179,7 +177,7 @@ int rcar_du_atomic_check_planes(struct drm_device *dev, index = plane - plane->group->planes; group_freed_planes[plane->group->index] |=1 << index; - plane_state->hwindex =-1 ; + new_plane_state->hwindex =-1 ; } }
@@ -204,7 +202,7 @@ int rcar_du_atomic_check_planes(struct drm_device *dev,for (i =0 ; i < group->num_planes; ++i) {struct rcar_du_plane *plane = &group->planes[i]; -struct rcar_du_plane_state *plane_state; +struct rcar_du_plane_state *new_plane_state;struct drm_plane_state *s; s =drm_atomic_get_plane_state (state, &plane->plane);
@@ -226,16 +224,16 @@ int rcar_du_atomic_check_planes(struct drm_device *dev,continue ; } - plane_state =to_rcar_plane_state (plane->plane.state); - used_planes |=rcar_du_plane_hwmask (plane_state); + new_plane_state =to_rcar_plane_state (s); + used_planes |=rcar_du_plane_hwmask (new_plane_state);dev_dbg (rcdu->dev,"%s: plane (%u,%tu) uses %u hwplanes (index %d)\n" , __func__, plane->group->index, plane - plane->group->planes, - plane_state->format ? - plane_state->format->planes :0 , - plane_state->hwindex); + new_plane_state->format ? + new_plane_state->format->planes :0 , + new_plane_state->hwindex); } group_free_planes[index] =0xff & ~used_planes;
@@ -246,15 +244,16 @@ int rcar_du_atomic_check_planes(struct drm_device *dev, }/* Reallocate hardware planes for each plane that needs it. */ -for_each_plane_in_state (state, drm_plane, drm_plane_state, i) { -struct rcar_du_plane_state *plane_state; +for_each_oldnew_plane_in_state (state, drm_plane, old_drm_plane_state, new_drm_plane_state, i) { +struct rcar_du_plane_state *old_plane_state, *new_plane_state;struct rcar_du_plane *plane;unsigned int crtc_planes;unsigned int free;int idx; plane =to_rcar_plane (drm_plane); - plane_state =to_rcar_plane_state (drm_plane_state); + old_plane_state =to_rcar_plane_state (old_drm_plane_state); + new_plane_state =to_rcar_plane_state (new_drm_plane_state);dev_dbg (rcdu->dev,"%s: allocating plane (%u,%tu)\n" , __func__, plane->group->index, plane - plane->group->planes);
@@ -262,8 +261,8 @@ int rcar_du_atomic_check_planes(struct drm_device *dev,/* Skip planes that are being disabled or don't need to be * reallocated. */ -if (!plane_state->format || - !rcar_du_plane_needs_realloc (plane, plane_state)) +if (!new_plane_state->format || + !rcar_du_plane_needs_realloc (plane, old_plane_state, new_plane_state))continue ;/* Try to allocate the plane from the free planes currently
@@ -271,15 +270,15 @@ int rcar_du_atomic_check_planes(struct drm_device *dev,* group and thus minimize flicker. If it fails fall back to * allocating from all free planes. */ - crtc_planes =to_rcar_crtc (plane_state->state.crtc)->index %2 + crtc_planes =to_rcar_crtc (new_plane_state->state.crtc)->index %2 ? plane->group->dptsr_planes : ~plane->group->dptsr_planes; free = group_free_planes[plane->group->index]; - idx =rcar_du_plane_hwalloc (plane, plane_state, + idx =rcar_du_plane_hwalloc (plane, new_plane_state, free & crtc_planes);if (idx <0 ) - idx =rcar_du_plane_hwalloc (plane, plane_state, + idx =rcar_du_plane_hwalloc (plane, new_plane_state, free);if (idx <0 ) { dev_dbg(rcdu->dev, "%s: no available hardware plane\n",
@@ -288,12 +287,12 @@ int rcar_du_atomic_check_planes(struct drm_device *dev, }dev_dbg (rcdu->dev,"%s: allocated %u hwplanes (index %u)\n" , - __func__, plane_state->format->planes, idx); + __func__, new_plane_state->format->planes, idx); - plane_state->hwindex = idx; + new_plane_state->hwindex = idx; group_free_planes[plane->group->index] &= - ~rcar_du_plane_hwmask (plane_state); + ~rcar_du_plane_hwmask (new_plane_state); dev_dbg(rcdu->dev, "%s: group %u free planes mask 0x%02x\n", __func__, plane->group->index,
Signature · 7 lines
2.11.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Maarten Lankhorst
maintainerPATCH 8/16 drm/atmel-hlcdec: Use for_each_new_connector_in_state
In reply to Maarten Lankhorstfor_each_obj_in_state is about to be removed, so use the new iterator macros.
--- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c +1 -1
@@ -237,7 +237,7 @@ static int atmel_hlcdc_crtc_select_output_mode(struct drm_crtc_state *state) crtc =drm_crtc_to_atmel_hlcdc_crtc (state->crtc); -for_each_connector_in_state (state->state, connector, cstate, i) { +for_each_new_connector_in_state (state->state, connector, cstate, i) {struct drm_display_info *info = &connector->display_info;unsigned int supported_fmts =0 ;int j;
Signature · 6 lines
2.11.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 08/16] drm/atmel-hlcdec: Use for_each_new_connector_in_state
Quoted 14 lines · Maarten Lankhorst
for_each_obj_in_stateis about to be removed, so use the new iterator macros.Signed-off-by Maarten Lankhorst <[email protected]>Cc Boris Brezillon <[email protected]>--- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c +0
-0
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c static int atmel_hlcdc_crtc_select_output_mode(struct drm_crtc_state *state) · line 240
Quoted 5 lines
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c +1
-1@@ -237,7 +237,7 @@ static int atmel_hlcdc_crtc_select_output_mode(struct drm_crtc_state *state) crtc =drm_crtc_to_atmel_hlcdc_crtc (state->crtc); -for_each_connector_in_state (state->state, connector, cstate, i) { +for_each_new_connector_in_state (state->state, connector, cstate, i) {
The code herein looks like the perfect thing to stuff into encoder->atomic_check, since that can fill out the crtc state too. But this works too.
Patch itself looks good.
Quoted 10 lines
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c +0
-0struct drm_display_info *info = &connector->display_info;unsigned int supported_fmts =0 ;int j;Signature · 6 lines
2.11.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 08/16] drm/atmel-hlcdec: Use for_each_new_connector_in_state
In reply to Maarten LankhorstQuoted 5 lines · On Wed, 12 Jul 2017 10:13:36 +0200 Maarten Lankhorst…
for_each_obj_in_stateis about to be removed, so use the new iterator macros.Signed-off-by Maarten Lankhorst <[email protected]>Cc Boris Brezillon <[email protected]>
Quoted 9 lines
--- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c +0
-0
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c static int atmel_hlcdc_crtc_select_output_mode(struct drm_crtc_state *state) · line 243
Quoted 8 lines
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c +1
-1@@ -237,7 +237,7 @@ static int atmel_hlcdc_crtc_select_output_mode(struct drm_crtc_state *state) crtc =drm_crtc_to_atmel_hlcdc_crtc (state->crtc); -for_each_connector_in_state (state->state, connector, cstate, i) { +for_each_new_connector_in_state (state->state, connector, cstate, i) {struct drm_display_info *info = &connector->display_info;unsigned int supported_fmts =0 ;int j;
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Maarten Lankhorst
maintainerPATCH 9/16 drm/rockchip: Use for_each_oldnew_plane_in_state in vop_crtc_atomic_flush
In reply to Maarten Lankhorstfor_each_obj_in_state is about to be removed, so use the new atomic iterator macros.
--- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +4 -3
@@ -1029,7 +1029,7 @@ static void vop_crtc_atomic_flush(struct drm_crtc *crtc, struct drm_crtc_state *old_crtc_state) {struct drm_atomic_state *old_state = old_crtc_state->state; -struct drm_plane_state *old_plane_state; +struct drm_plane_state *old_plane_state, *new_plane_state;struct vop *vop =to_vop (crtc);struct drm_plane *plane;int i;
@@ -1060,11 +1060,12 @@ static void vop_crtc_atomic_flush(struct drm_crtc *crtc, }spin_unlock_irq (&crtc->dev->event_lock); -for_each_plane_in_state (old_state, plane, old_plane_state, i) { +for_each_oldnew_plane_in_state (old_state, plane, old_plane_state, + new_plane_state, i) {if (!old_plane_state->fb)continue ; -if (old_plane_state->fb == plane->state->fb) +if (old_plane_state->fb == new_plane_state->fb)continue ;drm_framebuffer_reference (old_plane_state->fb);
Signature · 1 line
2.11.0
Re: [PATCH 09/16] drm/rockchip: Use for_each_oldnew_plane_in_state in vop_crtc_atomic_flush
Quoted 28 lines · Maarten Lankhorst
for_each_obj_in_stateis about to be removed, so use the new atomic iterator macros.Signed-off-by Maarten Lankhorst <[email protected]>Cc Mark Yao <[email protected]>Cc Heiko Stuebner <[email protected]>--- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)drivers/gpu/drm/rockchip/rockchip_drm_vop.c +1
-1@@ -1029,7 +1029,7 @@ static void vop_crtc_atomic_flush(struct drm_crtc *crtc, struct drm_crtc_state *old_crtc_state) {struct drm_atomic_state *old_state = old_crtc_state->state; -struct drm_plane_state *old_plane_state; +struct drm_plane_state *old_plane_state, *new_plane_state;struct vop *vop =to_vop (crtc);struct drm_plane *plane;int i;@@ -1060,11 +1060,12 @@ static void vop_crtc_atomic_flush(struct drm_crtc *crtc, }spin_unlock_irq (&crtc->dev->event_lock);
drivers/gpu/drm/rockchip/rockchip_drm_vop.c static void vop_crtc_atomic_flush(struct drm_crtc *crtc, · line 1069
Quoted 10 lines
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +3
-2-for_each_plane_in_state (old_state, plane, old_plane_state, i) { +for_each_oldnew_plane_in_state (old_state, plane, old_plane_state, + new_plane_state, i) {if (!old_plane_state->fb)continue ; -if (old_plane_state->fb == plane->state->fb) +if (old_plane_state->fb == new_plane_state->fb)continue ;
This entire machinery here seems to be the perfect candidate for Boris' wait_for_flip_done work.
Patch itself looks good.
Quoted 9 lines
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +0
-0drm_framebuffer_reference (old_plane_state->fb);Signature · 6 lines
2.11.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 09/16] drm/rockchip: Use for_each_oldnew_plane_in_state in vop_crtc_atomic_flush
In reply to Maarten LankhorstQuoted 8 lines · Maarten Lankhorst
for_each_obj_in_stateis about to be removed, so use the new atomic iterator macros.Signed-off-by Maarten Lankhorst<[email protected]>Cc Mark Yao<[email protected]>Cc Heiko Stuebner<[email protected]>
Looks good for me:
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Maarten Lankhorst
maintainerPATCH 10/16 drm/omapdrm: Fix omap_atomic_wait_for_completion
In reply to Maarten LankhorstUse the new iterator macro and look for crtc_state->active instead of enable, only crtc_state->enable implies that vblanks will happen.
--- drivers/gpu/drm/omapdrm/omap_drv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/omapdrm/omap_drv.c +3 -3
@@ -57,13 +57,13 @@ static void omap_fb_output_poll_changed(struct drm_device *dev)static void omap_atomic_wait_for_completion (struct drm_device *dev,struct drm_atomic_state *old_state) { -struct drm_crtc_state *old_crtc_state; +struct drm_crtc_state *new_crtc_state;struct drm_crtc *crtc;unsigned int i;int ret; -for_each_crtc_in_state (old_state, crtc, old_crtc_state, i) { -if (!crtc->state->enable) +for_each_new_crtc_in_state (old_state, crtc, new_crtc_state, i) { +if (!new_crtc_state->active)continue ; ret =omap_crtc_wait_pending (crtc);
Signature · 6 lines
2.11.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 10/16] drm/omapdrm: Fix omap_atomic_wait_for_completion
Quoted 5 lines · Maarten Lankhorst
Use the new iterator macro and look for
crtc_state->activeinstead of enable, onlycrtc_state->enableimplies that vblanks will happen.Signed-off-by Maarten Lankhorst <[email protected]>Cc Tomi Valkeinen <[email protected]>
Quoted 32 lines
--- drivers/gpu/drm/omapdrm/omap_drv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/gpu/drm/omapdrm/omap_drv.c +3
-3@@ -57,13 +57,13 @@ static void omap_fb_output_poll_changed(struct drm_device *dev)static void omap_atomic_wait_for_completion (struct drm_device *dev,struct drm_atomic_state *old_state) { -struct drm_crtc_state *old_crtc_state; +struct drm_crtc_state *new_crtc_state;struct drm_crtc *crtc;unsigned int i;int ret; -for_each_crtc_in_state (old_state, crtc, old_crtc_state, i) { -if (!crtc->state->enable) +for_each_new_crtc_in_state (old_state, crtc, new_crtc_state, i) { +if (!new_crtc_state->active)continue ; ret =omap_crtc_wait_pending (crtc);Signature · 6 lines
2.11.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Maarten Lankhorst
maintainerPATCH 11/16 drm/mali: Use new atomic iterator macros
In reply to Maarten Lankhorstfor_each_obj_in_state is about to be removed, so use the new iterator macros.
--- drivers/gpu/drm/arm/malidp_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/arm/malidp_drv.c +1 -1
@@ -225,7 +225,7 @@ static void malidp_atomic_commit_tail(struct drm_atomic_state *state)drm_atomic_helper_commit_modeset_disables (drm, state); -for_each_crtc_in_state (state, crtc, old_crtc_state, i) { +for_each_old_crtc_in_state (state, crtc, old_crtc_state, i) {malidp_atomic_commit_update_gamma (crtc, old_crtc_state);malidp_atomic_commit_update_coloradj (crtc, old_crtc_state);malidp_atomic_commit_se_config (crtc, old_crtc_state);
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH 11/16] drm/mali: Use new atomic iterator macros
Quoted 7 lines · Maarten Lankhorst
for_each_obj_in_stateis about to be removed, so use the new iterator macros.Signed-off-by Maarten Lankhorst <[email protected]>Cc Liviu Dudau <[email protected]>Cc Brian Starkey <[email protected]>Cc Mali DP Maintainers <[email protected]>
Quoted 24 lines
--- drivers/gpu/drm/arm/malidp_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/arm/malidp_drv.c +1
-1@@ -225,7 +225,7 @@ static void malidp_atomic_commit_tail(struct drm_atomic_state *state)drm_atomic_helper_commit_modeset_disables (drm, state); -for_each_crtc_in_state (state, crtc, old_crtc_state, i) { +for_each_old_crtc_in_state (state, crtc, old_crtc_state, i) {malidp_atomic_commit_update_gamma (crtc, old_crtc_state);malidp_atomic_commit_update_coloradj (crtc, old_crtc_state);malidp_atomic_commit_se_config (crtc, old_crtc_state);Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 11/16] drm/mali: Use new atomic iterator macros
In reply to Maarten LankhorstQuoted 7 lines · Maarten Lankhorst
for_each_obj_in_stateis about to be removed, so use the new iterator macros.Signed-off-by Maarten Lankhorst <[email protected]>Cc Liviu Dudau <[email protected]>Cc Brian Starkey <[email protected]>Cc Mali DP Maintainers <[email protected]>
Hi Maarten,
Are you going to take the whole series through drm-misc or you want me to pull this patch into mali-dp tree?
Best regards,
Liviu
Quoted 20 lines
--- drivers/gpu/drm/arm/malidp_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/arm/malidp_drv.c +1
-1@@ -225,7 +225,7 @@ static void malidp_atomic_commit_tail(struct drm_atomic_state *state)drm_atomic_helper_commit_modeset_disables (drm, state); -for_each_crtc_in_state (state, crtc, old_crtc_state, i) { +for_each_old_crtc_in_state (state, crtc, old_crtc_state, i) {malidp_atomic_commit_update_gamma (crtc, old_crtc_state);malidp_atomic_commit_update_coloradj (crtc, old_crtc_state);malidp_atomic_commit_se_config (crtc, old_crtc_state);Signature · 1 line
2.11.0
Signature · 12 lines
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-develMaarten Lankhorst
maintainerRe: [PATCH 11/16] drm/mali: Use new atomic iterator macros
Op 12-07-17 om 11:44 schreef Liviu Dudau:
Quoted 8 lines · Maarten Lankhorst
Quoted 7 lines
for_each_obj_in_stateis about to be removed, so use the new iterator macros.Signed-off-by Maarten Lankhorst <[email protected]>Cc Liviu Dudau <[email protected]>Cc Brian Starkey <[email protected]>Cc Mali DP Maintainers <[email protected]>
Quoted 6 lines
Hi Maarten,
Acked-by Liviu Dudau <[email protected]>Are you going to take the whole series through drm-misc or you want me to pull this patch into mali-dp tree?
I'm planning to put it all through drm-misc if possible, so I can immediately remove the old macros so they will never be used again. :)
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Liviu Dudau
maintainerRe: [PATCH 11/16] drm/mali: Use new atomic iterator macros
Quoted 11 lines · Maarten Lankhorst
Op 12-07-17 om 11:44 schreef Liviu Dudau:
Quoted 10 lines · Maarten Lankhorst
Quoted 7 lines
for_each_obj_in_stateis about to be removed, so use the new iterator macros.Signed-off-by Maarten Lankhorst <[email protected]>Cc Liviu Dudau <[email protected]>Cc Brian Starkey <[email protected]>Cc Mali DP Maintainers <[email protected]>Hi Maarten,
Quoted 7 lines
Quoted 4 lines
Acked-by Liviu Dudau <[email protected]>Are you going to take the whole series through drm-misc or you want me to pull this patch into mali-dp tree?
I'm planning to put it all through drm-misc if possible, so I can immediately remove the old macros so they will never be used again. :)
Fine by me. Thanks for the patch!
Best regards,
Liviu
Quoted 5 lines
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 12 lines
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfxMaarten Lankhorst
maintainerPATCH 12/16 drm/imx: Use atomic iterator macros
In reply to Maarten Lankhorstfor_each_obj_in_state is about to be removed, so use the new atomic iterator macros.
--- drivers/gpu/drm/imx/imx-drm-core.c | 8 ++++---- drivers/gpu/drm/imx/ipuv3-plane.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/imx/imx-drm-core.c +4 -4
@@ -115,7 +115,7 @@ static void imx_drm_atomic_commit_tail(struct drm_atomic_state *state) {struct drm_device *dev = state->dev;struct drm_plane *plane; -struct drm_plane_state *old_plane_state; +struct drm_plane_state *old_plane_state, *new_plane_state;bool plane_disabling = false;int i;
@@ -127,15 +127,15 @@ static void imx_drm_atomic_commit_tail(struct drm_atomic_state *state)drm_atomic_helper_commit_modeset_enables (dev, state); -for_each_plane_in_state (state, plane, old_plane_state, i) { -if (drm_atomic_plane_disabling (old_plane_state, plane->state)) +for_each_oldnew_plane_in_state (state, plane, old_plane_state, new_plane_state, i) { +if (drm_atomic_plane_disabling (old_plane_state, new_plane_state)) plane_disabling = true; }if (plane_disabling) {drm_atomic_helper_wait_for_vblanks (dev, state); -for_each_plane_in_state (state, plane, old_plane_state, i) +for_each_old_plane_in_state (state, plane, old_plane_state, i)ipu_plane_disable_deferred (plane); }
drivers/gpu/drm/imx/ipuv3-plane.c +1 -1
@@ -675,7 +675,7 @@ int ipu_planes_assign_pre(struct drm_device *dev,int available_pres =ipu_prg_max_active_channels ();int i; -for_each_plane_in_state (state, plane, plane_state, i) { +for_each_new_plane_in_state (state, plane, plane_state, i) {struct ipu_plane_state *ipu_state =to_ipu_plane_state (plane_state);struct ipu_plane *ipu_plane =to_ipu_plane (plane);
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 12/16] drm/imx: Use atomic iterator macros
Quoted 5 lines · Maarten Lankhorst
for_each_obj_in_stateis about to be removed, so use the new atomic iterator macros.Signed-off-by Maarten Lankhorst <[email protected]>Cc Philipp Zabel <[email protected]>
Quoted 57 lines
--- drivers/gpu/drm/imx/imx-drm-core.c | 8 ++++---- drivers/gpu/drm/imx/ipuv3-plane.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)drivers/gpu/drm/imx/imx-drm-core.c +4
-4@@ -115,7 +115,7 @@ static void imx_drm_atomic_commit_tail(struct drm_atomic_state *state) {struct drm_device *dev = state->dev;struct drm_plane *plane; -struct drm_plane_state *old_plane_state; +struct drm_plane_state *old_plane_state, *new_plane_state;bool plane_disabling = false;int i;@@ -127,15 +127,15 @@ static void imx_drm_atomic_commit_tail(struct drm_atomic_state *state)drm_atomic_helper_commit_modeset_enables (dev, state); -for_each_plane_in_state (state, plane, old_plane_state, i) { -if (drm_atomic_plane_disabling (old_plane_state, plane->state)) +for_each_oldnew_plane_in_state (state, plane, old_plane_state, new_plane_state, i) { +if (drm_atomic_plane_disabling (old_plane_state, new_plane_state)) plane_disabling = true; }if (plane_disabling) {drm_atomic_helper_wait_for_vblanks (dev, state); -for_each_plane_in_state (state, plane, old_plane_state, i) +for_each_old_plane_in_state (state, plane, old_plane_state, i)ipu_plane_disable_deferred (plane); }drivers/gpu/drm/imx/ipuv3-plane.c +1
-1@@ -675,7 +675,7 @@ int ipu_planes_assign_pre(struct drm_device *dev,int available_pres =ipu_prg_max_active_channels ();int i; -for_each_plane_in_state (state, plane, plane_state, i) { +for_each_new_plane_in_state (state, plane, plane_state, i) {struct ipu_plane_state *ipu_state =to_ipu_plane_state (plane_state);struct ipu_plane *ipu_plane =to_ipu_plane (plane);Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 12/16] drm/imx: Use atomic iterator macros
In reply to Maarten LankhorstQuoted 47 lines · Maarten Lankhorst
for_each_obj_in_stateis about to be removed, so use the new atomic iterator macros.Signed-off-by Maarten Lankhorst <[email protected]>Cc Philipp Zabel <[email protected]>--- drivers/gpu/drm/imx/imx-drm-core.c | 8 ++++---- drivers/gpu/drm/imx/ipuv3-plane.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)drivers/gpu/drm/imx/imx-drm-core.c +4
-4@@ -115,7 +115,7 @@ static void imx_drm_atomic_commit_tail(struct drm_atomic_state *state) {struct drm_device *dev = state->dev;struct drm_plane *plane; -struct drm_plane_state *old_plane_state; +struct drm_plane_state *old_plane_state, *new_plane_state;bool plane_disabling = false;int i;@@ -127,15 +127,15 @@ static void imx_drm_atomic_commit_tail(struct drm_atomic_state *state)drm_atomic_helper_commit_modeset_enables (dev, state); -for_each_plane_in_state (state, plane, old_plane_state, i) { -if (drm_atomic_plane_disabling (old_plane_state, plane->state)) +for_each_oldnew_plane_in_state (state, plane, old_plane_state, new_plane_state, i) { +if (drm_atomic_plane_disabling (old_plane_state, new_plane_state)) plane_disabling = true; }if (plane_disabling) {drm_atomic_helper_wait_for_vblanks (dev, state); -for_each_plane_in_state (state, plane, old_plane_state, i) +for_each_old_plane_in_state (state, plane, old_plane_state, i)ipu_plane_disable_deferred (plane); }drivers/gpu/drm/imx/ipuv3-plane.c +0
-0
drivers/gpu/drm/imx/ipuv3-plane.c int ipu_planes_assign_pre(struct drm_device *dev, · line 681
Quoted 8 lines
drivers/gpu/drm/imx/ipuv3-plane.c +1
-1@@ -675,7 +675,7 @@ int ipu_planes_assign_pre(struct drm_device *dev,int available_pres =ipu_prg_max_active_channels ();int i; -for_each_plane_in_state (state, plane, plane_state, i) { +for_each_new_plane_in_state (state, plane, plane_state, i) {struct ipu_plane_state *ipu_state =to_ipu_plane_state (plane_state);struct ipu_plane *ipu_plane =to_ipu_plane (plane);
regards
Philipp
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Maarten Lankhorst
maintainerPATCH 13/16 drm/mediatek: Convert to new iterator macros
In reply to Maarten Lankhorstfor_each_obj_in_state is about to be removed, so use the new atomic iterator macros.
--- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/mediatek/mtk_drm_drv.c +3 -3
@@ -48,11 +48,11 @@ static void mtk_atomic_schedule(struct mtk_drm_private *private,static void mtk_atomic_wait_for_fences (struct drm_atomic_state *state) {struct drm_plane *plane; -struct drm_plane_state *plane_state; +struct drm_plane_state *new_plane_state;int i; -for_each_plane_in_state (state, plane, plane_state, i) -mtk_fb_wait (plane->state->fb); +for_each_new_plane_in_state (state, plane, new_plane_state, i) +mtk_fb_wait (new_plane_state->fb); } static void mtk_atomic_complete(struct mtk_drm_private *private,
Signature · 6 lines
2.11.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 13/16] drm/mediatek: Convert to new iterator macros
Quoted 20 lines · Maarten Lankhorst
for_each_obj_in_stateis about to be removed, so use the new atomic iterator macros.Signed-off-by Maarten Lankhorst <[email protected]>Cc CK Hu <[email protected]>Cc Philipp Zabel <[email protected]>Cc Matthias Brugger <[email protected]>--- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/gpu/drm/mediatek/mtk_drm_drv.c +0
-0@@ -48,11 +48,11 @@ static void mtk_atomic_schedule(struct mtk_drm_private *private,static void mtk_atomic_wait_for_fences (struct drm_atomic_state *state) {
drivers/gpu/drm/mediatek/mtk_drm_drv.c static void mtk_atomic_schedule(struct mtk_drm_private *private, · line 56
Quoted 10 lines
drivers/gpu/drm/mediatek/mtk_drm_drv.c +3
-3struct drm_plane *plane; -struct drm_plane_state *plane_state; +struct drm_plane_state *new_plane_state;int i; -for_each_plane_in_state (state, plane, plane_state, i) -mtk_fb_wait (plane->state->fb); +for_each_new_plane_in_state (state, plane, new_plane_state, i) +mtk_fb_wait (new_plane_state->fb); }
I think a variant of drm_atomic_set_fence_for_plane, which takes a reservation obj (or a dma-buf and then derefs dma_buf->resv itself) would be nice, so that drivers don't have to hand-roll sub-par fence waiting code like this (it's e.g. not interruptible for blocking commits).
Anyway, patch itself looks good.
Quoted 9 lines
drivers/gpu/drm/mediatek/mtk_drm_drv.c +0
-0static void mtk_atomic_complete(struct mtk_drm_private *private,Signature · 6 lines
2.11.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Maarten Lankhorst
maintainerRe: [PATCH 13/16] drm/mediatek: Convert to new iterator macros
Op 12-07-17 om 11:45 schreef Daniel Vetter:
Quoted 36 lines · Maarten Lankhorst
Quoted 20 lines
for_each_obj_in_stateis about to be removed, so use the new atomic iterator macros.Signed-off-by Maarten Lankhorst <[email protected]>Cc CK Hu <[email protected]>Cc Philipp Zabel <[email protected]>Cc Matthias Brugger <[email protected]>--- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/gpu/drm/mediatek/mtk_drm_drv.c +0
-0@@ -48,11 +48,11 @@ static void mtk_atomic_schedule(struct mtk_drm_private *private,static void mtk_atomic_wait_for_fences (struct drm_atomic_state *state) {drivers/gpu/drm/mediatek/mtk_drm_drv.c static void mtk_atomic_schedule(struct mtk_drm_private *private, · line 56
Quoted 10 lines
drivers/gpu/drm/mediatek/mtk_drm_drv.c +3
-3struct drm_plane *plane; -struct drm_plane_state *plane_state; +struct drm_plane_state *new_plane_state;int i; -for_each_plane_in_state (state, plane, plane_state, i) -mtk_fb_wait (plane->state->fb); +for_each_new_plane_in_state (state, plane, new_plane_state, i) +mtk_fb_wait (new_plane_state->fb); }I think a variant of
drm_atomic_set_fence_for_plane, which takes a reservation obj (or a dma-buf and then derefsdma_buf->resvitself) would be nice, so that drivers don't have to hand-roll sub-par fence waiting code like this (it's e.g. not interruptible for blocking commits).
Quoted 4 lines
Anyway, patch itself looks good.
Reviewed-by Daniel Vetter <[email protected]>
Thanks.
Pushed patch 1-3, 4 (first hunk only), 5 (with static fix), 6, 8, 9, 11-13.
Still hoping for ack from driver maintainers on patch 7 (v2), 10, 14 (v2) and 15 (with the fix daniel spotted).
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 13/16] drm/mediatek: Convert to new iterator macros
In reply to Maarten LankhorstQuoted 22 lines · Maarten Lankhorst
for_each_obj_in_stateis about to be removed, so use the new atomic iterator macros.Signed-off-by Maarten Lankhorst <[email protected]>Cc CK Hu <[email protected]>Cc Philipp Zabel <[email protected]>Cc Matthias Brugger <[email protected]>--- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/gpu/drm/mediatek/mtk_drm_drv.c +0
-1@@ -48,11 +48,11 @@ static void mtk_atomic_schedule(struct mtk_drm_private *private,static void mtk_atomic_wait_for_fences (struct drm_atomic_state *state) {struct drm_plane *plane; -struct drm_plane_state *plane_state;
drivers/gpu/drm/mediatek/mtk_drm_drv.c static void mtk_atomic_schedule(struct mtk_drm_private *private, · line 58
Quoted 10 lines
drivers/gpu/drm/mediatek/mtk_drm_drv.c +3
-2+struct drm_plane_state *new_plane_state;int i; -for_each_plane_in_state (state, plane, plane_state, i) -mtk_fb_wait (plane->state->fb); +for_each_new_plane_in_state (state, plane, new_plane_state, i) +mtk_fb_wait (new_plane_state->fb); } static void mtk_atomic_complete(struct mtk_drm_private *private,
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
A message that is not in the archive (sent off-list or not yet received): 20170712081344.25495-1-maarten.lankhorst-VuQAYsv1563Yd54FQh9/[email protected]
PATCH 14/16 drm/msm: Convert to use new iterator macros
for_each_obj_in_state is about to be removed, so convert to the new iterator macros.
Just like in omap, use crtc_state->active instead of crtc_state->enable when waiting for completion.
--- drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c | 4 ++-- drivers/gpu/drm/msm/msm_atomic.c | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-)
drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c +2 -2
@@ -114,7 +114,7 @@ static void mdp4_prepare_commit(struct msm_kms *kms, struct drm_atomic_state *stmdp4_enable (mdp4_kms);/* see 119ecb7fd */ -for_each_crtc_in_state (state, crtc, crtc_state, i) +for_each_new_crtc_in_state (state, crtc, crtc_state, i)drm_crtc_vblank_get (crtc); }
@@ -126,7 +126,7 @@ static void mdp4_complete_commit(struct msm_kms *kms, struct drm_atomic_state *sstruct drm_crtc_state *crtc_state;/* see 119ecb7fd */ -for_each_crtc_in_state (state, crtc, crtc_state, i) +for_each_new_crtc_in_state (state, crtc, crtc_state, i)drm_crtc_vblank_put (crtc);mdp4_disable (mdp4_kms);
drivers/gpu/drm/msm/msm_atomic.c +8 -8
@@ -84,13 +84,13 @@ static void msm_atomic_wait_for_commit_done(struct drm_device *dev, struct drm_atomic_state *old_state) {struct drm_crtc *crtc; -struct drm_crtc_state *crtc_state; +struct drm_crtc_state *new_crtc_state;struct msm_drm_private *priv = old_state->dev->dev_private;struct msm_kms *kms = priv->kms;int i; -for_each_crtc_in_state (old_state, crtc, crtc_state, i) { -if (!crtc->state->enable) +for_each_new_crtc_in_state (old_state, crtc, new_crtc_state, i) { +if (!new_crtc_state->active)continue ; kms->funcs->wait_for_crtc_commit_done (kms, crtc);
@@ -195,7 +195,7 @@ int msm_atomic_commit(struct drm_device *dev,struct drm_crtc *crtc;struct drm_crtc_state *crtc_state;struct drm_plane *plane; -struct drm_plane_state *plane_state; +struct drm_plane_state *old_plane_state, *new_plane_state;int i, ret; ret =drm_atomic_helper_prepare_planes (dev, state);
@@ -211,15 +211,15 @@ int msm_atomic_commit(struct drm_device *dev,/* * Figure out what crtcs we have: */ -for_each_crtc_in_state (state, crtc, crtc_state, i) +for_each_new_crtc_in_state (state, crtc, crtc_state, i) c->crtc_mask |=drm_crtc_mask (crtc);/* * Figure out what fence to wait for: */ -for_each_plane_in_state (state, plane, plane_state, i) { -if ((plane->state->fb != plane_state->fb) && plane_state->fb) { -struct drm_gem_object *obj =msm_framebuffer_bo (plane_state->fb,0 ); +for_each_oldnew_plane_in_state (state, plane, old_plane_state, new_plane_state, i) { +if ((new_plane_state->fb != old_plane_state->fb) && new_plane_state->fb) { +struct drm_gem_object *obj =msm_framebuffer_bo (new_plane_state->fb,0 );struct msm_gem_object *msm_obj =to_msm_bo (obj);struct dma_fence *fence =reservation_object_get_excl_rcu (msm_obj->resv);
Signature · 6 lines
2.11.0 _______________________________________________ Freedreno mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/freedreno
Re: [Intel-gfx] [PATCH 14/16] drm/msm: Convert to use new iterator macros
Quoted 83 lines · Maarten Lankhorst
for_each_obj_in_stateis about to be removed, so convert to the new iterator macros.Just like in omap, use
crtc_state->activeinstead ofcrtc_state->enablewhen waiting for completion.Signed-off-by Maarten Lankhorst <[email protected]>Cc Rob Clark <[email protected]>Cc Archit Taneja <[email protected]>Cc Vincent Abriou <[email protected]>Cc Maarten Lankhorst <[email protected]>Cc Russell King <[email protected]>Cc Rob Herring <[email protected]>Cc Markus Elfring <[email protected]>Cc Sushmita Susheelendra <[email protected]>--- drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c | 4 ++-- drivers/gpu/drm/msm/msm_atomic.c | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-)drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c +2
-2@@ -114,7 +114,7 @@ static void mdp4_prepare_commit(struct msm_kms *kms, struct drm_atomic_state *stmdp4_enable (mdp4_kms);/* see 119ecb7fd */ -for_each_crtc_in_state (state, crtc, crtc_state, i) +for_each_new_crtc_in_state (state, crtc, crtc_state, i)drm_crtc_vblank_get (crtc); }@@ -126,7 +126,7 @@ static void mdp4_complete_commit(struct msm_kms *kms, struct drm_atomic_state *sstruct drm_crtc_state *crtc_state;/* see 119ecb7fd */ -for_each_crtc_in_state (state, crtc, crtc_state, i) +for_each_new_crtc_in_state (state, crtc, crtc_state, i)drm_crtc_vblank_put (crtc);mdp4_disable (mdp4_kms);drivers/gpu/drm/msm/msm_atomic.c +5
-5@@ -84,13 +84,13 @@ static void msm_atomic_wait_for_commit_done(struct drm_device *dev, struct drm_atomic_state *old_state) {struct drm_crtc *crtc; -struct drm_crtc_state *crtc_state; +struct drm_crtc_state *new_crtc_state;struct msm_drm_private *priv = old_state->dev->dev_private;struct msm_kms *kms = priv->kms;int i; -for_each_crtc_in_state (old_state, crtc, crtc_state, i) { -if (!crtc->state->enable) +for_each_new_crtc_in_state (old_state, crtc, new_crtc_state, i) { +if (!new_crtc_state->active)continue ; kms->funcs->wait_for_crtc_commit_done (kms, crtc);@@ -195,7 +195,7 @@ int msm_atomic_commit(struct drm_device *dev,struct drm_crtc *crtc;struct drm_crtc_state *crtc_state;struct drm_plane *plane; -struct drm_plane_state *plane_state; +struct drm_plane_state *old_plane_state, *new_plane_state;int i, ret; ret =drm_atomic_helper_prepare_planes (dev, state);@@ -211,15 +211,15 @@ int msm_atomic_commit(struct drm_device *dev,/* * Figure out what crtcs we have: */ -for_each_crtc_in_state (state, crtc, crtc_state, i) +for_each_new_crtc_in_state (state, crtc, crtc_state, i) c->crtc_mask |=drm_crtc_mask (crtc);/*
drivers/gpu/drm/msm/msm_atomic.c int msm_atomic_commit(struct drm_device *dev, · line 224
Quoted 10 lines
drivers/gpu/drm/msm/msm_atomic.c +3
-3* Figure out what fence to wait for: */ -for_each_plane_in_state (state, plane, plane_state, i) { -if ((plane->state->fb != plane_state->fb) && plane_state->fb) { -struct drm_gem_object *obj =msm_framebuffer_bo (plane_state->fb,0 ); +for_each_oldnew_plane_in_state (state, plane, old_plane_state, new_plane_state, i) { +if ((new_plane_state->fb != old_plane_state->fb) && new_plane_state->fb) { +struct drm_gem_object *obj =msm_framebuffer_bo (new_plane_state->fb,0 );struct msm_gem_object *msm_obj =to_msm_bo (obj);struct dma_fence *fence =reservation_object_get_excl_rcu (msm_obj->resv);
Pretty sure this fails to compile, you've forgotten to do one more s/plane_state/new_plane_state/.
With that fixed:
Quoted 8 lines
Signature · 7 lines
-- 2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
A message that is not in the archive (sent off-list or not yet received): 20170712094823.2akjrev3v7ckxb7b-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org
PATCH 14/16 drm/msm: Convert to use new iterator macros, v2.
Op 12-07-17 om 11:48 schreef Daniel Vetter:
Quoted 97 lines · Maarten Lankhorst
Quoted 83 lines
for_each_obj_in_stateis about to be removed, so convert to the new iterator macros.Just like in omap, use
crtc_state->activeinstead ofcrtc_state->enablewhen waiting for completion.Signed-off-by Maarten Lankhorst <[email protected]>Cc Rob Clark <[email protected]>Cc Archit Taneja <[email protected]>Cc Vincent Abriou <[email protected]>Cc Maarten Lankhorst <[email protected]>Cc Russell King <[email protected]>Cc Rob Herring <[email protected]>Cc Markus Elfring <[email protected]>Cc Sushmita Susheelendra <[email protected]>--- drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c | 4 ++-- drivers/gpu/drm/msm/msm_atomic.c | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-)drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c +2
-2@@ -114,7 +114,7 @@ static void mdp4_prepare_commit(struct msm_kms *kms, struct drm_atomic_state *stmdp4_enable (mdp4_kms);/* see 119ecb7fd */ -for_each_crtc_in_state (state, crtc, crtc_state, i) +for_each_new_crtc_in_state (state, crtc, crtc_state, i)drm_crtc_vblank_get (crtc); }@@ -126,7 +126,7 @@ static void mdp4_complete_commit(struct msm_kms *kms, struct drm_atomic_state *sstruct drm_crtc_state *crtc_state;/* see 119ecb7fd */ -for_each_crtc_in_state (state, crtc, crtc_state, i) +for_each_new_crtc_in_state (state, crtc, crtc_state, i)drm_crtc_vblank_put (crtc);mdp4_disable (mdp4_kms);drivers/gpu/drm/msm/msm_atomic.c +5
-5@@ -84,13 +84,13 @@ static void msm_atomic_wait_for_commit_done(struct drm_device *dev, struct drm_atomic_state *old_state) {struct drm_crtc *crtc; -struct drm_crtc_state *crtc_state; +struct drm_crtc_state *new_crtc_state;struct msm_drm_private *priv = old_state->dev->dev_private;struct msm_kms *kms = priv->kms;int i; -for_each_crtc_in_state (old_state, crtc, crtc_state, i) { -if (!crtc->state->enable) +for_each_new_crtc_in_state (old_state, crtc, new_crtc_state, i) { +if (!new_crtc_state->active)continue ; kms->funcs->wait_for_crtc_commit_done (kms, crtc);@@ -195,7 +195,7 @@ int msm_atomic_commit(struct drm_device *dev,struct drm_crtc *crtc;struct drm_crtc_state *crtc_state;struct drm_plane *plane; -struct drm_plane_state *plane_state; +struct drm_plane_state *old_plane_state, *new_plane_state;int i, ret; ret =drm_atomic_helper_prepare_planes (dev, state);@@ -211,15 +211,15 @@ int msm_atomic_commit(struct drm_device *dev,/* * Figure out what crtcs we have: */ -for_each_crtc_in_state (state, crtc, crtc_state, i) +for_each_new_crtc_in_state (state, crtc, crtc_state, i) c->crtc_mask |=drm_crtc_mask (crtc);/* drivers/gpu/drm/msm/msm_atomic.c int msm_atomic_commit(struct drm_device *dev, · line 224
Quoted 10 lines
drivers/gpu/drm/msm/msm_atomic.c +3
-3* Figure out what fence to wait for: */ -for_each_plane_in_state (state, plane, plane_state, i) { -if ((plane->state->fb != plane_state->fb) && plane_state->fb) { -struct drm_gem_object *obj =msm_framebuffer_bo (plane_state->fb,0 ); +for_each_oldnew_plane_in_state (state, plane, old_plane_state, new_plane_state, i) { +if ((new_plane_state->fb != old_plane_state->fb) && new_plane_state->fb) { +struct drm_gem_object *obj =msm_framebuffer_bo (new_plane_state->fb,0 );struct msm_gem_object *msm_obj =to_msm_bo (obj);struct dma_fence *fence =reservation_object_get_excl_rcu (msm_obj->resv);Pretty sure this fails to compile, you've forgotten to do one more s/plane_state/new_plane_state/.
Quoted 3 lines
With that fixed:
Reviewed-by Daniel Vetter <[email protected]>
--->8---for_each_obj_in_state is about to be removed, so convert to the new iterator macros.
Just like in omap, use crtc_state->active instead of crtc_state->enable when waiting for completion.
Changes since v1:
- Fix compilation.
--- drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c | 4 ++-- drivers/gpu/drm/msm/msm_atomic.c | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-)
drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c +2 -2
@@ -114,7 +114,7 @@ static void mdp4_prepare_commit(struct msm_kms *kms, struct drm_atomic_state *stmdp4_enable (mdp4_kms);/* see 119ecb7fd */ -for_each_crtc_in_state (state, crtc, crtc_state, i) +for_each_new_crtc_in_state (state, crtc, crtc_state, i)drm_crtc_vblank_get (crtc); }
@@ -126,7 +126,7 @@ static void mdp4_complete_commit(struct msm_kms *kms, struct drm_atomic_state *sstruct drm_crtc_state *crtc_state;/* see 119ecb7fd */ -for_each_crtc_in_state (state, crtc, crtc_state, i) +for_each_new_crtc_in_state (state, crtc, crtc_state, i)drm_crtc_vblank_put (crtc);mdp4_disable (mdp4_kms);
drivers/gpu/drm/msm/msm_atomic.c +9 -9
@@ -84,13 +84,13 @@ static void msm_atomic_wait_for_commit_done(struct drm_device *dev, struct drm_atomic_state *old_state) {struct drm_crtc *crtc; -struct drm_crtc_state *crtc_state; +struct drm_crtc_state *new_crtc_state;struct msm_drm_private *priv = old_state->dev->dev_private;struct msm_kms *kms = priv->kms;int i; -for_each_crtc_in_state (old_state, crtc, crtc_state, i) { -if (!crtc->state->enable) +for_each_new_crtc_in_state (old_state, crtc, new_crtc_state, i) { +if (!new_crtc_state->active)continue ; kms->funcs->wait_for_crtc_commit_done (kms, crtc);
@@ -195,7 +195,7 @@ int msm_atomic_commit(struct drm_device *dev,struct drm_crtc *crtc;struct drm_crtc_state *crtc_state;struct drm_plane *plane; -struct drm_plane_state *plane_state; +struct drm_plane_state *old_plane_state, *new_plane_state;int i, ret; ret =drm_atomic_helper_prepare_planes (dev, state);
@@ -211,19 +211,19 @@ int msm_atomic_commit(struct drm_device *dev,/* * Figure out what crtcs we have: */ -for_each_crtc_in_state (state, crtc, crtc_state, i) +for_each_new_crtc_in_state (state, crtc, crtc_state, i) c->crtc_mask |=drm_crtc_mask (crtc);/* * Figure out what fence to wait for: */ -for_each_plane_in_state (state, plane, plane_state, i) { -if ((plane->state->fb != plane_state->fb) && plane_state->fb) { -struct drm_gem_object *obj =msm_framebuffer_bo (plane_state->fb,0 ); +for_each_oldnew_plane_in_state (state, plane, old_plane_state, new_plane_state, i) { +if ((new_plane_state->fb != old_plane_state->fb) && new_plane_state->fb) { +struct drm_gem_object *obj =msm_framebuffer_bo (new_plane_state->fb,0 );struct msm_gem_object *msm_obj =to_msm_bo (obj);struct dma_fence *fence =reservation_object_get_excl_rcu (msm_obj->resv); -drm_atomic_set_fence_for_plane (plane_state, fence); +drm_atomic_set_fence_for_plane (new_plane_state, fence); } }
Signature · 7 lines
2.11.0 _______________________________________________ Freedreno mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/freedreno
A message that is not in the archive (sent off-list or not yet received): de5e7892-71a0-d160-6619-e8267d793897-VuQAYsv1563Yd54FQh9/[email protected]
Archit Taneja
Tested-byRe: [PATCH 14/16] drm/msm: Convert to use new iterator macros, v2.
Quoted 7 lines · Maarten Lankhorst
Op 12-07-17 om 11:48 schreef Daniel Vetter:
Quoted 6 lines · Maarten Lankhorst
Quoted 5 lines
for_each_obj_in_stateis about to be removed, so convert to the new iterator macros.Just like in omap, use
crtc_state->activeinstead ofcrtc_state->enablewhen waiting for completion.
Quoted 200 lines
Quoted 91 lines
Quoted 78 lines
Signed-off-by Maarten Lankhorst <[email protected]>Cc Rob Clark <[email protected]>Cc Archit Taneja <[email protected]>Cc Vincent Abriou <[email protected]>Cc Maarten Lankhorst <[email protected]>Cc Russell King <[email protected]>Cc Rob Herring <[email protected]>Cc Markus Elfring <[email protected]>Cc Sushmita Susheelendra <[email protected]>--- drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c | 4 ++-- drivers/gpu/drm/msm/msm_atomic.c | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-)drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c +2
-2@@ -114,7 +114,7 @@ static void mdp4_prepare_commit(struct msm_kms *kms, struct drm_atomic_state *stmdp4_enable (mdp4_kms);/* see 119ecb7fd */ -for_each_crtc_in_state (state, crtc, crtc_state, i) +for_each_new_crtc_in_state (state, crtc, crtc_state, i)drm_crtc_vblank_get (crtc); }@@ -126,7 +126,7 @@ static void mdp4_complete_commit(struct msm_kms *kms, struct drm_atomic_state *sstruct drm_crtc_state *crtc_state;/* see 119ecb7fd */ -for_each_crtc_in_state (state, crtc, crtc_state, i) +for_each_new_crtc_in_state (state, crtc, crtc_state, i)drm_crtc_vblank_put (crtc);mdp4_disable (mdp4_kms);drivers/gpu/drm/msm/msm_atomic.c +5
-5@@ -84,13 +84,13 @@ static void msm_atomic_wait_for_commit_done(struct drm_device *dev, struct drm_atomic_state *old_state) {struct drm_crtc *crtc; -struct drm_crtc_state *crtc_state; +struct drm_crtc_state *new_crtc_state;struct msm_drm_private *priv = old_state->dev->dev_private;struct msm_kms *kms = priv->kms;int i; -for_each_crtc_in_state (old_state, crtc, crtc_state, i) { -if (!crtc->state->enable) +for_each_new_crtc_in_state (old_state, crtc, new_crtc_state, i) { +if (!new_crtc_state->active)continue ; kms->funcs->wait_for_crtc_commit_done (kms, crtc);@@ -195,7 +195,7 @@ int msm_atomic_commit(struct drm_device *dev,struct drm_crtc *crtc;struct drm_crtc_state *crtc_state;struct drm_plane *plane; -struct drm_plane_state *plane_state; +struct drm_plane_state *old_plane_state, *new_plane_state;int i, ret; ret =drm_atomic_helper_prepare_planes (dev, state);@@ -211,15 +211,15 @@ int msm_atomic_commit(struct drm_device *dev,/* * Figure out what crtcs we have: */ -for_each_crtc_in_state (state, crtc, crtc_state, i) +for_each_new_crtc_in_state (state, crtc, crtc_state, i) c->crtc_mask |=drm_crtc_mask (crtc);/* drivers/gpu/drm/msm/msm_atomic.c int msm_atomic_commit(struct drm_device *dev, · line 224
Quoted 10 lines
drivers/gpu/drm/msm/msm_atomic.c +3
-3* Figure out what fence to wait for: */ -for_each_plane_in_state (state, plane, plane_state, i) { -if ((plane->state->fb != plane_state->fb) && plane_state->fb) { -struct drm_gem_object *obj =msm_framebuffer_bo (plane_state->fb,0 ); +for_each_oldnew_plane_in_state (state, plane, old_plane_state, new_plane_state, i) { +if ((new_plane_state->fb != old_plane_state->fb) && new_plane_state->fb) { +struct drm_gem_object *obj =msm_framebuffer_bo (new_plane_state->fb,0 );struct msm_gem_object *msm_obj =to_msm_bo (obj);struct dma_fence *fence =reservation_object_get_excl_rcu (msm_obj->resv);Pretty sure this fails to compile, you've forgotten to do one more s/plane_state/new_plane_state/.
Quoted 3 lines
With that fixed:
Reviewed-by Daniel Vetter <[email protected]>--->8---
for_each_obj_in_stateis about to be removed, so convert to the new iterator macros.Just like in omap, use
crtc_state->activeinstead ofcrtc_state->enablewhen waiting for completion.Changes since v1:
- Fix compilation.Signed-off-by Maarten Lankhorst <[email protected]>Cc Rob Clark <[email protected]>Cc Archit Taneja <[email protected]>Cc Vincent Abriou <[email protected]>Cc Maarten Lankhorst <[email protected]>Cc Russell King <[email protected]>Cc Rob Herring <[email protected]>Cc Markus Elfring <[email protected]>Cc Sushmita Susheelendra <[email protected]>Reviewed-by Daniel Vetter <[email protected]>--- drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c | 4 ++-- drivers/gpu/drm/msm/msm_atomic.c | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-)drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c +2
-2@@ -114,7 +114,7 @@ static void mdp4_prepare_commit(struct msm_kms *kms, struct drm_atomic_state *stmdp4_enable (mdp4_kms);/* see 119ecb7fd */ -for_each_crtc_in_state (state, crtc, crtc_state, i) +for_each_new_crtc_in_state (state, crtc, crtc_state, i)drm_crtc_vblank_get (crtc); }@@ -126,7 +126,7 @@ static void mdp4_complete_commit(struct msm_kms *kms, struct drm_atomic_state *sstruct drm_crtc_state *crtc_state;/* see 119ecb7fd */ -for_each_crtc_in_state (state, crtc, crtc_state, i) +for_each_new_crtc_in_state (state, crtc, crtc_state, i)drm_crtc_vblank_put (crtc);mdp4_disable (mdp4_kms);drivers/gpu/drm/msm/msm_atomic.c +9
-9@@ -84,13 +84,13 @@ static void msm_atomic_wait_for_commit_done(struct drm_device *dev, struct drm_atomic_state *old_state) {struct drm_crtc *crtc; -struct drm_crtc_state *crtc_state; +struct drm_crtc_state *new_crtc_state;struct msm_drm_private *priv = old_state->dev->dev_private;struct msm_kms *kms = priv->kms;int i; -for_each_crtc_in_state (old_state, crtc, crtc_state, i) { -if (!crtc->state->enable) +for_each_new_crtc_in_state (old_state, crtc, new_crtc_state, i) { +if (!new_crtc_state->active)continue ; kms->funcs->wait_for_crtc_commit_done (kms, crtc);@@ -195,7 +195,7 @@ int msm_atomic_commit(struct drm_device *dev,struct drm_crtc *crtc;struct drm_crtc_state *crtc_state;struct drm_plane *plane; -struct drm_plane_state *plane_state; +struct drm_plane_state *old_plane_state, *new_plane_state;int i, ret; ret =drm_atomic_helper_prepare_planes (dev, state);@@ -211,19 +211,19 @@ int msm_atomic_commit(struct drm_device *dev,/* * Figure out what crtcs we have: */ -for_each_crtc_in_state (state, crtc, crtc_state, i) +for_each_new_crtc_in_state (state, crtc, crtc_state, i) c->crtc_mask |=drm_crtc_mask (crtc);/* * Figure out what fence to wait for: */ -for_each_plane_in_state (state, plane, plane_state, i) { -if ((plane->state->fb != plane_state->fb) && plane_state->fb) { -struct drm_gem_object *obj =msm_framebuffer_bo (plane_state->fb,0 ); +for_each_oldnew_plane_in_state (state, plane, old_plane_state, new_plane_state, i) { +if ((new_plane_state->fb != old_plane_state->fb) && new_plane_state->fb) { +struct drm_gem_object *obj =msm_framebuffer_bo (new_plane_state->fb,0 );struct msm_gem_object *msm_obj =to_msm_bo (obj);struct dma_fence *fence =reservation_object_get_excl_rcu (msm_obj->resv); -drm_atomic_set_fence_for_plane (plane_state, fence); +drm_atomic_set_fence_for_plane (new_plane_state, fence); } }
Signature · 6 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project _______________________________________________ Freedreno mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/freedreno
Maarten Lankhorst
maintainerPATCH 15/16 drm/nouveau: Convert nouveau to use new iterator macros
In reply to Maarten LankhorstUse the new atomic iterator macros, the old ones are about to be removed. With the new macros, it's more easy to get old and new state so get them from the macros instead of from obj->state.
--- drivers/gpu/drm/nouveau/nv50_display.c | 71 +++++++++++++++++----------------- 1 file changed, 36 insertions(+), 35 deletions(-)
drivers/gpu/drm/nouveau/nv50_display.c +36 -35
@@ -2103,7 +2103,7 @@ nv50_head_atomic_check(struct drm_crtc *crtc, struct drm_crtc_state *state)NV_ATOMIC (drm,"%s atomic_check %d\n" , crtc->name, asyh->state.active);if (asyh->state.active) { -for_each_connector_in_state (asyh->state.state, conn, conns, i) { +for_each_new_connector_in_state (asyh->state.state, conn, conns, i) {if (conns->crtc == crtc) { asyc =nouveau_conn_atom (conns);break ;
@@ -3904,9 +3904,9 @@ static void nv50_disp_atomic_commit_tail(struct drm_atomic_state *state) {struct drm_device *dev = state->dev; -struct drm_crtc_state *crtc_state; +struct drm_crtc_state *new_crtc_state;struct drm_crtc *crtc; -struct drm_plane_state *plane_state; +struct drm_plane_state *new_plane_state;struct drm_plane *plane;struct nouveau_drm *drm =nouveau_drm (dev);struct nv50_disp *disp =nv50_disp (dev);
@@ -3925,8 +3925,8 @@ nv50_disp_atomic_commit_tail(struct drm_atomic_state *state)mutex_lock (&disp->mutex);/* Disable head(s). */ -for_each_crtc_in_state (state, crtc, crtc_state, i) { -struct nv50_head_atom *asyh =nv50_head_atom (crtc->state); +for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) { +struct nv50_head_atom *asyh =nv50_head_atom (new_crtc_state);struct nv50_head *head =nv50_head (crtc); NV_ATOMIC(drm, "%s: clr %04x (set %04x)\n", crtc->name,
@@ -3939,8 +3939,8 @@ nv50_disp_atomic_commit_tail(struct drm_atomic_state *state) }/* Disable plane(s). */ -for_each_plane_in_state (state, plane, plane_state, i) { -struct nv50_wndw_atom *asyw =nv50_wndw_atom (plane->state); +for_each_new_plane_in_state (state, plane, new_plane_state, i) { +struct nv50_wndw_atom *asyw =nv50_wndw_atom (new_plane_state);struct nv50_wndw *wndw =nv50_wndw (plane); NV_ATOMIC(drm, "%s: clr %02x (set %02x)\n", plane->name,
@@ -4005,8 +4005,8 @@ nv50_disp_atomic_commit_tail(struct drm_atomic_state *state) }/* Update head(s). */ -for_each_crtc_in_state (state, crtc, crtc_state, i) { -struct nv50_head_atom *asyh =nv50_head_atom (crtc->state); +for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) { +struct nv50_head_atom *asyh =nv50_head_atom (new_crtc_state);struct nv50_head *head =nv50_head (crtc); NV_ATOMIC(drm, "%s: set %04x (clr %04x)\n", crtc->name,
@@ -4018,14 +4018,14 @@ nv50_disp_atomic_commit_tail(struct drm_atomic_state *state) } } -for_each_crtc_in_state (state, crtc, crtc_state, i) { -if (crtc->state->event) +for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) { +if (new_crtc_state->event)drm_crtc_vblank_get (crtc); }/* Update plane(s). */ -for_each_plane_in_state (state, plane, plane_state, i) { -struct nv50_wndw_atom *asyw =nv50_wndw_atom (plane->state); +for_each_new_plane_in_state (state, plane, new_plane_state, i) { +struct nv50_wndw_atom *asyw =nv50_wndw_atom (new_plane_state);struct nv50_wndw *wndw =nv50_wndw (plane); NV_ATOMIC(drm, "%s: set %02x (clr %02x)\n", plane->name,
@@ -4055,23 +4055,23 @@ nv50_disp_atomic_commit_tail(struct drm_atomic_state *state)mutex_unlock (&disp->mutex);/* Wait for HW to signal completion. */ -for_each_plane_in_state (state, plane, plane_state, i) { -struct nv50_wndw_atom *asyw =nv50_wndw_atom (plane->state); +for_each_new_plane_in_state (state, plane, new_plane_state, i) { +struct nv50_wndw_atom *asyw =nv50_wndw_atom (new_plane_state);struct nv50_wndw *wndw =nv50_wndw (plane);int ret =nv50_wndw_wait_armed (wndw, asyw);if (ret)NV_ERROR (drm,"%s: timeout\n" , plane->name); } -for_each_crtc_in_state (state, crtc, crtc_state, i) { -if (crtc->state->event) { +for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) { +if (new_crtc_state->event) {unsigned long flags;/* Get correct count/ts if racing with vblank irq */ drm_crtc_accurate_vblank_count (crtc);spin_lock_irqsave (&crtc->dev->event_lock, flags); -drm_crtc_send_vblank_event (crtc, crtc->state->event); +drm_crtc_send_vblank_event (crtc, new_crtc_state->event);spin_unlock_irqrestore (&crtc->dev->event_lock, flags); - crtc->state->event =NULL ; + new_crtc_state->event =NULL ;drm_crtc_vblank_put (crtc); } }
@@ -4096,7 +4096,7 @@ nv50_disp_atomic_commit(struct drm_device *dev, {struct nouveau_drm *drm =nouveau_drm (dev);struct nv50_disp *disp =nv50_disp (dev); -struct drm_plane_state *plane_state; +struct drm_plane_state *old_plane_state;struct drm_plane *plane;struct drm_crtc *crtc;bool active = false;
@@ -4122,8 +4122,8 @@ nv50_disp_atomic_commit(struct drm_device *dev, goto done; } -for_each_plane_in_state (state, plane, plane_state, i) { -struct nv50_wndw_atom *asyw =nv50_wndw_atom (plane_state); +for_each_old_plane_in_state (state, plane, old_plane_state, i) { +struct nv50_wndw_atom *asyw =nv50_wndw_atom (old_plane_state);struct nv50_wndw *wndw =nv50_wndw (plane);if (asyw->set.image) { asyw->ntfy.handle = wndw->dmac->sync.handle;
@@ -4185,18 +4185,19 @@ nv50_disp_outp_atomic_add(struct nv50_atom *atom, struct drm_encoder *encoder)static int nv50_disp_outp_atomic_check_clr (struct nv50_atom *atom, -struct drm_connector *connector) +struct drm_connector_state *old_connector_state) { -struct drm_encoder *encoder = connector->state->best_encoder; -struct drm_crtc_state *crtc_state; +struct drm_encoder *encoder = old_connector_state->best_encoder; +struct drm_crtc_state *old_crtc_state, *new_crtc_state;struct drm_crtc *crtc;struct nv50_outp_atom *outp; -if (!(crtc = connector->state->crtc)) +if (!(crtc = old_connector_state->crtc))return 0 ; - crtc_state =drm_atomic_get_existing_crtc_state (&atom->state, crtc); -if (crtc->state->active &&drm_atomic_crtc_needs_modeset (crtc_state)) { + old_crtc_state =drm_atomic_get_new_crtc_state (&atom->state, crtc); + new_crtc_state =drm_atomic_get_new_crtc_state (&atom->state, crtc); +if (old_crtc_state->active &&drm_atomic_crtc_needs_modeset (new_crtc_state)) { outp =nv50_disp_outp_atomic_add (atom, encoder);if (IS_ERR (outp))return PTR_ERR (outp);
@@ -4217,15 +4218,15 @@ nv50_disp_outp_atomic_check_set(struct nv50_atom *atom, struct drm_connector_state *connector_state) {struct drm_encoder *encoder = connector_state->best_encoder; -struct drm_crtc_state *crtc_state; +struct drm_crtc_state *new_crtc_state;struct drm_crtc *crtc;struct nv50_outp_atom *outp;if (!(crtc = connector_state->crtc))return 0 ; - crtc_state =drm_atomic_get_existing_crtc_state (&atom->state, crtc); -if (crtc_state->active &&drm_atomic_crtc_needs_modeset (crtc_state)) { + new_crtc_state =drm_atomic_get_new_crtc_state (&atom->state, crtc); +if (new_crtc_state->active &&drm_atomic_crtc_needs_modeset (new_crtc_state)) { outp =nv50_disp_outp_atomic_add (atom, encoder);if (IS_ERR (outp))return PTR_ERR (outp);
@@ -4241,7 +4242,7 @@ static int nv50_disp_atomic_check(struct drm_device *dev, struct drm_atomic_state *state) { struct nv50_atom *atom = nv50_atom(state); -struct drm_connector_state *connector_state; +struct drm_connector_state *old_connector_state, *new_connector_state;struct drm_connector *connector;int ret, i;
@@ -4249,12 +4250,12 @@ nv50_disp_atomic_check(struct drm_device *dev, struct drm_atomic_state *state)if (ret)return ret; -for_each_connector_in_state (state, connector, connector_state, i) { - ret =nv50_disp_outp_atomic_check_clr (atom, connector); +for_each_oldnew_connector_in_state (state, connector, old_connector_state, new_connector_state, i) { + ret =nv50_disp_outp_atomic_check_clr (atom, old_connector_state);if (ret)return ret; - ret =nv50_disp_outp_atomic_check_set (atom, connector_state); + ret =nv50_disp_outp_atomic_check_set (atom, new_connector_state);if (ret)return ret; }
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH 15/16] drm/nouveau: Convert nouveau to use new iterator macros
Quoted 150 lines · Maarten Lankhorst
Use the new atomic iterator macros, the old ones are about to be removed. With the new macros, it's more easy to get old and new state so get them from the macros instead of from
obj->state.Signed-off-by Maarten Lankhorst <[email protected]>Cc Ben Skeggs <[email protected]>--- drivers/gpu/drm/nouveau/nv50_display.c | 71 +++++++++++++++++----------------- 1 file changed, 36 insertions(+), 35 deletions(-)drivers/gpu/drm/nouveau/nv50_display.c +25
-25@@ -2103,7 +2103,7 @@ nv50_head_atomic_check(struct drm_crtc *crtc, struct drm_crtc_state *state)NV_ATOMIC (drm,"%s atomic_check %d\n" , crtc->name, asyh->state.active);if (asyh->state.active) { -for_each_connector_in_state (asyh->state.state, conn, conns, i) { +for_each_new_connector_in_state (asyh->state.state, conn, conns, i) {if (conns->crtc == crtc) { asyc =nouveau_conn_atom (conns);break ;@@ -3904,9 +3904,9 @@ static void nv50_disp_atomic_commit_tail(struct drm_atomic_state *state) {struct drm_device *dev = state->dev; -struct drm_crtc_state *crtc_state; +struct drm_crtc_state *new_crtc_state;struct drm_crtc *crtc; -struct drm_plane_state *plane_state; +struct drm_plane_state *new_plane_state;struct drm_plane *plane;struct nouveau_drm *drm =nouveau_drm (dev);struct nv50_disp *disp =nv50_disp (dev);@@ -3925,8 +3925,8 @@ nv50_disp_atomic_commit_tail(struct drm_atomic_state *state)mutex_lock (&disp->mutex);/* Disable head(s). */ -for_each_crtc_in_state (state, crtc, crtc_state, i) { -struct nv50_head_atom *asyh =nv50_head_atom (crtc->state); +for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) { +struct nv50_head_atom *asyh =nv50_head_atom (new_crtc_state);struct nv50_head *head =nv50_head (crtc); NV_ATOMIC(drm, "%s: clr %04x (set %04x)\n", crtc->name,@@ -3939,8 +3939,8 @@ nv50_disp_atomic_commit_tail(struct drm_atomic_state *state) }/* Disable plane(s). */ -for_each_plane_in_state (state, plane, plane_state, i) { -struct nv50_wndw_atom *asyw =nv50_wndw_atom (plane->state); +for_each_new_plane_in_state (state, plane, new_plane_state, i) { +struct nv50_wndw_atom *asyw =nv50_wndw_atom (new_plane_state);struct nv50_wndw *wndw =nv50_wndw (plane); NV_ATOMIC(drm, "%s: clr %02x (set %02x)\n", plane->name,@@ -4005,8 +4005,8 @@ nv50_disp_atomic_commit_tail(struct drm_atomic_state *state) }/* Update head(s). */ -for_each_crtc_in_state (state, crtc, crtc_state, i) { -struct nv50_head_atom *asyh =nv50_head_atom (crtc->state); +for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) { +struct nv50_head_atom *asyh =nv50_head_atom (new_crtc_state);struct nv50_head *head =nv50_head (crtc); NV_ATOMIC(drm, "%s: set %04x (clr %04x)\n", crtc->name,@@ -4018,14 +4018,14 @@ nv50_disp_atomic_commit_tail(struct drm_atomic_state *state) } } -for_each_crtc_in_state (state, crtc, crtc_state, i) { -if (crtc->state->event) +for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) { +if (new_crtc_state->event)drm_crtc_vblank_get (crtc); }/* Update plane(s). */ -for_each_plane_in_state (state, plane, plane_state, i) { -struct nv50_wndw_atom *asyw =nv50_wndw_atom (plane->state); +for_each_new_plane_in_state (state, plane, new_plane_state, i) { +struct nv50_wndw_atom *asyw =nv50_wndw_atom (new_plane_state);struct nv50_wndw *wndw =nv50_wndw (plane); NV_ATOMIC(drm, "%s: set %02x (clr %02x)\n", plane->name,@@ -4055,23 +4055,23 @@ nv50_disp_atomic_commit_tail(struct drm_atomic_state *state)mutex_unlock (&disp->mutex);/* Wait for HW to signal completion. */ -for_each_plane_in_state (state, plane, plane_state, i) { -struct nv50_wndw_atom *asyw =nv50_wndw_atom (plane->state); +for_each_new_plane_in_state (state, plane, new_plane_state, i) { +struct nv50_wndw_atom *asyw =nv50_wndw_atom (new_plane_state);struct nv50_wndw *wndw =nv50_wndw (plane);int ret =nv50_wndw_wait_armed (wndw, asyw);if (ret)NV_ERROR (drm,"%s: timeout\n" , plane->name); } -for_each_crtc_in_state (state, crtc, crtc_state, i) { -if (crtc->state->event) { +for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) { +if (new_crtc_state->event) {unsigned long flags;/* Get correct count/ts if racing with vblank irq */ drm_crtc_accurate_vblank_count (crtc);spin_lock_irqsave (&crtc->dev->event_lock, flags); -drm_crtc_send_vblank_event (crtc, crtc->state->event); +drm_crtc_send_vblank_event (crtc, new_crtc_state->event);spin_unlock_irqrestore (&crtc->dev->event_lock, flags); - crtc->state->event =NULL ; + new_crtc_state->event =NULL ;drm_crtc_vblank_put (crtc); } }@@ -4096,7 +4096,7 @@ nv50_disp_atomic_commit(struct drm_device *dev, {struct nouveau_drm *drm =nouveau_drm (dev);struct nv50_disp *disp =nv50_disp (dev); -struct drm_plane_state *plane_state; +struct drm_plane_state *old_plane_state;struct drm_plane *plane;struct drm_crtc *crtc;bool active = false;@@ -4122,8 +4122,8 @@ nv50_disp_atomic_commit(struct drm_device *dev, goto done; } -for_each_plane_in_state (state, plane, plane_state, i) { -struct nv50_wndw_atom *asyw =nv50_wndw_atom (plane_state); +for_each_old_plane_in_state (state, plane, old_plane_state, i) { +struct nv50_wndw_atom *asyw =nv50_wndw_atom (old_plane_state);struct nv50_wndw *wndw =nv50_wndw (plane);if (asyw->set.image) { asyw->ntfy.handle = wndw->dmac->sync.handle;@@ -4185,18 +4185,19 @@ nv50_disp_outp_atomic_add(struct nv50_atom *atom, struct drm_encoder *encoder)static int nv50_disp_outp_atomic_check_clr (struct nv50_atom *atom, -struct drm_connector *connector) +struct drm_connector_state *old_connector_state) { -struct drm_encoder *encoder = connector->state->best_encoder; -struct drm_crtc_state *crtc_state; +struct drm_encoder *encoder = old_connector_state->best_encoder; +struct drm_crtc_state *old_crtc_state, *new_crtc_state;struct drm_crtc *crtc;
drivers/gpu/drm/nouveau/nv50_display.c nv50_disp_outp_atomic_add(struct nv50_atom *atom, struct drm_encoder *encoder) · line 4199
Quoted 10 lines
drivers/gpu/drm/nouveau/nv50_display.c +3
-3struct nv50_outp_atom *outp; -if (!(crtc = connector->state->crtc)) +if (!(crtc = old_connector_state->crtc))return 0 ; - crtc_state =drm_atomic_get_existing_crtc_state (&atom->state, crtc); -if (crtc->state->active &&drm_atomic_crtc_needs_modeset (crtc_state)) { + old_crtc_state =drm_atomic_get_new_crtc_state (&atom->state, crtc); + new_crtc_state =drm_atomic_get_new_crtc_state (&atom->state, crtc);
I think you have a mixup here of the crtc states for old and new crtc, both are get_new_crtc_state.
Otherwise lgtm.
-Daniel
Quoted 55 lines
drivers/gpu/drm/nouveau/nv50_display.c +8
-7+if (old_crtc_state->active &&drm_atomic_crtc_needs_modeset (new_crtc_state)) { outp =nv50_disp_outp_atomic_add (atom, encoder);if (IS_ERR (outp))return PTR_ERR (outp);@@ -4217,15 +4218,15 @@ nv50_disp_outp_atomic_check_set(struct nv50_atom *atom, struct drm_connector_state *connector_state) {struct drm_encoder *encoder = connector_state->best_encoder; -struct drm_crtc_state *crtc_state; +struct drm_crtc_state *new_crtc_state;struct drm_crtc *crtc;struct nv50_outp_atom *outp;if (!(crtc = connector_state->crtc))return 0 ; - crtc_state =drm_atomic_get_existing_crtc_state (&atom->state, crtc); -if (crtc_state->active &&drm_atomic_crtc_needs_modeset (crtc_state)) { + new_crtc_state =drm_atomic_get_new_crtc_state (&atom->state, crtc); +if (new_crtc_state->active &&drm_atomic_crtc_needs_modeset (new_crtc_state)) { outp =nv50_disp_outp_atomic_add (atom, encoder);if (IS_ERR (outp))return PTR_ERR (outp);@@ -4241,7 +4242,7 @@ static int nv50_disp_atomic_check(struct drm_device *dev, struct drm_atomic_state *state) { struct nv50_atom *atom = nv50_atom(state); -struct drm_connector_state *connector_state; +struct drm_connector_state *old_connector_state, *new_connector_state;struct drm_connector *connector;int ret, i;@@ -4249,12 +4250,12 @@ nv50_disp_atomic_check(struct drm_device *dev, struct drm_atomic_state *state)if (ret)return ret; -for_each_connector_in_state (state, connector, connector_state, i) { - ret =nv50_disp_outp_atomic_check_clr (atom, connector); +for_each_oldnew_connector_in_state (state, connector, old_connector_state, new_connector_state, i) { + ret =nv50_disp_outp_atomic_check_clr (atom, old_connector_state);if (ret)return ret; - ret =nv50_disp_outp_atomic_check_set (atom, connector_state); + ret =nv50_disp_outp_atomic_check_set (atom, new_connector_state);if (ret)return ret; }Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Maarten Lankhorst
maintainerRe: [PATCH 15/16] drm/nouveau: Convert nouveau to use new iterator macros
Op 13-07-17 om 14:33 schreef Daniel Vetter:
Quoted 157 lines · Maarten Lankhorst
Quoted 156 lines
Use the new atomic iterator macros, the old ones are about to be removed. With the new macros, it's more easy to get old and new state so get them from the macros instead of from
obj->state.Signed-off-by Maarten Lankhorst <[email protected]>Cc Ben Skeggs <[email protected]>--- drivers/gpu/drm/nouveau/nv50_display.c | 71 +++++++++++++++++----------------- 1 file changed, 36 insertions(+), 35 deletions(-)drivers/gpu/drm/nouveau/nv50_display.c +26
-26@@ -2103,7 +2103,7 @@ nv50_head_atomic_check(struct drm_crtc *crtc, struct drm_crtc_state *state)NV_ATOMIC (drm,"%s atomic_check %d\n" , crtc->name, asyh->state.active);if (asyh->state.active) { -for_each_connector_in_state (asyh->state.state, conn, conns, i) { +for_each_new_connector_in_state (asyh->state.state, conn, conns, i) {if (conns->crtc == crtc) { asyc =nouveau_conn_atom (conns);break ;@@ -3904,9 +3904,9 @@ static void nv50_disp_atomic_commit_tail(struct drm_atomic_state *state) {struct drm_device *dev = state->dev; -struct drm_crtc_state *crtc_state; +struct drm_crtc_state *new_crtc_state;struct drm_crtc *crtc; -struct drm_plane_state *plane_state; +struct drm_plane_state *new_plane_state;struct drm_plane *plane;struct nouveau_drm *drm =nouveau_drm (dev);struct nv50_disp *disp =nv50_disp (dev);@@ -3925,8 +3925,8 @@ nv50_disp_atomic_commit_tail(struct drm_atomic_state *state)mutex_lock (&disp->mutex);/* Disable head(s). */ -for_each_crtc_in_state (state, crtc, crtc_state, i) { -struct nv50_head_atom *asyh =nv50_head_atom (crtc->state); +for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) { +struct nv50_head_atom *asyh =nv50_head_atom (new_crtc_state);struct nv50_head *head =nv50_head (crtc); NV_ATOMIC(drm, "%s: clr %04x (set %04x)\n", crtc->name,@@ -3939,8 +3939,8 @@ nv50_disp_atomic_commit_tail(struct drm_atomic_state *state) }/* Disable plane(s). */ -for_each_plane_in_state (state, plane, plane_state, i) { -struct nv50_wndw_atom *asyw =nv50_wndw_atom (plane->state); +for_each_new_plane_in_state (state, plane, new_plane_state, i) { +struct nv50_wndw_atom *asyw =nv50_wndw_atom (new_plane_state);struct nv50_wndw *wndw =nv50_wndw (plane); NV_ATOMIC(drm, "%s: clr %02x (set %02x)\n", plane->name,@@ -4005,8 +4005,8 @@ nv50_disp_atomic_commit_tail(struct drm_atomic_state *state) }/* Update head(s). */ -for_each_crtc_in_state (state, crtc, crtc_state, i) { -struct nv50_head_atom *asyh =nv50_head_atom (crtc->state); +for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) { +struct nv50_head_atom *asyh =nv50_head_atom (new_crtc_state);struct nv50_head *head =nv50_head (crtc); NV_ATOMIC(drm, "%s: set %04x (clr %04x)\n", crtc->name,@@ -4018,14 +4018,14 @@ nv50_disp_atomic_commit_tail(struct drm_atomic_state *state) } } -for_each_crtc_in_state (state, crtc, crtc_state, i) { -if (crtc->state->event) +for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) { +if (new_crtc_state->event)drm_crtc_vblank_get (crtc); }/* Update plane(s). */ -for_each_plane_in_state (state, plane, plane_state, i) { -struct nv50_wndw_atom *asyw =nv50_wndw_atom (plane->state); +for_each_new_plane_in_state (state, plane, new_plane_state, i) { +struct nv50_wndw_atom *asyw =nv50_wndw_atom (new_plane_state);struct nv50_wndw *wndw =nv50_wndw (plane); NV_ATOMIC(drm, "%s: set %02x (clr %02x)\n", plane->name,@@ -4055,23 +4055,23 @@ nv50_disp_atomic_commit_tail(struct drm_atomic_state *state)mutex_unlock (&disp->mutex);/* Wait for HW to signal completion. */ -for_each_plane_in_state (state, plane, plane_state, i) { -struct nv50_wndw_atom *asyw =nv50_wndw_atom (plane->state); +for_each_new_plane_in_state (state, plane, new_plane_state, i) { +struct nv50_wndw_atom *asyw =nv50_wndw_atom (new_plane_state);struct nv50_wndw *wndw =nv50_wndw (plane);int ret =nv50_wndw_wait_armed (wndw, asyw);if (ret)NV_ERROR (drm,"%s: timeout\n" , plane->name); } -for_each_crtc_in_state (state, crtc, crtc_state, i) { -if (crtc->state->event) { +for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) { +if (new_crtc_state->event) {unsigned long flags;/* Get correct count/ts if racing with vblank irq */ drm_crtc_accurate_vblank_count (crtc);spin_lock_irqsave (&crtc->dev->event_lock, flags); -drm_crtc_send_vblank_event (crtc, crtc->state->event); +drm_crtc_send_vblank_event (crtc, new_crtc_state->event);spin_unlock_irqrestore (&crtc->dev->event_lock, flags); - crtc->state->event =NULL ; + new_crtc_state->event =NULL ;drm_crtc_vblank_put (crtc); } }@@ -4096,7 +4096,7 @@ nv50_disp_atomic_commit(struct drm_device *dev, {struct nouveau_drm *drm =nouveau_drm (dev);struct nv50_disp *disp =nv50_disp (dev); -struct drm_plane_state *plane_state; +struct drm_plane_state *old_plane_state;struct drm_plane *plane;struct drm_crtc *crtc;bool active = false;@@ -4122,8 +4122,8 @@ nv50_disp_atomic_commit(struct drm_device *dev, goto done; } -for_each_plane_in_state (state, plane, plane_state, i) { -struct nv50_wndw_atom *asyw =nv50_wndw_atom (plane_state); +for_each_old_plane_in_state (state, plane, old_plane_state, i) { +struct nv50_wndw_atom *asyw =nv50_wndw_atom (old_plane_state);struct nv50_wndw *wndw =nv50_wndw (plane);if (asyw->set.image) { asyw->ntfy.handle = wndw->dmac->sync.handle;@@ -4185,18 +4185,19 @@ nv50_disp_outp_atomic_add(struct nv50_atom *atom, struct drm_encoder *encoder)static int nv50_disp_outp_atomic_check_clr (struct nv50_atom *atom, -struct drm_connector *connector) +struct drm_connector_state *old_connector_state) { -struct drm_encoder *encoder = connector->state->best_encoder; -struct drm_crtc_state *crtc_state; +struct drm_encoder *encoder = old_connector_state->best_encoder; +struct drm_crtc_state *old_crtc_state, *new_crtc_state;struct drm_crtc *crtc;struct nv50_outp_atom *outp; -if (!(crtc = connector->state->crtc)) +if (!(crtc = old_connector_state->crtc))return 0 ;
Quoted 6 lines
drivers/gpu/drm/nouveau/nv50_display.c nv50_disp_outp_atomic_add(struct nv50_atom *atom, struct drm_encoder *encoder) · line 4199
Quoted 4 lines
drivers/gpu/drm/nouveau/nv50_display.c +2
-2- crtc_state =drm_atomic_get_existing_crtc_state (&atom->state, crtc); -if (crtc->state->active &&drm_atomic_crtc_needs_modeset (crtc_state)) { + old_crtc_state =drm_atomic_get_new_crtc_state (&atom->state, crtc); + new_crtc_state =drm_atomic_get_new_crtc_state (&atom->state, crtc);I think you have a mixup here of the crtc states for old and new crtc, both are
get_new_crtc_state.
Ah indeed, thanks for catching. :)
Quoted 54 lines
Otherwise lgtm.
-DanielQuoted 51 lines
drivers/gpu/drm/nouveau/nv50_display.c +8
-7+if (old_crtc_state->active &&drm_atomic_crtc_needs_modeset (new_crtc_state)) { outp =nv50_disp_outp_atomic_add (atom, encoder);if (IS_ERR (outp))return PTR_ERR (outp);@@ -4217,15 +4218,15 @@ nv50_disp_outp_atomic_check_set(struct nv50_atom *atom, struct drm_connector_state *connector_state) {struct drm_encoder *encoder = connector_state->best_encoder; -struct drm_crtc_state *crtc_state; +struct drm_crtc_state *new_crtc_state;struct drm_crtc *crtc;struct nv50_outp_atom *outp;if (!(crtc = connector_state->crtc))return 0 ; - crtc_state =drm_atomic_get_existing_crtc_state (&atom->state, crtc); -if (crtc_state->active &&drm_atomic_crtc_needs_modeset (crtc_state)) { + new_crtc_state =drm_atomic_get_new_crtc_state (&atom->state, crtc); +if (new_crtc_state->active &&drm_atomic_crtc_needs_modeset (new_crtc_state)) { outp =nv50_disp_outp_atomic_add (atom, encoder);if (IS_ERR (outp))return PTR_ERR (outp);@@ -4241,7 +4242,7 @@ static int nv50_disp_atomic_check(struct drm_device *dev, struct drm_atomic_state *state) { struct nv50_atom *atom = nv50_atom(state); -struct drm_connector_state *connector_state; +struct drm_connector_state *old_connector_state, *new_connector_state;struct drm_connector *connector;int ret, i;@@ -4249,12 +4250,12 @@ nv50_disp_atomic_check(struct drm_device *dev, struct drm_atomic_state *state)if (ret)return ret; -for_each_connector_in_state (state, connector, connector_state, i) { - ret =nv50_disp_outp_atomic_check_clr (atom, connector); +for_each_oldnew_connector_in_state (state, connector, old_connector_state, new_connector_state, i) { + ret =nv50_disp_outp_atomic_check_clr (atom, old_connector_state);if (ret)return ret; - ret =nv50_disp_outp_atomic_check_set (atom, connector_state); + ret =nv50_disp_outp_atomic_check_set (atom, new_connector_state);if (ret)return ret; }Signature · 1 line
2.11.0
Quoted 4 lines
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Maarten Lankhorst
maintainerPATCH 16/16 drm/atomic: Remove deprecated accessor macros
In reply to Maarten LankhorstNow that the last users have been converted, we can finally get rid of for_each_obj_in_state, we have better macros to replace them with.
--- include/drm/drm_atomic.h | 75 --------------------------------------------- include/drm/drm_connector.h | 3 +- include/drm/drm_crtc.h | 8 ++--- include/drm/drm_plane.h | 8 ++--- 4 files changed, 9 insertions(+), 85 deletions(-)
include/drm/drm_atomic.h +0 -75
@@ -555,31 +555,6 @@ int __must_check drm_atomic_nonblocking_commit(struct drm_atomic_state *state);void drm_state_dump (struct drm_device *dev,struct drm_printer *p);/** -* for_each_connector_in_state - iterate over all connectors in an atomic update -* @__state: &struct drm_atomic_state pointer -* @connector: &struct drm_connector iteration cursor -* @connector_state: &struct drm_connector_state iteration cursor -* @__i: int iteration cursor, for macro-internal use -* -* This iterates over all connectors in an atomic update. Note that before the -* software state is committed (by calling drm_atomic_helper_swap_state(), this -* points to the new state, while afterwards it points to the old state. Due to -* this tricky confusion this macro is deprecated. -* -* FIXME: -* -* Replace all usage of this with one of the explicit iterators below and then -* remove this macro. -*/ -#define for_each_connector_in_state (__state, connector, connector_state, __i) \ - for ((__i) = 0; \ - (__i) < (__state)->num_connector && \ - ((connector) = (__state)->connectors[__i].ptr, \ - (connector_state) = (__state)->connectors[__i].state, 1); \ - (__i)++) \ - for_each_if (connector) - -/** * for_each_oldnew_connector_in_state - iterate over all connectors in an atomic update * @__state: &struct drm_atomic_state pointer * @connector: &struct drm_connector iteration cursor
@@ -643,31 +618,6 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p);for_each_if (connector)/** -* for_each_crtc_in_state - iterate over all connectors in an atomic update -* @__state: &struct drm_atomic_state pointer -* @crtc: &struct drm_crtc iteration cursor -* @crtc_state: &struct drm_crtc_state iteration cursor -* @__i: int iteration cursor, for macro-internal use -* -* This iterates over all CRTCs in an atomic update. Note that before the -* software state is committed (by calling drm_atomic_helper_swap_state(), this -* points to the new state, while afterwards it points to the old state. Due to -* this tricky confusion this macro is deprecated. -* -* FIXME: -* -* Replace all usage of this with one of the explicit iterators below and then -* remove this macro. - */ -#define for_each_crtc_in_state (__state, crtc, crtc_state, __i) \ - for ((__i) = 0; \ - (__i) < (__state)->dev->mode_config.num_crtc && \ - ((crtc) = (__state)->crtcs[__i].ptr, \ - (crtc_state) = (__state)->crtcs[__i].state, 1); \ - (__i)++) \ - for_each_if (crtc_state) - -/** * for_each_oldnew_crtc_in_state - iterate over all CRTCs in an atomic update * @__state: &struct drm_atomic_state pointer * @crtc: &struct drm_crtc iteration cursor
@@ -727,31 +677,6 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p);for_each_if (crtc)/** -* for_each_plane_in_state - iterate over all planes in an atomic update -* @__state: &struct drm_atomic_state pointer -* @plane: &struct drm_plane iteration cursor -* @plane_state: &struct drm_plane_state iteration cursor -* @__i: int iteration cursor, for macro-internal use -* -* This iterates over all planes in an atomic update. Note that before the -* software state is committed (by calling drm_atomic_helper_swap_state(), this -* points to the new state, while afterwards it points to the old state. Due to -* this tricky confusion this macro is deprecated. -* -* FIXME: -* -* Replace all usage of this with one of the explicit iterators below and then -* remove this macro. - */ -#define for_each_plane_in_state (__state, plane, plane_state, __i) \ - for ((__i) = 0; \ - (__i) < (__state)->dev->mode_config.num_total_plane && \ - ((plane) = (__state)->planes[__i].ptr, \ - (plane_state) = (__state)->planes[__i].state, 1); \ - (__i)++) \ - for_each_if (plane_state) - -/** * for_each_oldnew_plane_in_state - iterate over all planes in an atomic update * @__state: &struct drm_atomic_state pointer * @plane: &struct drm_plane iteration cursor
include/drm/drm_connector.h +1 -2
@@ -858,8 +858,7 @@ struct drm_connector {* This is protected by @drm_mode_config.connection_mutex. Note that * nonblocking atomic commits access the current connector state without * taking locks. Either by going through the &struct drm_atomic_state -* pointers, see for_each_connector_in_state(), -* for_each_oldnew_connector_in_state(), +* pointers, see for_each_oldnew_connector_in_state(), * for_each_old_connector_in_state() and * for_each_new_connector_in_state(). Or through careful ordering of * atomic commit operations as implemented in the atomic helpers, see
include/drm/drm_crtc.h +4 -4
@@ -807,10 +807,10 @@ struct drm_crtc {* This is protected by @mutex. Note that nonblocking atomic commits * access the current CRTC state without taking locks. Either by going * through the &struct drm_atomic_state pointers, see -* for_each_crtc_in_state(), for_each_oldnew_crtc_in_state(), -* for_each_old_crtc_in_state() and for_each_new_crtc_in_state(). Or -* through careful ordering of atomic commit operations as implemented -* in the atomic helpers, see &struct drm_crtc_commit. +* for_each_oldnew_crtc_in_state(), for_each_old_crtc_in_state() and +* for_each_new_crtc_in_state(). Or through careful ordering of atomic +* commit operations as implemented in the atomic helpers, see +* &struct drm_crtc_commit. */ struct drm_crtc_state *state;
include/drm/drm_plane.h +4 -4
@@ -514,10 +514,10 @@ struct drm_plane {* This is protected by @mutex. Note that nonblocking atomic commits * access the current plane state without taking locks. Either by going * through the &struct drm_atomic_state pointers, see -* for_each_plane_in_state(), for_each_oldnew_plane_in_state(), -* for_each_old_plane_in_state() and for_each_new_plane_in_state(). Or -* through careful ordering of atomic commit operations as implemented -* in the atomic helpers, see &struct drm_crtc_commit. +* for_each_oldnew_plane_in_state(), for_each_old_plane_in_state() and +* for_each_new_plane_in_state(). Or through careful ordering of atomic +* commit operations as implemented in the atomic helpers, see +* &struct drm_crtc_commit. */ struct drm_plane_state *state;
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 16/16] drm/atomic: Remove deprecated accessor macros
Quoted 8 lines · Maarten Lankhorst
Now that the last users have been converted, we can finally get rid of
for_each_obj_in_state, we have better macros to replace them with.Signed-off-by Maarten Lankhorst <[email protected]>Cc Daniel Vetter <[email protected]>Cc Jani Nikula <[email protected]>Cc Sean Paul <[email protected]>Cc David Airlie <[email protected]>
Lgtm, but please make sure you do compile test with all three drm-misc defconfigs. Two of the patches looked like they didn't see a compiler, so there might be more lurking.
-Daniel
Quoted 166 lines
--- include/drm/drm_atomic.h | 75 --------------------------------------------- include/drm/drm_connector.h | 3 +- include/drm/drm_crtc.h | 8 ++--- include/drm/drm_plane.h | 8 ++--- 4 files changed, 9 insertions(+), 85 deletions(-)include/drm/drm_atomic.h +0
-75@@ -555,31 +555,6 @@ int __must_check drm_atomic_nonblocking_commit(struct drm_atomic_state *state);void drm_state_dump (struct drm_device *dev,struct drm_printer *p);/** -* for_each_connector_in_state - iterate over all connectors in an atomic update -* @__state: &struct drm_atomic_state pointer -* @connector: &struct drm_connector iteration cursor -* @connector_state: &struct drm_connector_state iteration cursor -* @__i: int iteration cursor, for macro-internal use -* -* This iterates over all connectors in an atomic update. Note that before the -* software state is committed (by calling drm_atomic_helper_swap_state(), this -* points to the new state, while afterwards it points to the old state. Due to -* this tricky confusion this macro is deprecated. -* -* FIXME: -* -* Replace all usage of this with one of the explicit iterators below and then -* remove this macro. -*/ -#define for_each_connector_in_state (__state, connector, connector_state, __i) \ - for ((__i) = 0; \ - (__i) < (__state)->num_connector && \ - ((connector) = (__state)->connectors[__i].ptr, \ - (connector_state) = (__state)->connectors[__i].state, 1); \ - (__i)++) \ - for_each_if (connector) - -/** * for_each_oldnew_connector_in_state - iterate over all connectors in an atomic update * @__state: &struct drm_atomic_state pointer * @connector: &struct drm_connector iteration cursor @@ -643,31 +618,6 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p);for_each_if (connector)/** -* for_each_crtc_in_state - iterate over all connectors in an atomic update -* @__state: &struct drm_atomic_state pointer -* @crtc: &struct drm_crtc iteration cursor -* @crtc_state: &struct drm_crtc_state iteration cursor -* @__i: int iteration cursor, for macro-internal use -* -* This iterates over all CRTCs in an atomic update. Note that before the -* software state is committed (by calling drm_atomic_helper_swap_state(), this -* points to the new state, while afterwards it points to the old state. Due to -* this tricky confusion this macro is deprecated. -* -* FIXME: -* -* Replace all usage of this with one of the explicit iterators below and then -* remove this macro. - */ -#define for_each_crtc_in_state (__state, crtc, crtc_state, __i) \ - for ((__i) = 0; \ - (__i) < (__state)->dev->mode_config.num_crtc && \ - ((crtc) = (__state)->crtcs[__i].ptr, \ - (crtc_state) = (__state)->crtcs[__i].state, 1); \ - (__i)++) \ - for_each_if (crtc_state) - -/** * for_each_oldnew_crtc_in_state - iterate over all CRTCs in an atomic update * @__state: &struct drm_atomic_state pointer * @crtc: &struct drm_crtc iteration cursor @@ -727,31 +677,6 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p);for_each_if (crtc)/** -* for_each_plane_in_state - iterate over all planes in an atomic update -* @__state: &struct drm_atomic_state pointer -* @plane: &struct drm_plane iteration cursor -* @plane_state: &struct drm_plane_state iteration cursor -* @__i: int iteration cursor, for macro-internal use -* -* This iterates over all planes in an atomic update. Note that before the -* software state is committed (by calling drm_atomic_helper_swap_state(), this -* points to the new state, while afterwards it points to the old state. Due to -* this tricky confusion this macro is deprecated. -* -* FIXME: -* -* Replace all usage of this with one of the explicit iterators below and then -* remove this macro. - */ -#define for_each_plane_in_state (__state, plane, plane_state, __i) \ - for ((__i) = 0; \ - (__i) < (__state)->dev->mode_config.num_total_plane && \ - ((plane) = (__state)->planes[__i].ptr, \ - (plane_state) = (__state)->planes[__i].state, 1); \ - (__i)++) \ - for_each_if (plane_state) - -/** * for_each_oldnew_plane_in_state - iterate over all planes in an atomic update * @__state: &struct drm_atomic_state pointer * @plane: &struct drm_plane iteration cursor include/drm/drm_connector.h +1
-2@@ -858,8 +858,7 @@ struct drm_connector {* This is protected by @drm_mode_config.connection_mutex. Note that * nonblocking atomic commits access the current connector state without * taking locks. Either by going through the &struct drm_atomic_state -* pointers, see for_each_connector_in_state(), -* for_each_oldnew_connector_in_state(), +* pointers, see for_each_oldnew_connector_in_state(), * for_each_old_connector_in_state() and * for_each_new_connector_in_state(). Or through careful ordering of * atomic commit operations as implemented in the atomic helpers, see include/drm/drm_crtc.h +4
-4@@ -807,10 +807,10 @@ struct drm_crtc {* This is protected by @mutex. Note that nonblocking atomic commits * access the current CRTC state without taking locks. Either by going * through the &struct drm_atomic_state pointers, see -* for_each_crtc_in_state(), for_each_oldnew_crtc_in_state(), -* for_each_old_crtc_in_state() and for_each_new_crtc_in_state(). Or -* through careful ordering of atomic commit operations as implemented -* in the atomic helpers, see &struct drm_crtc_commit. +* for_each_oldnew_crtc_in_state(), for_each_old_crtc_in_state() and +* for_each_new_crtc_in_state(). Or through careful ordering of atomic +* commit operations as implemented in the atomic helpers, see +* &struct drm_crtc_commit. */ struct drm_crtc_state *state;include/drm/drm_plane.h +4
-4@@ -514,10 +514,10 @@ struct drm_plane {* This is protected by @mutex. Note that nonblocking atomic commits * access the current plane state without taking locks. Either by going * through the &struct drm_atomic_state pointers, see -* for_each_plane_in_state(), for_each_oldnew_plane_in_state(), -* for_each_old_plane_in_state() and for_each_new_plane_in_state(). Or -* through careful ordering of atomic commit operations as implemented -* in the atomic helpers, see &struct drm_crtc_commit. +* for_each_oldnew_plane_in_state(), for_each_old_plane_in_state() and +* for_each_new_plane_in_state(). Or through careful ordering of atomic +* commit operations as implemented in the atomic helpers, see +* &struct drm_crtc_commit. */ struct drm_plane_state *state;Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Maarten Lankhorst
maintainerRe: [PATCH 16/16] drm/atomic: Remove deprecated accessor macros
Op 12-07-17 om 11:50 schreef Daniel Vetter:
Quoted 12 lines · Maarten Lankhorst
Quoted 8 lines
Now that the last users have been converted, we can finally get rid of
for_each_obj_in_state, we have better macros to replace them with.Signed-off-by Maarten Lankhorst <[email protected]>Cc Daniel Vetter <[email protected]>Cc Jani Nikula <[email protected]>Cc Sean Paul <[email protected]>Cc David Airlie <[email protected]>Lgtm, but please make sure you do compile test with all three drm-misc defconfigs. Two of the patches looked like they didn't see a compiler, so there might be more lurking.
Tested with all 3 configs, seems to compile now. :)
_______________________________________________
Intel-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for drm/atomic: Remove deprecated atomic iterator macros.
In reply to Maarten Lankhorst== Series Details ==
== Series Details ==
Series: drm/atomic: Remove deprecated atomic iterator macros.
URL : https://patchwork.freedesktop.org/series/27167/
State : success
== Summary ==
Series 27167v1 drm/atomic: Remove deprecated atomic iterator macros.
https://patchwork.freedesktop.org/api/1.0/series/27167/revisions/1/mbox/
Test kms_pipe_crc_basic:
Subgroup hang-read-crc-pipe-b:
dmesg-warn -> PASS (fi-pnv-d510) fdo#101597
Subgroup suspend-read-crc-pipe-b:
dmesg-warn -> PASS (fi-byt-n2820) fdo#101705fdo#101597 https://bugs.freedesktop.org/show_bug.cgi?id=101597
fdo#101705 https://bugs.freedesktop.org/show_bug.cgi?id=101705
fi-bdw-5557u total:279 pass:268 dwarn:0 dfail:0 fail:0 skip:11 time:442s fi-bdw-gvtdvm total:279 pass:265 dwarn:0 dfail:0 fail:0 skip:14 time:428s fi-blb-e6850 total:279 pass:224 dwarn:1 dfail:0 fail:0 skip:54 time:360s fi-bsw-n3050 total:279 pass:243 dwarn:0 dfail:0 fail:0 skip:36 time:539s fi-bxt-j4205 total:279 pass:260 dwarn:0 dfail:0 fail:0 skip:19 time:505s fi-byt-j1900 total:279 pass:254 dwarn:1 dfail:0 fail:0 skip:24 time:477s fi-byt-n2820 total:279 pass:251 dwarn:0 dfail:0 fail:0 skip:28 time:487s fi-glk-2a total:279 pass:260 dwarn:0 dfail:0 fail:0 skip:19 time:598s fi-hsw-4770 total:279 pass:263 dwarn:0 dfail:0 fail:0 skip:16 time:431s fi-hsw-4770r total:279 pass:263 dwarn:0 dfail:0 fail:0 skip:16 time:414s fi-ilk-650 total:279 pass:229 dwarn:0 dfail:0 fail:0 skip:50 time:415s fi-ivb-3520m total:279 pass:261 dwarn:0 dfail:0 fail:0 skip:18 time:501s fi-ivb-3770 total:279 pass:261 dwarn:0 dfail:0 fail:0 skip:18 time:467s fi-kbl-7500u total:279 pass:261 dwarn:0 dfail:0 fail:0 skip:18 time:462s fi-kbl-7560u total:279 pass:269 dwarn:0 dfail:0 fail:0 skip:10 time:572s fi-kbl-r total:279 pass:260 dwarn:1 dfail:0 fail:0 skip:18 time:576s fi-pnv-d510 total:279 pass:223 dwarn:1 dfail:0 fail:0 skip:55 time:561s fi-skl-6260u total:279 pass:269 dwarn:0 dfail:0 fail:0 skip:10 time:461s fi-skl-6700hq total:279 pass:262 dwarn:0 dfail:0 fail:0 skip:17 time:590s fi-skl-6700k total:279 pass:257 dwarn:4 dfail:0 fail:0 skip:18 time:471s fi-skl-6770hq total:279 pass:269 dwarn:0 dfail:0 fail:0 skip:10 time:471s fi-skl-gvtdvm total:279 pass:266 dwarn:0 dfail:0 fail:0 skip:13 time:436s fi-skl-x1585l total:279 pass:269 dwarn:0 dfail:0 fail:0 skip:10 time:487s fi-snb-2520m total:279 pass:251 dwarn:0 dfail:0 fail:0 skip:28 time:539s fi-snb-2600 total:279 pass:250 dwarn:0 dfail:0 fail:0 skip:29 time:401s
8ad9e19aafea47c272163c2cbf554e06ff7f9857 drm-tip: 2017y-07m-11d-19h-08m-20s UTC integration manifest 22b3ac7 drm/atomic: Remove deprecated accessor macros
a19a1ab drm/nouveau: Convert nouveau to use new iterator macros
e091ae9 drm/msm: Convert to use new iterator macros
370f2d6 drm/mediatek: Convert to new iterator macros
79eb2eb drm/imx: Use atomic iterator macros
82c6cee drm/mali: Use new atomic iterator macros
6cd575f drm/omapdrm: Fix omap_atomic_wait_for_completion
d83e858 drm/rockchip: Use for_each_oldnew_plane_in_state in vop_crtc_atomic_flush 2932a08 drm/atmel-hlcdec: Use for_each_new_connector_in_state
d1d8e27 drm/rcar-du: Use new iterator macros
490b345 drm/i915: Use correct iterator macro
656329b drm/vmwgfx: Make check_modeset() use the new atomic iterator macros.
3e42258 drm/atomic: Use new iterator macros in drm_atomic_helper_wait_for_flip_done 641dc6d drm/atomic: Use the new helpers in drm_atomic_helper_disable_all()
bbfc4ec drm/atomic: Use the correct iterator macro in atomic_remove_fb
a495fa3 drm/simple-kms-helper: Fix the check for the mismatch between plane and CRTC enabled.
== Logs ==
For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_5171/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx