On Thu, Sep 10, 2015 at 04:08:01PM +0200, Maarten Lankhorst wrote: > This should allow not running plane commit when the crtc is off. > While the atomic helpers update those, crtc->x/y is only updated > during modesets, and primary plane is updated after this function > returns. > > Unfortunately non-atomic watermarks and fbc still depend on this > state inside i915, so it has to be kept in sync. > > Signed-off-by: Maarten Lankhorst <maarten.lankhorst@xxxxxxxxxxxxxxx> > --- > drivers/gpu/drm/i915/intel_display.c | 15 ++++++++------- > 1 file changed, 8 insertions(+), 7 deletions(-) > > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c > index 87c5eba08454..b809ee2a8678 100644 > --- a/drivers/gpu/drm/i915/intel_display.c > +++ b/drivers/gpu/drm/i915/intel_display.c > @@ -12198,6 +12198,14 @@ intel_modeset_update_crtc_state(struct drm_atomic_state *state) > crtc->hwmode = crtc->state->adjusted_mode; > else > crtc->hwmode.crtc_clock = 0; > + > + if (drm_atomic_get_existing_plane_state(state, crtc->primary)) { > + struct drm_plane_state *plane_state = crtc->primary->state; > + > + crtc->primary->fb = plane_state->fb; > + crtc->x = plane_state->src_x >> 16; > + crtc->y = plane_state->src_y >> 16; > + } drm_atomic_helper_update_legacy_modeset_state should do that for us, not? Atm we have an if (any_ms) check for it, but that seems to just be a bug really. -Daniel > } > } > > @@ -13434,15 +13442,8 @@ intel_commit_primary_plane(struct drm_plane *plane, > struct drm_framebuffer *fb = state->base.fb; > struct drm_device *dev = plane->dev; > struct drm_i915_private *dev_priv = dev->dev_private; > - struct intel_crtc *intel_crtc; > - struct drm_rect *src = &state->src; > > crtc = crtc ? crtc : plane->crtc; > - intel_crtc = to_intel_crtc(crtc); > - > - plane->fb = fb; > - crtc->x = src->x1 >> 16; > - crtc->y = src->y1 >> 16; > > if (!crtc->state->active) > return; > -- > 2.1.0 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@xxxxxxxxxxxxxxxxxxxxx > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/intel-gfx