From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-sn1nam01on0127.outbound.protection.outlook.com ([104.47.32.127]:39117 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932946AbeDIAkS (ORCPT ); Sun, 8 Apr 2018 20:40:18 -0400 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Mathieu Larouche , Sean Paul , Sasha Levin Subject: [PATCH AUTOSEL for 3.18 034/101] drm/mgag200: Fix to always set HiPri for G200e4 V2 Date: Mon, 9 Apr 2018 00:35:42 +0000 Message-ID: <20180409003505.164715-34-alexander.levin@microsoft.com> References: <20180409003505.164715-1-alexander.levin@microsoft.com> In-Reply-To: <20180409003505.164715-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Mathieu Larouche [ Upstream commit 0cbb738108927916a659b5b0b96e386fcd7cc6e1 ] - Changed the HiPri value for G200e4 to always be 0. - Added Bandwith limitation to block resolution above 1920x1200x60Hz Signed-off-by: Mathieu Larouche Acked-by: Dave Airlie [seanpaul removed some trailing whitespace from the patch] Signed-off-by: Sean Paul Link: http://patchwork.freedesktop.org/patch/msgid/ec0f8568d7ec41904dfe593c= 5deccf3f062d7bd8.1497450944.git.mathieu.larouche@matrox.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/mgag200/mgag200_mode.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag2= 00/mgag200_mode.c index d8e693d1f6d4..35400bea17bd 100644 --- a/drivers/gpu/drm/mgag200/mgag200_mode.c +++ b/drivers/gpu/drm/mgag200/mgag200_mode.c @@ -1029,7 +1029,10 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc, =20 =20 if (IS_G200_SE(mdev)) { - if (mdev->unique_rev_id >=3D 0x02) { + if (mdev->unique_rev_id >=3D 0x04) { + WREG8(MGAREG_CRTCEXT_INDEX, 0x06); + WREG8(MGAREG_CRTCEXT_DATA, 0); + } else if (mdev->unique_rev_id >=3D 0x02) { u8 hi_pri_lvl; u32 bpp; u32 mb; @@ -1502,6 +1505,10 @@ static int mga_vga_mode_valid(struct drm_connector *= connector, if (mga_vga_calculate_mode_bandwidth(mode, bpp) > (30100 * 1024)) return MODE_BANDWIDTH; + } else { + if (mga_vga_calculate_mode_bandwidth(mode, bpp) + > (55000 * 1024)) + return MODE_BANDWIDTH; } } else if (mdev->type =3D=3D G200_WB) { if (mode->hdisplay > 1280) --=20 2.15.1