Skip to contentSkip to conversation

drm/mgag200: Added resolution and bandwidth limits for various G200e products.

PATCH Superseded Julia Lemire 1 participant 3 messages Jun 17, 2013 – Jun 19, 2013

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover drm/mgag200: Added resolution and bandwidth limits for various G200e products.

At the larger resolutions, the g200e series sometimes struggles with maintaining a proper output. Problems like flickering or black bands appearing on screen can occur. In order to avoid this, limitations regarding resolutions and bandwidth have been added for the different variations of the g200e series.

Julia Lemire (1):
drm/mgag200: Added resolution and bandwidth limits for various G200e
products.

 drivers/gpu/drm/mgag200/mgag200_drv.h  |    3 +-
 drivers/gpu/drm/mgag200/mgag200_main.c |    2 +-
 drivers/gpu/drm/mgag200/mgag200_mode.c |   55 ++++++++++++++++++++++++++++++--
 3 files changed, 56 insertions(+), 4 deletions(-)
Signature · 1 line
1.7.10.4
#1 lore raw

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

This code was ported from the old xorg mga driver. These limits were implemented as a solution to a number of problems that were seen. These problems were linked to the bandwidth limitations of the g200e series.

---
 drivers/gpu/drm/mgag200/mgag200_drv.h  |    3 +-
 drivers/gpu/drm/mgag200/mgag200_main.c |    2 +-
 drivers/gpu/drm/mgag200/mgag200_mode.c |   55 ++++++++++++++++++++++++++++++--
 3 files changed, 56 insertions(+), 4 deletions(-)
drivers/gpu/drm/mgag200/mgag200_drv.h +2 -1
index bf29b2f..988911a 100644
@@ -198,7 +198,8 @@ struct mga_device {
 		struct ttm_bo_device bdev;
 	} ttm;
 
-	u32 reg_1e24; /* SE model number */
+	/* SE model number stored in reg 0x1e24 */
+	u32 unique_rev_id;
 };
 
 
drivers/gpu/drm/mgag200/mgag200_main.c +1 -1
index 9905923..dafe049 100644
@@ -176,7 +176,7 @@ static int mgag200_device_init(struct drm_device *dev,
 
 	/* stash G200 SE model number for later use */
 	if (IS_G200_SE(mdev))
-		mdev->reg_1e24 = RREG32(0x1e24);
+		mdev->unique_rev_id = RREG32(0x1e24);
 
 	ret = mga_vram_init(mdev);
 	if (ret)
drivers/gpu/drm/mgag200/mgag200_mode.c +53 -2

79 lines not on this page · raw message

Signature · 1 line
1.7.10.4
author
#2 lore raw
Quoted 4 lines · Julia Lemire
drivers/gpu/drm/mgag200/mgag200_mode.c +4 -0
+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;

drivers/gpu/drm/mgag200/mgag200_mode.c static int mga_vga_get_modes(struct drm_connector *connector) · line 1427

Quoted 10 lines
drivers/gpu/drm/mgag200/mgag200_mode.c +10 -0
+       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.

Signature · 5 lines
Julia Lemire Jr. Eng./Ing.
Software Designer
Matrox Graphics Inc.
Phone : 514 822-6000 x7010
Email :[email protected]