Skip to contentSkip to conversation

drm/i915: fix fastboot pfit disable hack to update pipe w/h

PATCH In review Jesse Barnes 2 participants 6 messages Dec 19, 2013 – Jan 7, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: fix fastboot pfit disable hack to update pipe w/h

When fastbooting, we read out the pipe timings early on, and then in a panel fitted config, disable the fitter later. But we weren't updating the pipe src h/w, which meant the mouse cursor was clipped to the pfitted size rather than the native size set later. Fix that up so the cursor is visible in the new mode.

---
 drivers/gpu/drm/i915/intel_display.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/i915/intel_display.c +2 -0
index 4d1357a..7e46d75 100644
@@ -2382,6 +2382,8 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
 			I915_WRITE(PF_WIN_POS(intel_crtc->pipe), 0);
 			I915_WRITE(PF_WIN_SZ(intel_crtc->pipe), 0);
 		}
+		intel_crtc->config.pipe_src_w = adjusted_mode->crtc_hdisplay;
+		intel_crtc->config.pipe_src_h = adjusted_mode->crtc_vdisplay;
 	}
 
 	ret = dev_priv->display.update_plane(crtc, fb, x, y);
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 16 lines · On Thu, 19 Dec 2013 10:48:01 -0800 Jesse Barnes <[email protected]>…

When fastbooting, we read out the pipe timings early on, and then in a panel fitted config, disable the fitter later. But we weren't updating the pipe src h/w, which meant the mouse cursor was clipped to the pfitted size rather than the native size set later. Fix that up so the cursor is visible in the new mode.

---
 drivers/gpu/drm/i915/intel_display.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/i915/intel_display.c +0 -0
index 4d1357a..7e46d75 100644

drivers/gpu/drm/i915/intel_display.c intel_pipe_set_base(struct drm_crtc *crtc, int x, int y, · line 2389

Quoted 8 lines
drivers/gpu/drm/i915/intel_display.c +2 -0
@@ -2382,6 +2382,8 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
 			I915_WRITE(PF_WIN_POS(intel_crtc->pipe), 0);
 			I915_WRITE(PF_WIN_SZ(intel_crtc->pipe), 0);
 		}
+		intel_crtc->config.pipe_src_w = adjusted_mode->crtc_hdisplay;
+		intel_crtc->config.pipe_src_h = adjusted_mode->crtc_vdisplay;
 	}
 
 	ret = dev_priv->display.update_plane(crtc, fb, x, y);

References: https://bugzilla.kernel.org/show_bug.cgi?id=67591

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
#2 lore raw
Quoted 26 lines · Jesse Barnes
Quoted 23 lines · On Thu, 19 Dec 2013 10:48:01 -0800 Jesse Barnes <[email protected]>…

When fastbooting, we read out the pipe timings early on, and then in a panel fitted config, disable the fitter later. But we weren't updating the pipe src h/w, which meant the mouse cursor was clipped to the pfitted size rather than the native size set later. Fix that up so the cursor is visible in the new mode.

---
 drivers/gpu/drm/i915/intel_display.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/i915/intel_display.c +2 -0
index 4d1357a..7e46d75 100644
@@ -2382,6 +2382,8 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
                      I915_WRITE(PF_WIN_POS(intel_crtc->pipe), 0);
                      I915_WRITE(PF_WIN_SZ(intel_crtc->pipe), 0);
              }
+             intel_crtc->config.pipe_src_w = adjusted_mode->crtc_hdisplay;
+             intel_crtc->config.pipe_src_h = adjusted_mode->crtc_vdisplay;
      }
 
Quoted 3 lines

drivers/gpu/drm/i915/intel_display.c intel_pipe_set_base(struct drm_crtc *crtc, int x, int y, · line 2389

Quoted 1 line
drivers/gpu/drm/i915/intel_display.c +0 -0
      ret = dev_priv->display.update_plane(crtc, fb, x, y);

References: https://bugzilla.kernel.org/show_bug.cgi?id=67591

The bug report doesn't say anything about the pipe config state checker being unhappy. Are we missing a call to the checker for fastboot somewhere to catch this stuff?
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#3 lore raw
Quoted 27 lines · On Tue, 7 Jan 2014 08:07:13 +0100 Daniel Vetter <[email protected]> wrote:
Quoted 26 lines · Jesse Barnes
Quoted 23 lines · On Thu, 19 Dec 2013 10:48:01 -0800 Jesse Barnes <[email protected]>…

When fastbooting, we read out the pipe timings early on, and then in a panel fitted config, disable the fitter later. But we weren't updating the pipe src h/w, which meant the mouse cursor was clipped to the pfitted size rather than the native size set later. Fix that up so the cursor is visible in the new mode.

---
 drivers/gpu/drm/i915/intel_display.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/i915/intel_display.c +2 -0
index 4d1357a..7e46d75 100644
@@ -2382,6 +2382,8 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
                      I915_WRITE(PF_WIN_POS(intel_crtc->pipe), 0);
                      I915_WRITE(PF_WIN_SZ(intel_crtc->pipe), 0);
              }
+             intel_crtc->config.pipe_src_w = adjusted_mode->crtc_hdisplay;
+             intel_crtc->config.pipe_src_h = adjusted_mode->crtc_vdisplay;
      }
 
Quoted 7 lines
Quoted 3 lines

drivers/gpu/drm/i915/intel_display.c intel_pipe_set_base(struct drm_crtc *crtc, int x, int y, · line 2389

Quoted 1 line
drivers/gpu/drm/i915/intel_display.c +0 -0
      ret = dev_priv->display.update_plane(crtc, fb, x, y);

References: https://bugzilla.kernel.org/show_bug.cgi?id=67591

The bug report doesn't say anything about the pipe config state checker being unhappy. Are we missing a call to the checker for fastboot somewhere to catch this stuff?

Yeah I think so. Cooking up a separate patch for that now...

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
#4 lore raw
In reply to Daniel Vetter
Quoted 27 lines · On Tue, 7 Jan 2014 08:07:13 +0100 Daniel Vetter <[email protected]> wrote:
Quoted 26 lines · Jesse Barnes
Quoted 23 lines · On Thu, 19 Dec 2013 10:48:01 -0800 Jesse Barnes <[email protected]>…

When fastbooting, we read out the pipe timings early on, and then in a panel fitted config, disable the fitter later. But we weren't updating the pipe src h/w, which meant the mouse cursor was clipped to the pfitted size rather than the native size set later. Fix that up so the cursor is visible in the new mode.

---
 drivers/gpu/drm/i915/intel_display.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/i915/intel_display.c +2 -0
index 4d1357a..7e46d75 100644
@@ -2382,6 +2382,8 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
                      I915_WRITE(PF_WIN_POS(intel_crtc->pipe), 0);
                      I915_WRITE(PF_WIN_SZ(intel_crtc->pipe), 0);
              }
+             intel_crtc->config.pipe_src_w = adjusted_mode->crtc_hdisplay;
+             intel_crtc->config.pipe_src_h = adjusted_mode->crtc_vdisplay;
      }
 
Quoted 7 lines
Quoted 3 lines

drivers/gpu/drm/i915/intel_display.c intel_pipe_set_base(struct drm_crtc *crtc, int x, int y, · line 2389

Quoted 1 line
drivers/gpu/drm/i915/intel_display.c +0 -0
      ret = dev_priv->display.update_plane(crtc, fb, x, y);

References: https://bugzilla.kernel.org/show_bug.cgi?id=67591

The bug report doesn't say anything about the pipe config state checker being unhappy. Are we missing a call to the checker for fastboot somewhere to catch this stuff?

Ah no, we do have a check there. I guess since we never updated it we were comparing two stale values?

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
#5 lore raw
Quoted 15 lines · Jesse Barnes
Quoted 15 lines
Quoted 14 lines

drivers/gpu/drm/i915/intel_display.c intel_pipe_set_base(struct drm_crtc *crtc, int x, int y, · line 2389

Quoted 12 lines

index 4d1357a..7e46d75 100644

drivers/gpu/drm/i915/intel_display.c +2 -0
@@ -2382,6 +2382,8 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
                      I915_WRITE(PF_WIN_POS(intel_crtc->pipe), 0);
                      I915_WRITE(PF_WIN_SZ(intel_crtc->pipe), 0);
              }
+             intel_crtc->config.pipe_src_w = adjusted_mode->crtc_hdisplay;
+             intel_crtc->config.pipe_src_h = adjusted_mode->crtc_vdisplay;
      }
 
      ret = dev_priv->display.update_plane(crtc, fb, x, y);

References: https://bugzilla.kernel.org/show_bug.cgi?id=67591

Quoted 6 lines
Quoted 3 lines

The bug report doesn't say anything about the pipe config state checker being unhappy. Are we missing a call to the checker for fastboot somewhere to catch this stuff?

Ah no, we do have a check there. I guess since we never updated it we were comparing two stale values?

The hw values should reflect what we're writing into the PF_WIN_* registers, but the sw side should be stale. I think a dpms on/off should trigger a checker warning, but having one after each fastboot'ed setCrtc might be benefitial in general. I just want to make sure that we don't have more dragons lurking ... -Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch