diff options
author | Rob Clark <robdclark@gmail.com> | 2014-11-19 12:29:33 -0500 |
---|---|---|
committer | Rob Clark <robdclark@gmail.com> | 2014-11-21 08:57:22 -0500 |
commit | 3e2f29e4137c78a3bd7e1b85cf287ff375f6367e (patch) | |
tree | c2c827f1ef39695cd1e62f57cb6fa08161d9962a /drivers/gpu/drm/msm | |
parent | 32c0e3e24c885ffeecb6d3a67ecb607b8fe63129 (diff) |
drm/msm: atomic fixes
Fixes for a couple little issues found in testing.
Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/msm')
-rw-r--r-- | drivers/gpu/drm/msm/msm_atomic.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/msm_fb.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/msm_kms.h | 7 |
3 files changed, 9 insertions, 2 deletions
diff --git a/drivers/gpu/drm/msm/msm_atomic.c b/drivers/gpu/drm/msm/msm_atomic.c index 8cf3361daba3..f0de412e13dc 100644 --- a/drivers/gpu/drm/msm/msm_atomic.c +++ b/drivers/gpu/drm/msm/msm_atomic.c @@ -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); } diff --git a/drivers/gpu/drm/msm/msm_fb.c b/drivers/gpu/drm/msm/msm_fb.c index f4e42d506ff7..84dec161d836 100644 --- a/drivers/gpu/drm/msm/msm_fb.c +++ b/drivers/gpu/drm/msm/msm_fb.c @@ -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); } diff --git a/drivers/gpu/drm/msm/msm_kms.h b/drivers/gpu/drm/msm/msm_kms.h index 15a0fec99c70..1e9d8c2e6a5d 100644 --- a/drivers/gpu/drm/msm/msm_kms.h +++ b/drivers/gpu/drm/msm/msm_kms.h @@ -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__ */ |