]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: push crtc->fb update into pipe_set_base
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 5 Jul 2012 20:51:56 +0000 (22:51 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 6 Sep 2012 06:03:10 +0000 (08:03 +0200)
commit670f675f5b1dcd52c74f32c822c6f301f04fd6c3
treeb35aebdf6bf472532d5223b0731b5f6daad49850
parente9e6ab48e9208d28aad8ebf77f5892684d5d8abe
drm/i915: push crtc->fb update into pipe_set_base

Passing in the old fb, having overwritten the current fb, leads to
some neatly convoluted code. It's much simpler if we defer the
crtc->fb update to the place that updates the hw, in pipe_set_base.
This way we also don't need to restore anything in case something
fails - we only update crtc->fb once things have succeeded.

The real reason for this change is that now we keep the old fb
assigned to crtc->fb, which allows us to finally move the crtc disable
case into the common low-level set_mode function in the next patch.

Also don't clobber crtc->x and crtc->y, we neatly pass these down the
callchain already. Unfortunately we can't do the same with crtc->mode,
because that one is being used in the mode_set callbacks.

v2: Don't restore the drm_crtc object any more on failed modesets,
since we've lose an fb reference otherwise. Also (and this is the
reason this has been found), this totally confused the modeset state
tracking, since it clobbers crtc->enabled. Issue reported by Paulo
Zanoni.

v3: Rip out the entire crtc saving into struct intel_set_config, not
just the restoring part.

Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_drv.h