Re: [PATCH 09/16] drm/rockchip: Use for_each_oldnew_plane_in_state in vop_crtc_atomic_flush

2017-07-12 Thread Mark yao

On 2017年07月12日 16:13, Maarten Lankhorst wrote:

for_each_obj_in_state is about to be removed, so use the new atomic
iterator macros.

Signed-off-by: Maarten Lankhorst
Cc: Mark Yao
Cc: Heiko Stuebner
Cc:linux-arm-ker...@lists.infradead.org
Cc:linux-rockc...@lists.infradead.org


Looks good for me:

Acked-by: Mark Yao 

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 09/16] drm/rockchip: Use for_each_oldnew_plane_in_state in vop_crtc_atomic_flush

2017-07-12 Thread Daniel Vetter
On Wed, Jul 12, 2017 at 10:13:37AM +0200, Maarten Lankhorst wrote:
> for_each_obj_in_state is about to be removed, so use the new atomic
> iterator macros.
> 
> Signed-off-by: Maarten Lankhorst 
> Cc: Mark Yao 
> Cc: Heiko Stuebner 
> Cc: linux-arm-ker...@lists.infradead.org
> Cc: linux-rockc...@lists.infradead.org
> ---
>  drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 7 ---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c 
> b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> index ee876a9631f0..f90088b1a247 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> @@ -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(>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;

This entire machinery here seems to be the perfect candidate for Boris'
wait_for_flip_done work.

Patch itself looks good.

Reviewed-by: Daniel Vetter 
>  
>   drm_framebuffer_reference(old_plane_state->fb);
> -- 
> 2.11.0
> 
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 09/16] drm/rockchip: Use for_each_oldnew_plane_in_state in vop_crtc_atomic_flush

2017-07-12 Thread Maarten Lankhorst
for_each_obj_in_state is about to be removed, so use the new atomic
iterator macros.

Signed-off-by: Maarten Lankhorst 
Cc: Mark Yao 
Cc: Heiko Stuebner 
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-rockc...@lists.infradead.org
---
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c 
b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
index ee876a9631f0..f90088b1a247 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
@@ -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(>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);
-- 
2.11.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel