[PATCH 1/1] drm/mgag200: Added resolution and bandwidth limits for various G200e products.
J L
jlemire at matrox.com
Wed Jun 19 07:56:39 PDT 2013
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 at matrox.com
More information about the dri-devel
mailing list