From patchwork Fri May 27 19:12:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Larouche X-Patchwork-Id: 9139127 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 485EF6075C for ; Sat, 28 May 2016 02:51:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F266281AA for ; Sat, 28 May 2016 02:51:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 343052830C; Sat, 28 May 2016 02:51:05 +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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F56B281AA for ; Sat, 28 May 2016 02:51:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BF3F76E2C9; Sat, 28 May 2016 02:50:51 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 577 seconds by postgrey-1.35 at gabe; Fri, 27 May 2016 19:26:48 UTC Received: from mtxmxout2.matrox.com (mtxmxout2.matrox.com [138.11.2.92]) by gabe.freedesktop.org (Postfix) with ESMTPS id 735586E0DF for ; Fri, 27 May 2016 19:26:48 +0000 (UTC) Received: from venus.matrox.com (unknown [192.168.1.36]) by mtxmxout2.matrox.com (Postfix) with ESMTP id E466D98582 for ; Fri, 27 May 2016 15:17:09 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=matrox.com; s=dkim; t=1464376629; bh=1lLTrXg/xwBmrx/XqfNCby999v8KwbpuKeXGNPGZe14=; h=From:To:Cc:Subject:Date; b=cgaDYDjTccE994S2GM1qI2bLwuPURfk2CIoEPE8Gk/PbSun/5sF36jffVeP9s0YqD FXXa79nO7V/FP8YajlvytPtcv3zrF3ozBgskgwGjZi/bBFtFfl88XaxbV3Q+cnnAEy rcxJNi6BlKXYyKY+EeGvdqB4aAHvrHIW5XF+pmuU= Received: (from ssmsp@localhost) by venus.matrox.com (8.14.6/8.13.2) id u4RJH9kI000492 for dri-devel@lists.freedesktop.org; Fri, 27 May 2016 15:17:09 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by venus.matrox.com (Postfix) with ESMTP id 306F55F761; Fri, 27 May 2016 15:17:09 -0400 (EDT) X-Virus-MTX-Scanned: by Matrox Virus scanner at venus.matrox.com Received: from venus.matrox.com ([127.0.0.1]) by localhost (venus.matrox.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id epZHL01uCCiq; Fri, 27 May 2016 15:17:08 -0400 (EDT) Received: from venus-in.matrox.com (localhost.localdomain [127.0.0.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by venus.matrox.com (Postfix) with ESMTPS id 5ED265F757; Fri, 27 May 2016 15:17:08 -0400 (EDT) Received: from mlaroucheRHEL.matrox.com (dyn-152-20.matrox.com [192.168.152.20]) by venus-in.matrox.com (Postfix) with ESMTP id 2481F61C1B; Fri, 27 May 2016 15:17:08 -0400 (EDT) From: mathieu.larouche@matrox.com To: jbeulich@suse.com, dri-devel@lists.freedesktop.org Subject: [PATCH 1/1] drm/mgag200: Black screen fix for G200e rev 4 Date: Fri, 27 May 2016 15:12:50 -0400 Message-Id: X-Mailer: git-send-email 1.8.3.1 X-Mailman-Approved-At: Sat, 28 May 2016 02:50:50 +0000 Cc: Mathieu Larouche 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: Mathieu Larouche - Fixed black screen for some resolutions of G200e rev4 - Fixed testm & testn which had predetermined value. Reported-by: Jan Beulich Signed-off-by: Mathieu Larouche --- drivers/gpu/drm/mgag200/mgag200_mode.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c index 14e64e0..9baee8b 100644 --- a/drivers/gpu/drm/mgag200/mgag200_mode.c +++ b/drivers/gpu/drm/mgag200/mgag200_mode.c @@ -182,7 +182,7 @@ static int mga_g200se_set_plls(struct mga_device *mdev, long clock) } } - fvv = pllreffreq * testn / testm; + fvv = pllreffreq * (n + 1) / (m + 1); fvv = (fvv - 800000) / 50000; if (fvv > 15) @@ -202,6 +202,14 @@ static int mga_g200se_set_plls(struct mga_device *mdev, long clock) WREG_DAC(MGA1064_PIX_PLLC_M, m); WREG_DAC(MGA1064_PIX_PLLC_N, n); WREG_DAC(MGA1064_PIX_PLLC_P, p); + + if (mdev->unique_rev_id >= 0x04) { + WREG_DAC(0x1a, 0x09); + msleep(20); + WREG_DAC(0x1a, 0x01); + + } + return 0; }