From: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
To: Daniel Stone <daniel@fooishbar.org>
Cc: Gustavo Padovan <gustavo@padovan.org>,
linux-samsung-soc <linux-samsung-soc@vger.kernel.org>,
dri-devel <dri-devel@lists.freedesktop.org>,
InKi Dae <inki.dae@samsung.com>,
Joonyoung Shim <jy0922.shim@samsung.com>,
Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Subject: Re: [PATCH 2/2] drm/exynos: WARN_ON if ideal_clk is zero
Date: Wed, 20 May 2015 18:31:00 +0200 [thread overview]
Message-ID: <f39b3a317226c930bfda80f11b82cb53@math.uni-bielefeld.de> (raw)
In-Reply-To: <CAPj87rPSzvvUiMrau5kjxnQf=gk6d75JpXU2V7q2CSs_tHCZHA@mail.gmail.com>
On 2015-05-20 18:14, Daniel Stone wrote:
> Hi,
>
> On 20 May 2015 at 17:04, Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
> wrote:
>> Hmm,
>>
>> I wonder if that really 'fixes' anything, because now we get a WARN_ON
>> which
>> is immediately followed by a div-by-zero. Furthermore we then still
>> use the
>> result of that operation as input for a hw register (bad idea?)
>>
>> I thought of something like this. Change fimd_calc_clkdiv() to return
>> a
>> signed value (this shouldn't be a problem, since the returned number
>> range
>> is small anywary). Let fimd_calc_clkdiv() return -1 when it encounters
>> the
>> 'ideal_clk == 0' case. Move computation of clkdiv in fimd_commit() to
>> the
>> top of the function (right after the {h,v}total checks). If 'clkdiv ==
>> -1'
>> case is encountered, then do WARN_ON and return immediately from
>> fimd_commit().
>>
>> Should I prepare a patch for this, or does someone see an issue with
>> this
>> approach?
>
> Commit should never fail; as I said earlier, the right fix is to
> reject these modes during checking, by making sure that any mode which
> passes mode_fixup() and/or mode_valid() never trips this condition.
But then in this case it wouldn't help to call drm_mode_vrefresh()
during fixup, since it still returns zero, so we're in the same
situation as before.
I even wonder if fixup is doing anything at all. See my previous log in:
http://www.spinics.net/lists/linux-samsung-soc/msg44683.html
This is with the old code in fixup that should set vrefresh to 60.
And we see that it's actually called:
[ 135.978878] [drm:fimd_mode_fixup] vrefresh 0
But then a small while later:
[ 135.979048] [drm:fimd_calc_clkdiv] vrefresh 0
So apparantly nothing was fixed up here anyway?!
With best wishes,
Tobias
>
> Cheers,
> Daniel
next prev parent reply other threads:[~2015-05-20 16:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-20 14:33 [PATCH 1/2] drm/exynos: calculate vrefresh instead of use a fixed value Gustavo Padovan
2015-05-20 14:33 ` [PATCH 2/2] drm/exynos: WARN_ON if ideal_clk is zero Gustavo Padovan
2015-05-20 16:04 ` Tobias Jakobi
2015-05-20 16:14 ` Daniel Stone
2015-05-20 16:31 ` Tobias Jakobi [this message]
2015-05-20 17:14 ` Daniel Stone
2015-05-20 16:58 ` [PATCH 1/2] drm/exynos: calculate vrefresh instead of use a fixed value Tobias Jakobi
2015-05-20 17:16 ` Daniel Stone
2015-05-20 18:46 ` Gustavo Padovan
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=f39b3a317226c930bfda80f11b82cb53@math.uni-bielefeld.de \
--to=tjakobi@math.uni-bielefeld.de \
--cc=daniel@fooishbar.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=gustavo.padovan@collabora.co.uk \
--cc=gustavo@padovan.org \
--cc=inki.dae@samsung.com \
--cc=jy0922.shim@samsung.com \
--cc=linux-samsung-soc@vger.kernel.org \
/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