From: Daniel Vetter Subject: Re: [PATCH v2 15/17] drm/i915: Disable specific watermark levels when latency is zero Date: Mon, 5 Aug 2013 18:31:48 +0200 Message-ID: <20130805163148.GO22035@phenom.ffwll.local> References: <1375363135-20618-1-git-send-email-ville.syrjala@linux.intel.com> <1375363135-20618-16-git-send-email-ville.syrjala@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail-we0-f174.google.com (mail-we0-f174.google.com [74.125.82.174]) by gabe.freedesktop.org (Postfix) with ESMTP id A74BDE7215 for ; Mon, 5 Aug 2013 09:31:41 -0700 (PDT) Received: by mail-we0-f174.google.com with SMTP id q54so2708130wes.33 for ; Mon, 05 Aug 2013 09:31:40 -0700 (PDT) Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Paulo Zanoni Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Fri, Aug 02, 2013 at 11:48:29AM -0300, Paulo Zanoni wrote: > 2013/8/1 : > > From: Ville Syrj=E4l=E4 > > > > Return UINT_MAX for the calculated WM level if the latency is zero. > > This will lead to marking the WM level as disabled. > > > > I'm not sure if latency=3D=3D0 should mean that we want to disable the > > level. But that's the implication I got from the fact that we don't > > even enable the watermark code of the SSKDP register is 0. > > > > v2: Use WARN() to scare people > > > > Signed-off-by: Ville Syrj=E4l=E4 > > --- > > drivers/gpu/drm/i915/intel_pm.c | 6 ++++++ > > 1 file changed, 6 insertions(+) > > > > diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/int= el_pm.c > > index 53967ef..149eb0a 100644 > > --- a/drivers/gpu/drm/i915/intel_pm.c > > +++ b/drivers/gpu/drm/i915/intel_pm.c > > @@ -2116,6 +2116,9 @@ static uint32_t ilk_wm_method1(uint32_t pixel_rat= e, uint8_t bytes_per_pixel, > > { > > uint64_t ret; > > > > + if (WARN(latency =3D=3D 0, "Latency value missing\n")) > = > I know I'm the person who asked to scream loud in case the latency is > zero, but I guess that due to the previous patch we'll already > DRM_ERROR in case the latency is zero, so this WARN will be redundant. > So maybe your previous patch 16/35 would be more adequate. > = > So I'll give a "Reviewed-by: Paulo Zanoni " > to both this and the previous version (16/35), and let you (or Daniel) > decide which one to merge. We have a few other cases where we both DRM_ERROR and then WARN into dmesg, so I'm ok with this one here. -Daniel > = > = > > + return UINT_MAX; > > + > > ret =3D (uint64_t) pixel_rate * bytes_per_pixel * latency; > > ret =3D DIV_ROUND_UP_ULL(ret, 64 * 10000) + 2; > > > > @@ -2128,6 +2131,9 @@ static uint32_t ilk_wm_method2(uint32_t pixel_rat= e, uint32_t pipe_htotal, > > { > > uint32_t ret; > > > > + if (WARN(latency =3D=3D 0, "Latency value missing\n")) > > + return UINT_MAX; > > + > > ret =3D (latency * pixel_rate) / (pipe_htotal * 10000); > > ret =3D (ret + 1) * horiz_pixels * bytes_per_pixel; > > ret =3D DIV_ROUND_UP(ret, 64) + 2; > > -- > > 1.8.1.5 > > > > _______________________________________________ > > Intel-gfx mailing list > > Intel-gfx@lists.freedesktop.org > > http://lists.freedesktop.org/mailman/listinfo/intel-gfx > = > = > = > -- = > Paulo Zanoni > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- = Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch