Skip to content

Commit

Permalink
drm/msm: atomic fixes
Browse files Browse the repository at this point in the history
Fixes for a couple little issues found in testing.

Signed-off-by: Rob Clark <robdclark@gmail.com>
  • Loading branch information
Rob Clark committed Nov 21, 2014
1 parent 32c0e3e commit 3e2f29e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/msm/msm_atomic.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ int msm_atomic_commit(struct drm_device *dev,
if (!plane)
continue;

if (plane->state->fb != new_state->fb)
if ((plane->state->fb != new_state->fb) && new_state->fb)
add_fb(c, new_state->fb);
}

Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/msm/msm_fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ void msm_framebuffer_cleanup(struct drm_framebuffer *fb, int id)
uint32_t msm_framebuffer_iova(struct drm_framebuffer *fb, int id, int plane)
{
struct msm_framebuffer *msm_fb = to_msm_framebuffer(fb);
if (!msm_fb->planes[plane])
return 0;
return msm_gem_iova(msm_fb->planes[plane], id);
}

Expand Down
7 changes: 6 additions & 1 deletion drivers/gpu/drm/msm/msm_kms.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ struct msm_kms *mdp5_kms_init(struct drm_device *dev);
/* TODO move these helper iterator macro somewhere common: */
#define for_each_plane_on_crtc(_crtc, _plane) \
list_for_each_entry((_plane), &(_crtc)->dev->mode_config.plane_list, head) \
if ((_plane)->crtc == (_crtc))
if ((_plane)->state->crtc == (_crtc))

#define for_each_pending_plane_on_crtc(_state, _crtc, _plane) \
list_for_each_entry((_plane), &(_crtc)->dev->mode_config.plane_list, head) \
if (({struct drm_plane_state *_ps = (_state)->plane_states[drm_plane_index(_plane)]; \
_ps && _ps->crtc == (_crtc);}))

#endif /* __MSM_KMS_H__ */

0 comments on commit 3e2f29e

Please sign in to comment.