All of lore.kernel.org
 help / color / mirror / Atom feed
From: J L <jlemire@matrox.com>
To: dri-devel@lists.freedesktop.org
Cc: Mathieu Larouche <mathieu.larouche@matrox.com>
Subject: Re: [PATCH 1/1] drm/mgag200: Added resolution and bandwidth limits for various G200e products.
Date: Wed, 19 Jun 2013 10:56:39 -0400	[thread overview]
Message-ID: <51C1C6A7.4050402@matrox.com> (raw)
In-Reply-To: <a7ba1d84d4fb762c7e4a4ee3c438d7eccf664d40.1371475033.git.jlemire@matrox.com>

On 13-06-17 09:19 AM, Julia Lemire wrote:
> +static uint32_t mga_vga_calculate_mode_bandwidth(struct drm_display_mode * mode,
> +                                                       int bits_per_pixel)
> +{
> +       uint64_t active_area, total_area, pixels_per_second;
> +       uint64_t bytes_per_pixel = (bits_per_pixel + 7) / 8;
> +
> +       if(!mode->htotal || !mode->vtotal || !mode->clock)
> +               return 0;
> +
> +       active_area = mode->hdisplay * mode->vdisplay;
> +       total_area = mode->htotal * mode->vtotal;
> +       pixels_per_second = active_area * mode->clock * 1000 / total_area;
> +       return (uint32_t)(pixels_per_second * bytes_per_pixel * 100 / (1024));
> +}
I found a bug while testing this on a 32-bit machine linked to the 
64-bit division.  Sorry.

-- 
Julia Lemire Jr. Eng./Ing.
Software Designer
Matrox Graphics Inc.
Phone : 514 822-6000 x7010
Email :julia.lemire@matrox.com

  reply	other threads:[~2013-06-19 15:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-17 13:19 [PATCH 0/1] drm/mgag200: Added resolution and bandwidth limits for various G200e products Julia Lemire
2013-06-17 13:19 ` [PATCH 1/1] " Julia Lemire
2013-06-19 14:56   ` J L [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-06-12 17:13 [PATCH 0/1] " Julia Lemire
2013-06-12 17:13 ` [PATCH 1/1] " Julia Lemire

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=51C1C6A7.4050402@matrox.com \
    --to=jlemire@matrox.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=mathieu.larouche@matrox.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.