From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Subject: Re: [PATCH 1/3] drm/i915: fix cursor handling when runtime suspended Date: Tue, 29 Jul 2014 13:22:08 +0300 Message-ID: <20140729102208.GU27580@intel.com> References: <1406572636-1809-1-git-send-email-przanoni@gmail.com> <1406572636-1809-2-git-send-email-przanoni@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 3B9BC6E0DC for ; Tue, 29 Jul 2014 03:22:20 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1406572636-1809-2-git-send-email-przanoni@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Paulo Zanoni Cc: intel-gfx@lists.freedesktop.org, Paulo Zanoni , stable@vger.kernel.org List-Id: intel-gfx@lists.freedesktop.org On Mon, Jul 28, 2014 at 03:37:12PM -0300, Paulo Zanoni wrote: > From: Paulo Zanoni > = > 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=3D81645 > Cc: stable@vger.kernel.org > Signed-off-by: Paulo Zanoni > --- > 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_crt= c *crtc, > if (base =3D=3D 0 && intel_crtc->cursor_base =3D=3D 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_crt= c *crtc, > if (need_vtd_wa(dev)) > alignment =3D 64*1024; > = > + intel_runtime_pm_get(dev_priv); > ret =3D 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. > 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@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- = Ville Syrj=E4l=E4 Intel OTC