aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/mgag200
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-08-06 04:08:32 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-08-06 08:50:12 -0400
commiteaf99c749d43ae74ac7ffece5512f3c73f01dfd2 (patch)
treeb4e9e44920af793735b81481b50a1d54a6099ef9 /drivers/gpu/drm/mgag200
parentea6763c104c93acb6554659fe4a3c9e9328a4b51 (diff)
drm: Perform cmdline mode parsing during connector initialisation
i915.ko has a custom fbdev initialisation routine that aims to preserve the current mode set by the BIOS, unless overruled by the user. The user's wishes are determined by what, if any, mode is specified on the command line (via the video= parameter). However, that command line mode is first parsed by drm_fb_helper_initial_config() which is called after i915.ko's custom initial_config() as a fallback method. So in order for us to honour it, we need to move the cmdline parser earlier. If we perform the connector cmdline parsing as soon as we initialise the connector, that cmdline mode and forced status is then available even if the fbdev helper is not compiled in or never called. We also then expose the cmdline user mode in the connector mode lists. v2: Rebase after connector->name upheaval. v3: Adapt mga200 to look for the cmdline mode in the new place. Nicely simplifies things while at that. v4: Fix checkpatch. v5: Select FB_CMDLINE to adapt to the changed fbdev patch. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73154 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> (v2) Cc: Jesse Barnes <jbarnes@virtuousgeek.org> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> (v2) Cc: dri-devel@lists.freedesktop.org Cc: Julia Lemire <jlemire@matrox.com> Cc: Dave Airlie <airlied@redhat.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/mgag200')
-rw-r--r--drivers/gpu/drm/mgag200/mgag200_mode.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c
index 45f04dea0ac2..83485ab81ce8 100644
--- a/drivers/gpu/drm/mgag200/mgag200_mode.c
+++ b/drivers/gpu/drm/mgag200/mgag200_mode.c
@@ -1483,11 +1483,7 @@ static int mga_vga_mode_valid(struct drm_connector *connector,
1483{ 1483{
1484 struct drm_device *dev = connector->dev; 1484 struct drm_device *dev = connector->dev;
1485 struct mga_device *mdev = (struct mga_device*)dev->dev_private; 1485 struct mga_device *mdev = (struct mga_device*)dev->dev_private;
1486 struct mga_fbdev *mfbdev = mdev->mfbdev;
1487 struct drm_fb_helper *fb_helper = &mfbdev->helper;
1488 struct drm_fb_helper_connector *fb_helper_conn = NULL;
1489 int bpp = 32; 1486 int bpp = 32;
1490 int i = 0;
1491 1487
1492 if (IS_G200_SE(mdev)) { 1488 if (IS_G200_SE(mdev)) {
1493 if (mdev->unique_rev_id == 0x01) { 1489 if (mdev->unique_rev_id == 0x01) {
@@ -1537,21 +1533,14 @@ static int mga_vga_mode_valid(struct drm_connector *connector,
1537 } 1533 }
1538 1534
1539 /* Validate the mode input by the user */ 1535 /* Validate the mode input by the user */
1540 for (i = 0; i < fb_helper->connector_count; i++) { 1536 if (connector->cmdline_mode.specified) {
1541 if (fb_helper->connector_info[i]->connector == connector) { 1537 if (connector->cmdline_mode.bpp_specified)
1542 /* Found the helper for this connector */ 1538 bpp = connector->cmdline_mode.bpp;
1543 fb_helper_conn = fb_helper->connector_info[i];
1544 if (fb_helper_conn->cmdline_mode.specified) {
1545 if (fb_helper_conn->cmdline_mode.bpp_specified) {
1546 bpp = fb_helper_conn->cmdline_mode.bpp;
1547 }
1548 }
1549 }
1550 } 1539 }
1551 1540
1552 if ((mode->hdisplay * mode->vdisplay * (bpp/8)) > mdev->mc.vram_size) { 1541 if ((mode->hdisplay * mode->vdisplay * (bpp/8)) > mdev->mc.vram_size) {
1553 if (fb_helper_conn) 1542 if (connector->cmdline_mode.specified)
1554 fb_helper_conn->cmdline_mode.specified = false; 1543 connector->cmdline_mode.specified = false;
1555 return MODE_BAD; 1544 return MODE_BAD;
1556 } 1545 }
1557 1546