Re: [PATCH 1/1] drm/mgag200: Added resolution and bandwidth limits for various G200e products.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux