From patchwork Wed Jul 17 13:07:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Egbert Eich X-Patchwork-Id: 2828602 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CF5729F967 for ; Wed, 17 Jul 2013 13:22:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B3B2F201CA for ; Wed, 17 Jul 2013 13:22:54 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 7EA90201C1 for ; Wed, 17 Jul 2013 13:22:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6918FE6EE6 for ; Wed, 17 Jul 2013 06:22:53 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.8]) by gabe.freedesktop.org (Postfix) with ESMTP id 09305E6768 for ; Wed, 17 Jul 2013 06:08:04 -0700 (PDT) Received: from debian (p5DCF2FCF.dip0.t-ipconnect.de [93.207.47.207]) by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis) id 0M9cEd-1UrVEG1Z6t-00CiSs; Wed, 17 Jul 2013 15:07:51 +0200 Received: from sles11.fritz.box (sles11.fritz.box [192.168.178.22]) by debian (Postfix) with ESMTP id 97D5513C82; Wed, 17 Jul 2013 15:07:47 +0200 (CEST) From: Egbert Eich To: dri-devel@lists.freedesktop.org Subject: [PATCH 16/16] drm/mgag200: Add doublescan and interlace support Date: Wed, 17 Jul 2013 15:07:29 +0200 Message-Id: <1374066449-21714-17-git-send-email-eich@suse.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1374066449-21714-1-git-send-email-eich@suse.com> References: <1374066449-21714-1-git-send-email-eich@suse.com> X-Provags-ID: V02:K0:2I9lC+slbWZQPI1Yc/qrAXt0idGNYr32ra4Im4bfHbL HlVC4r7R5ggaJG7UN5zIi0O8yHeMilTPeIO31f1KtKKsSkAdi+ HdXx6c3+es6yMU8YE37iL3ZpwNJ87hmTiFWBwnbgapqVHOtZwo gU70Dn2M6yrooQBjeR+3TPGnVltBssLwNHcL+PIJX8YdduyVdz koUEaKbMO6iDmypriJaF2xBMZxKUFHIiSDTvCT+xUsxbgpmA4N SMlPTSwMBtD02GInTufkRkGCFNGTX3uLzCb/JwjPDX/zGC7mx3 2uVeei+VjoerdozzZIC2bPz0YluranHfAmzRSRPyjD2ANYQg/N 2/vwmaFS0mcDt8q/8eqgFW8fDNlhrq5Ai2e7fQXoX Cc: Dave Airlie , Christopher Harvey , Mathieu Larouche , Egbert Eich X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This code was ported from the xorg mga driver. Signed-off-by: Egbert Eich --- drivers/gpu/drm/mgag200/mgag200_mode.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c index 0bb0e1e..3faacbe 100644 --- a/drivers/gpu/drm/mgag200/mgag200_mode.c +++ b/drivers/gpu/drm/mgag200/mgag200_mode.c @@ -1488,6 +1488,7 @@ static int mga_vga_mode_valid(struct drm_connector *connector, struct mga_fbdev *mfbdev = mdev->mfbdev; struct drm_fb_helper *fb_helper = &mfbdev->helper; struct drm_fb_helper_connector *fb_helper_conn = NULL; + int lace = 1 + ((mode->flags & DRM_MODE_FLAG_INTERLACE) ? 1 : 0); int bpp = 32; int i = 0; @@ -1537,8 +1538,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; } @@ -1622,6 +1625,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);