linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Colin Cross <ccross@android.com>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v3 10/11] [ARM] tegra: Add framebuffer driver
Date: Tue, 15 Jun 2010 00:43:34 +0000	[thread overview]
Message-ID: <AANLkTikOYNoOGH5-6hYJ5dVZ-qlHE88xGb3G64e_eUH8@mail.gmail.com> (raw)
In-Reply-To: <AANLkTilppHVz2XpLfin9wxrt9kHE1PIbct5XYvd_4iiX@mail.gmail.com>

On Mon, Jun 14, 2010 at 5:16 PM, Jaya Kumar <jayakumar.lkml@gmail.com> wrote:
> On Tue, Jun 15, 2010 at 7:59 AM, Jaya Kumar <jayakumar.lkml@gmail.com> wrote:
>> On Tue, Jun 15, 2010 at 5:10 AM, Erik Gilling <konkers@android.com> wrote:
>>
>>> +               if (tegra_fb_wait_for_event(tegra_fb, HZ/10, DC_INT_FRAME_END))
>>
>> I still didn't follow how tegra_fb_activate is using the -ETIMEDOUT
>> return value from the wait, it seems like it is just ignored. You are
>> also doing stuff like HZ/10 and you might prefer to use
>> msecs_to_jiffies.
>>
>
> I was unclear above. I mean the following code:
>
> +       while (tegra_fb_readl(tegra_fb, DC_CMD_STATE_CONTROL) & 3) {
> +               vsync_count++;
> +               if (tegra_fb_wait_for_event(tegra_fb, HZ/10, DC_INT_FRAME_END))
> +                       break;
> +       }
> +       if (unlikely(vsync_count > 1))
> +               pr_warning("%s: waited for %d vsyncs\n", __func__, vsync_count);
>
> It seems to me like the timeout from wait_for_event isn't propagated
> back upwards. Maybe it isn't needed but the way the code handles this
> seems confusing to me.

ETIMEDOUT in tegra_fb_wait_for_event is detecting waiting on an
interrupt that is not firing, and the loop in tegra_fb_activate is
checking for the double-buffering bits to clear in a reasonable amount
of time.  The if check in the loop makes sure that if the frame
interrupt is not occuring, the driver doesn't loop forever on the
double-buffering bits.

I'll modify tegra_fb_activate to propagate the error code and use
msecs_to_jiffies.

Thanks,
Colin

      reply	other threads:[~2010-06-15  0:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1268721431-24434-1-git-send-email-konkers@google.com>
     [not found] ` <1271198563-10424-1-git-send-email-konkers@android.com>
     [not found]   ` <1271198563-10424-2-git-send-email-konkers@android.com>
     [not found]     ` <1271198563-10424-3-git-send-email-konkers@android.com>
     [not found]       ` <1271198563-10424-4-git-send-email-konkers@android.com>
     [not found]         ` <1271198563-10424-5-git-send-email-konkers@android.com>
     [not found]           ` <1271198563-10424-6-git-send-email-konkers@android.com>
     [not found]             ` <1271198563-10424-7-git-send-email-konkers@android.com>
     [not found]               ` <1271198563-10424-8-git-send-email-konkers@android.com>
     [not found]                 ` <1271198563-10424-9-git-send-email-konkers@android.com>
2010-04-13 23:26                   ` [PATCH v2 08/10] [ARM] tegra: Add framebuffer driver Jaya Kumar
     [not found]   ` <1276549827-2688-1-git-send-email-konkers@android.com>
     [not found]     ` <1276549827-2688-2-git-send-email-konkers@android.com>
     [not found]       ` <1276549827-2688-3-git-send-email-konkers@android.com>
     [not found]         ` <1276549827-2688-4-git-send-email-konkers@android.com>
     [not found]           ` <1276549827-2688-5-git-send-email-konkers@android.com>
     [not found]             ` <1276549827-2688-6-git-send-email-konkers@android.com>
     [not found]               ` <1276549827-2688-7-git-send-email-konkers@android.com>
     [not found]                 ` <1276549827-2688-8-git-send-email-konkers@android.com>
     [not found]                   ` <1276549827-2688-9-git-send-email-konkers@android.com>
     [not found]                     ` <1276549827-2688-10-git-send-email-konkers@android.com>
2010-06-14 21:10                       ` [PATCH v3 10/11] " Erik Gilling
2010-06-14 23:59                         ` Jaya Kumar
2010-06-15  0:16                           ` Jaya Kumar
2010-06-15  0:43                             ` Colin Cross [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=AANLkTikOYNoOGH5-6hYJ5dVZ-qlHE88xGb3G64e_eUH8@mail.gmail.com \
    --to=ccross@android.com \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).