diff mbox

[04/16] drm/atomic: Use new iterator macros in drm_atomic_helper_wait_for_flip_done

Message ID 20170712081344.25495-5-maarten.lankhorst@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Maarten Lankhorst July 12, 2017, 8:13 a.m. UTC
for_each_obj_in_state is about to be removed, so use the correct new
iterator macro.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Sean Paul <seanpaul@chromium.org>
Cc: David Airlie <airlied@linux.ie>
---
 drivers/gpu/drm/drm_atomic_helper.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Daniel Vetter July 12, 2017, 9:07 a.m. UTC | #1
On Wed, Jul 12, 2017 at 10:13:32AM +0200, Maarten Lankhorst wrote:
> for_each_obj_in_state is about to be removed, so use the correct new
> iterator macro.
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Sean Paul <seanpaul@chromium.org>
> Cc: David Airlie <airlied@linux.ie>
> ---
>  drivers/gpu/drm/drm_atomic_helper.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index 391cd887f922..29a8098d3ca7 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -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.

>  		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,

s/crtc->state->state/state/ ... somehow didn't spot that. And maybe split
this hunk here out and Cc: Gustavo.

> +		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:

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> -- 
> 2.11.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 391cd887f922..29a8098d3ca7 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -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;