drm/i915: Add a more detailed comment about the set_base() fastboot hack
Subsystems (2)
PATCH 1/2 drm/i915: Add a more detailed comment about the set_base() fastboot hack
Instead of it just being on the mailing list, let's put Jesse's explanation next to the code in question.
--- drivers/gpu/drm/i915/intel_display.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_display.c +13 -1
@@ -2286,7 +2286,19 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,return ret; } -/* Update pipe size and adjust fitter if needed */ +/* +* Update pipe size and adjust fitter if needed: the reason for this is +* that in compute_mode_changes we check the native mode (not the pfit +* mode) to see if we can flip rather than do a full mode set. In the +* fastboot case, we'll flip, but if we don't update the pipesrc and +* pfit state, we'll end up with a big fb scanned out into the wrong +* sized surface. +* +* To fix this properly, we need to hoist the checks up into +* compute_mode_changes (or above), check the actual pfit state and +* whether the platform allows pfit disable with pipe active, and only +* then update the pipesrc and pfit state, even on the flip path. +*/ if (i915_fastboot) { I915_WRITE(PIPESRC(intel_crtc->pipe), ((crtc->mode.hdisplay - 1) << 16) |
Signature · 1 line
1.8.3.1
PATCH 2/2 drm/i915: Use adjusted_mode in the fastboot hack to disable pfit
When booting with i915.fastboot=1, we always take tha code path and end up undoing what we're trying to do with adjusted_mode.
Hopefully, as the fastboot hardware readout code is using adjusted_mode as well, it should be equivalent.
--- drivers/gpu/drm/i915/intel_display.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_display.c +5 -2
@@ -2300,9 +2300,12 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,* then update the pipesrc and pfit state, even on the flip path. */ if (i915_fastboot) { +const struct drm_display_mode *adjusted_mode = + &intel_crtc->config.adjusted_mode; +I915_WRITE (PIPESRC (intel_crtc->pipe), - ((crtc->mode.hdisplay -1 ) <<16 ) | - (crtc->mode.vdisplay -1 )); + ((adjusted_mode->crtc_hdisplay -1 ) <<16 ) | + (adjusted_mode->crtc_vdisplay -1 ));if (!intel_crtc->config.pch_pfit.enabled && (intel_pipe_has_type (crtc,INTEL_OUTPUT_LVDS ) ||intel_pipe_has_type (crtc,INTEL_OUTPUT_EDP ))) {
Signature · 1 line
1.8.3.1
Re: [PATCH 2/2] drm/i915: Use adjusted_mode in the fastboot hack to disable pfit
Quoted 7 lines · Damien Lespiau
When booting with i915.fastboot=1, we always take tha code path and end up undoing what we're trying to do with
adjusted_mode.Hopefully, as the fastboot hardware readout code is using
adjusted_modeas well, it should be equivalent.Signed-off-by Damien Lespiau <[email protected]>
Both patches merged to dinq.
<maintainer-rant>
I'd prefer if patch authors take a more proactive role in signing people up for review. And that the domain experts (Jesse here for fastboot) have a look-out on the m-l for relevant small patches and slap their review onto them without me needing to poke people all the time ... </maintainer-rant>
Cheers, Daniel
Quoted 30 lines
--- drivers/gpu/drm/i915/intel_display.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)drivers/gpu/drm/i915/intel_display.c +5
-2@@ -2300,9 +2300,12 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,* then update the pipesrc and pfit state, even on the flip path. */ if (i915_fastboot) { +const struct drm_display_mode *adjusted_mode = + &intel_crtc->config.adjusted_mode; +I915_WRITE (PIPESRC (intel_crtc->pipe), - ((crtc->mode.hdisplay -1 ) <<16 ) | - (crtc->mode.vdisplay -1 )); + ((adjusted_mode->crtc_hdisplay -1 ) <<16 ) | + (adjusted_mode->crtc_vdisplay -1 ));if (!intel_crtc->config.pch_pfit.enabled && (intel_pipe_has_type (crtc,INTEL_OUTPUT_LVDS ) ||intel_pipe_has_type (crtc,INTEL_OUTPUT_EDP ))) {Signature · 6 lines
1.8.3.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch