linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: jayakumar.lkml@gmail.com (Jaya Kumar)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 10/11] [ARM] tegra: Add framebuffer driver
Date: Tue, 15 Jun 2010 07:59:54 +0800	[thread overview]
Message-ID: <AANLkTikqOrciEnESCC1yGm0UvcxdK942ddrZF4K49TVb@mail.gmail.com> (raw)
In-Reply-To: <1276549827-2688-11-git-send-email-konkers@android.com>

On Tue, Jun 15, 2010 at 5:10 AM, Erik Gilling <konkers@android.com> wrote:
> diff --git a/drivers/video/tegrafb.c b/drivers/video/tegrafb.c
> new file mode 100644
> index 0000000..47b2d42
> --- /dev/null
> +++ b/drivers/video/tegrafb.c

> +/* palette attary used by the fbcon */
> +u32 pseudo_palette[16];

attary

> +
> +irqreturn_t tegra_fb_irq(int irq, void *ptr)
> +{
> + ? ? ? struct fb_info *info = ptr;
> + ? ? ? struct tegra_fb_info *tegra_fb = info->par;
> +
> + ? ? ? u32 reg = tegra_fb_readl(tegra_fb, DC_CMD_INT_STATUS);
> + ? ? ? tegra_fb_writel(tegra_fb, reg, DC_CMD_INT_STATUS);
> +
> + ? ? ? tegra_fb->wait_condition = 1;
> + ? ? ? wake_up(&tegra_fb->event_wq);
> + ? ? ? return IRQ_HANDLED;
> +}
> +
> +static int tegra_fb_wait_for_event(struct tegra_fb_info *tegra_fb,
> + ? ? ? unsigned long timeout, u32 irq_mask)
> +{
> + ? ? ? u32 reg;
> +
> + ? ? ? tegra_fb->wait_condition = 0;
> +
> + ? ? ? reg = tegra_fb_readl(tegra_fb, DC_CMD_INT_MASK);
> + ? ? ? reg |= irq_mask;
> + ? ? ? tegra_fb_writel(tegra_fb, reg, DC_CMD_INT_MASK);
> +
> + ? ? ? /* Clear any pending interrupt */
> + ? ? ? tegra_fb_writel(tegra_fb, irq_mask, DC_CMD_INT_STATUS);
> +
> + ? ? ? tegra_fb_writel(tegra_fb, irq_mask, DC_CMD_INT_ENABLE);
> +
> + ? ? ? /* Wait for the irq to fire */
> + ? ? ? wait_event_interruptible_timeout(tegra_fb->event_wq,
> + ? ? ? ? ? ? ? tegra_fb->wait_condition, timeout);
> +
> + ? ? ? tegra_fb_writel(tegra_fb, 0, DC_CMD_INT_ENABLE);
> +
> + ? ? ? if (!tegra_fb->wait_condition) {
> + ? ? ? ? ? ? ? pr_warning("%s: wait for vsync timed out\n", __func__);
> + ? ? ? ? ? ? ? return -ETIMEDOUT;
> + ? ? ? }
> + ? ? ? return 0;
> +}

Apologies for the incremental review. The wait_condition code above
looks odd to me. Typically, we just test the return value of
wait_event_interruptible_timeout to see whether it timed out (returns
0 if so). But I guess the above approach works as well.

> +               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.

Thanks,
jaya

  parent reply	other threads:[~2010-06-14 23:59 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1268721431-24434-1-git-send-email-konkers@google.com>
2010-04-13 22:42 ` [PATCH v2 00/10] Tegra2 support konkers at android.com
2010-04-13 22:42   ` [PATCH v2 01/10] [ARM] tegra: initial tegra support konkers at android.com
2010-04-13 22:42     ` [PATCH v2 02/10] [ARM] tegra: Add IRQ support konkers at android.com
2010-04-13 22:42       ` [PATCH v2 03/10] [ARM] tegra: Add clock support konkers at android.com
2010-04-13 22:42         ` [PATCH v2 04/10] [ARM] tegra: SMP support konkers at android.com
2010-04-13 22:42           ` [PATCH v2 05/10] [ARM] tegra: Add timer support konkers at android.com
2010-04-13 22:42             ` [PATCH v2 06/10] [ARM] tegra: add GPIO support konkers at android.com
2010-04-13 22:42               ` [PATCH v2 07/10] [ARM] tegra: add pinmux support konkers at android.com
2010-04-13 22:42                 ` [PATCH v2 08/10] [ARM] tegra: Add framebuffer driver konkers at android.com
2010-04-13 22:42                   ` [PATCH v2 09/10] [ARM] tegra: harmony: Add harmony board file konkers at android.com
2010-04-13 22:42                     ` [PATCH v2 10/10] [ARM] tegra: Add harmony_defconfig konkers at android.com
2010-04-13 23:26                   ` [PATCH v2 08/10] [ARM] tegra: Add framebuffer driver Jaya Kumar
2010-05-13  0:49               ` [PATCH v2 06/10] [ARM] tegra: add GPIO support Ben Dooks
2010-04-21 23:46           ` [PATCH v2 04/10] [ARM] tegra: SMP support Olof Johansson
2010-06-14 21:10   ` [PATCH v3 00/11] [ARM] tegra: tegra support Erik Gilling
2010-06-14 21:10     ` [PATCH v3 01/11] [ARM] tegra: initial " Erik Gilling
2010-06-14 21:10       ` [PATCH v3 02/11] [ARM] tegra: Add IRQ support Erik Gilling
2010-06-14 21:10         ` [PATCH v3 03/11] [ARM] tegra: Add clock support Erik Gilling
2010-06-14 21:10           ` [PATCH v3 04/11] [ARM] tegra: SMP support Erik Gilling
2010-06-14 21:10             ` [PATCH v3 05/11] [ARM] tegra: Add timer support Erik Gilling
2010-06-14 21:10               ` [PATCH v3 06/11] [ARM] tegra: add GPIO support Erik Gilling
2010-06-14 21:10                 ` [PATCH v3 07/11] [ARM] tegra: add pinmux support Erik Gilling
2010-06-14 21:10                   ` [PATCH v3 08/11] [ARM] tegra: harmony: Add harmony board file Erik Gilling
2010-06-14 21:10                     ` [PATCH v3 09/11] [ARM] tegra: add MAINTAINERS entry Erik Gilling
2010-06-14 21:10                       ` [PATCH v3 10/11] [ARM] tegra: Add framebuffer driver Erik Gilling
2010-06-14 21:10                         ` [PATCH v3 11/11] [ARM] tegra: add panel support to harmony board files Erik Gilling
2010-06-14 23:59                         ` Jaya Kumar [this message]
2010-06-15  0:16                           ` [PATCH v3 10/11] [ARM] tegra: Add framebuffer driver Jaya Kumar
2010-06-15  0:43                             ` Colin Cross

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=AANLkTikqOrciEnESCC1yGm0UvcxdK942ddrZF4K49TVb@mail.gmail.com \
    --to=jayakumar.lkml@gmail.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).