From patchwork Tue Jul 18 14:43:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 9848615 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F1282602A7 for ; Tue, 18 Jul 2017 14:43:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E295E237F1 for ; Tue, 18 Jul 2017 14:43:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D752E26785; Tue, 18 Jul 2017 14:43:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9F8B5237F1 for ; Tue, 18 Jul 2017 14:43:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 67FFF6E371; Tue, 18 Jul 2017 14:43:26 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id A446F6E0FB for ; Tue, 18 Jul 2017 14:43:24 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 316D8AD8B; Tue, 18 Jul 2017 14:43:23 +0000 (UTC) From: Takashi Iwai To: dri-devel@lists.freedesktop.org Subject: [PATCH 01/14] drm/mgag200: Add doublescan and interlace support Date: Tue, 18 Jul 2017 16:43:07 +0200 Message-Id: <20170718144320.8354-2-tiwai@suse.de> X-Mailer: git-send-email 2.13.2 In-Reply-To: <20170718144320.8354-1-tiwai@suse.de> References: <20170718144320.8354-1-tiwai@suse.de> Cc: Egbert Eich , Dave Airlie , Mathieu Larouche , Daniel Vetter X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Egbert Eich This code was ported from the xorg mga driver. The doublescreen_allowed and interlace_allowed flags are set unconditionally for all models for now. Signed-off-by: Egbert Eich Signed-off-by: Takashi Iwai --- drivers/gpu/drm/mgag200/mgag200_mode.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c index f4b53588e071..1b2b117a48d1 100644 --- a/drivers/gpu/drm/mgag200/mgag200_mode.c +++ b/drivers/gpu/drm/mgag200/mgag200_mode.c @@ -1624,7 +1624,9 @@ static int mga_vga_mode_valid(struct drm_connector *connector, struct drm_device *dev = connector->dev; struct mga_device *mdev = (struct mga_device*)dev->dev_private; int bpp = 32; + int lace; + lace = (mode->flags & DRM_MODE_FLAG_INTERLACE) ? 2 : 1; if (IS_G200_SE(mdev)) { if (mdev->unique_rev_id == 0x01) { if (mode->hdisplay > 1600) @@ -1676,8 +1678,10 @@ static int mga_vga_mode_valid(struct drm_connector *connector, if (mode->crtc_hdisplay > 2048 || mode->crtc_hsync_start > 4096 || mode->crtc_hsync_end > 4096 || mode->crtc_htotal > 4096 || - mode->crtc_vdisplay > 2048 || mode->crtc_vsync_start > 4096 || - mode->crtc_vsync_end > 4096 || mode->crtc_vtotal > 4096) { + mode->crtc_vdisplay > 2048 * lace || + mode->crtc_vsync_start > 4096 * lace || + mode->crtc_vsync_end > 4096 * lace || + mode->crtc_vtotal > 4096 * lace) { return MODE_BAD; } @@ -1737,6 +1741,9 @@ static struct drm_connector *mga_vga_init(struct drm_device *dev) connector = &mga_connector->base; + connector->interlace_allowed = true; + connector->doublescan_allowed = true; + drm_connector_init(dev, connector, &mga_vga_connector_funcs, DRM_MODE_CONNECTOR_VGA);