public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Damien Lespiau <damien.lespiau@intel.com>,
	Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Fix divide by zero on watermark	update
Date: Wed, 12 Aug 2015 17:26:59 +0300	[thread overview]
Message-ID: <87zj1wshu4.fsf@intel.com> (raw)
In-Reply-To: <20150716164417.GF26643@strange.ger.corp.intel.com>

On Thu, 16 Jul 2015, Damien Lespiau <damien.lespiau@intel.com> wrote:
> On Thu, Jul 16, 2015 at 07:36:51PM +0300, Mika Kuoppala wrote:
>> Fix divide by zero if we end up updating the watermarks
>> with zero dotclock.
>> 
>> This is a stop gap measure to allow module load in cases
>> where our state keeping fails.
>> 
>> v2: WARN_ON added (Paulo)
>> 
>> Cc: Paulo Zanoni <przanoni@gmail.com>
>> Cc: Damien Lespiau <damien.lespiau@intel.com>
>> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
>
> I want to say a loading module is more important than a proper fix, so:

Any ideas on the proper fix? Patches on the list, sketches on a post-it,
anything? I've got a machine here hitting this.

BR,
Jani.


>
> Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
>
> -- 
> Damien
>
>> ---
>>  drivers/gpu/drm/i915/intel_pm.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
>> index 5eeddc9..0d3e014 100644
>> --- a/drivers/gpu/drm/i915/intel_pm.c
>> +++ b/drivers/gpu/drm/i915/intel_pm.c
>> @@ -3316,8 +3316,10 @@ skl_compute_linetime_wm(struct drm_crtc *crtc, struct skl_pipe_wm_parameters *p)
>>  	if (!to_intel_crtc(crtc)->active)
>>  		return 0;
>>  
>> -	return DIV_ROUND_UP(8 * p->pipe_htotal * 1000, p->pixel_rate);
>> +	if (WARN_ON(p->pixel_rate == 0))
>> +		return 0;
>>  
>> +	return DIV_ROUND_UP(8 * p->pipe_htotal * 1000, p->pixel_rate);
>>  }
>>  
>>  static void skl_compute_transition_wm(struct drm_crtc *crtc,
>> -- 
>> 2.1.4
>> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

      parent reply	other threads:[~2015-08-12 14:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-16 16:00 [PATCH] drm/i915: Fix divide by zero on watermark update Mika Kuoppala
2015-07-16 16:07 ` Paulo Zanoni
2015-07-16 16:36   ` Mika Kuoppala
2015-07-16 16:43     ` Paulo Zanoni
2015-07-17  7:10       ` Daniel Vetter
2015-07-16 16:44     ` Damien Lespiau
2015-07-16 17:26       ` Damien Lespiau
2015-08-12 14:26       ` Jani Nikula [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zj1wshu4.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=damien.lespiau@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=mika.kuoppala@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox