2014-07-29 7:22 GMT-03:00 Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>: > On Mon, Jul 28, 2014 at 03:37:12PM -0300, Paulo Zanoni wrote: >> From: Paulo Zanoni <paulo.r.zanoni@xxxxxxxxx> >> >> If we're runtime suspended and try to use the cursor interfaces, we >> will get a lot of WARNs saying we did the wrong thing. >> >> For intel_crtc_update_cursor(), all we need to do is return if the >> CRTC is not active, since writing the registers won't really have any >> effect if the screen is not visible, and we will write the registers >> later when enabling the screen. >> >> For intel_crtc_cursor_set_obj(), we just need to wake up the hardware >> then pinning the display plane. >> >> v2: - Narrow the put/get calls on intel_crtc_cursor_set_obj() (Daniel) >> >> Testcase: igt/pm_rpm/cursor >> Testcase: igt/pm_rpm/cursor-dpms >> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81645 >> Cc: stable@xxxxxxxxxxxxxxx >> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@xxxxxxxxx> >> --- >> drivers/gpu/drm/i915/intel_display.c | 5 +++++ >> 1 file changed, 5 insertions(+) >> >> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c >> index 1edfd1a..f1a9b5c 100644 >> --- a/drivers/gpu/drm/i915/intel_display.c >> +++ b/drivers/gpu/drm/i915/intel_display.c >> @@ -8144,6 +8144,9 @@ static void intel_crtc_update_cursor(struct drm_crtc *crtc, >> if (base == 0 && intel_crtc->cursor_base == 0) >> return; >> >> + if (!intel_crtc->active) >> + return; >> + >> I915_WRITE(CURPOS(pipe), pos); >> >> if (IS_IVYBRIDGE(dev) || IS_HASWELL(dev) || IS_BROADWELL(dev)) >> @@ -8217,7 +8220,9 @@ static int intel_crtc_cursor_set_obj(struct drm_crtc *crtc, >> if (need_vtd_wa(dev)) >> alignment = 64*1024; >> >> + intel_runtime_pm_get(dev_priv); >> ret = i915_gem_object_pin_to_display_plane(obj, alignment, NULL); >> + intel_runtime_pm_put(dev_priv); > > put_fence() would need runtime pm too I think. This is exactly why I wanted the get/put calls around everything on those functions... I'll see if I can reproduce this on the test suite too. > >> if (ret) { >> DRM_DEBUG_KMS("failed to move cursor bo into the GTT\n"); >> goto fail_locked; >> -- >> 2.0.1 >> >> _______________________________________________ >> Intel-gfx mailing list >> Intel-gfx@xxxxxxxxxxxxxxxxxxxxx >> http://lists.freedesktop.org/mailman/listinfo/intel-gfx > > -- > Ville Syrjälä > Intel OTC -- Paulo Zanoni _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/intel-gfx