Commit 833cd78a authored by Daniel Vetter's avatar Daniel Vetter

drm/vc4: Use for_each_plane_in_state

We want to hide drm_atomic_stat internals a bit better.

Cc: Eric Anholt <eric@anholt.net>
Reviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1464818821-5736-6-git-send-email-daniel.vetter@ffwll.ch
parent 09ad807b
...@@ -111,6 +111,8 @@ static int vc4_atomic_commit(struct drm_device *dev, ...@@ -111,6 +111,8 @@ static int vc4_atomic_commit(struct drm_device *dev,
int i; int i;
uint64_t wait_seqno = 0; uint64_t wait_seqno = 0;
struct vc4_commit *c; struct vc4_commit *c;
struct drm_plane *plane;
struct drm_plane_state *new_state;
c = commit_init(state); c = commit_init(state);
if (!c) if (!c)
...@@ -130,13 +132,7 @@ static int vc4_atomic_commit(struct drm_device *dev, ...@@ -130,13 +132,7 @@ static int vc4_atomic_commit(struct drm_device *dev,
return ret; return ret;
} }
for (i = 0; i < dev->mode_config.num_total_plane; i++) { for_each_plane_in_state(state, plane, new_state, i) {
struct drm_plane *plane = state->planes[i];
struct drm_plane_state *new_state = state->plane_states[i];
if (!plane)
continue;
if ((plane->state->fb != new_state->fb) && new_state->fb) { if ((plane->state->fb != new_state->fb) && new_state->fb) {
struct drm_gem_cma_object *cma_bo = struct drm_gem_cma_object *cma_bo =
drm_fb_cma_get_gem_obj(new_state->fb, 0); drm_fb_cma_get_gem_obj(new_state->fb, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment