imx-drm atomic modeset regression fixes

- add active plane reconfiguration support
 - add back crtc vblank state reporting
 -----BEGIN PGP SIGNATURE-----
 
 iQI0BAABCAAeBQJXxSqgFxxwLnphYmVsQHBlbmd1dHJvbml4LmRlAAoJEFDCiBxw
 nmDrbjwQANIMS14i+0WMGEIaXl2WTxrtURf36LgF9vSkKvAnPxOKXgbi53qh3ZXb
 Fh09fTirqqjs+BAfW/dUwSN+hP/9Oz3zHCuOofAtrY1fZuflAb6o552Pxepf98oF
 xkzeduxA12JKjvncDLFgTB76Pm9BiHRgkf5snOFLjOTrYUdjGsVrDFOmH5+CD2z3
 xCiNWZUa3BlaEJ4LPFl5fFdh+tHC44+axhlUTyXNN3SCyw5yOe8N2/bba6T+6k1i
 G5Ylq3sGpfOg4aKEDz8nQ1Tj4CK997tTcUUVT6qcfquH9QkTKq/CNzoqBB7jshdp
 bd1WHyoJmzvclkvuDQjAqHj7pJAQuINU6HFWHzcDScJ3GtoEzhzGacQ7dLkfwXSw
 S/yiNrTsh5SeqF01UHh/UaMxy9tM5qg8uNmlByy7UdU/HWT26cc7CUkcHxIcHT2o
 liS+8SqRtXymKlBas3d0o3jTNkGSEmoZ8sYMlPxLIHncHxOt/BTa7mzhoQiJo680
 lRdwbtTBSyENSmn37MVj7ajMMyVM1ZfHonXw4KjcHuPV+9DAPH3PbMemTrxObJzJ
 s4jyfMW+3p8aSIJedzMhJvYvDi9UXmKzQOjHKkkgarB4l18FPZab53/V3/rPSUHz
 vmVUJ/uQrhr2qacu6k/vtFzZsLKnC/hypVKzx6fxsswp55zXltRN
 =szrV
 -----END PGP SIGNATURE-----

Merge tag 'imx-drm-fixes-2016-08-30' of git://git.pengutronix.de/git/pza/linux into drm-fixes

imx-drm atomic modeset regression fixes

- add active plane reconfiguration support
- add back crtc vblank state reporting

* tag 'imx-drm-fixes-2016-08-30' of git://git.pengutronix.de/git/pza/linux:
  drm/imx: fix crtc vblank state regression
  drm/imx: Add active plane reconfiguration support
This commit is contained in:
Dave Airlie 2016-09-02 15:48:38 +10:00
commit 5322942527
3 changed files with 43 additions and 8 deletions

View File

@ -171,10 +171,34 @@ static void imx_drm_output_poll_changed(struct drm_device *drm)
drm_fbdev_cma_hotplug_event(imxdrm->fbhelper);
}
static int imx_drm_atomic_check(struct drm_device *dev,
struct drm_atomic_state *state)
{
int ret;
ret = drm_atomic_helper_check_modeset(dev, state);
if (ret)
return ret;
ret = drm_atomic_helper_check_planes(dev, state);
if (ret)
return ret;
/*
* Check modeset again in case crtc_state->mode_changed is
* updated in plane's ->atomic_check callback.
*/
ret = drm_atomic_helper_check_modeset(dev, state);
if (ret)
return ret;
return ret;
}
static const struct drm_mode_config_funcs imx_drm_mode_config_funcs = {
.fb_create = drm_fb_cma_create,
.output_poll_changed = imx_drm_output_poll_changed,
.atomic_check = drm_atomic_helper_check,
.atomic_check = imx_drm_atomic_check,
.atomic_commit = drm_atomic_helper_commit,
};

View File

@ -76,6 +76,8 @@ static void ipu_crtc_disable(struct drm_crtc *crtc)
crtc->state->event = NULL;
}
spin_unlock_irq(&crtc->dev->event_lock);
drm_crtc_vblank_off(crtc);
}
static void imx_drm_crtc_reset(struct drm_crtc *crtc)
@ -175,6 +177,8 @@ static int ipu_crtc_atomic_check(struct drm_crtc *crtc,
static void ipu_crtc_atomic_begin(struct drm_crtc *crtc,
struct drm_crtc_state *old_crtc_state)
{
drm_crtc_vblank_on(crtc);
spin_lock_irq(&crtc->dev->event_lock);
if (crtc->state->event) {
WARN_ON(drm_crtc_vblank_get(crtc));

View File

@ -319,13 +319,14 @@ static int ipu_plane_atomic_check(struct drm_plane *plane,
return -EINVAL;
/*
* since we cannot touch active IDMAC channels, we do not support
* resizing the enabled plane or changing its format
* We support resizing active plane or changing its format by
* forcing CRTC mode change and disabling-enabling plane in plane's
* ->atomic_update callback.
*/
if (old_fb && (state->src_w != old_state->src_w ||
state->src_h != old_state->src_h ||
fb->pixel_format != old_fb->pixel_format))
return -EINVAL;
crtc_state->mode_changed = true;
eba = drm_plane_state_to_eba(state);
@ -336,7 +337,7 @@ static int ipu_plane_atomic_check(struct drm_plane *plane,
return -EINVAL;
if (old_fb && fb->pitches[0] != old_fb->pitches[0])
return -EINVAL;
crtc_state->mode_changed = true;
switch (fb->pixel_format) {
case DRM_FORMAT_YUV420:
@ -372,7 +373,7 @@ static int ipu_plane_atomic_check(struct drm_plane *plane,
return -EINVAL;
if (old_fb && old_fb->pitches[1] != fb->pitches[1])
return -EINVAL;
crtc_state->mode_changed = true;
}
return 0;
@ -392,8 +393,14 @@ static void ipu_plane_atomic_update(struct drm_plane *plane,
enum ipu_color_space ics;
if (old_state->fb) {
ipu_plane_atomic_set_base(ipu_plane, old_state);
return;
struct drm_crtc_state *crtc_state = state->crtc->state;
if (!crtc_state->mode_changed) {
ipu_plane_atomic_set_base(ipu_plane, old_state);
return;
}
ipu_disable_plane(plane);
}
switch (ipu_plane->dp_flow) {