Received: by 2002:ac0:950e:0:0:0:0:0 with SMTP id f14csp764327imc; Sat, 16 Mar 2019 15:26:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqxS60Ggut4rcfB4QSpth2h/g/0pTwrcraCZKxVapd8yQPq1u3RPsc8D907HeEcjU9Yi3QD7 X-Received: by 2002:a17:902:9683:: with SMTP id n3mr11933040plp.333.1552775195889; Sat, 16 Mar 2019 15:26:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552775195; cv=none; d=google.com; s=arc-20160816; b=ARxna1m+3po/BsUNjeSBMryaT27s5646ithlzgMNtf0zJx4V8o3iZsL93wPmUE2cgW Jn05FaNnXJ+LoXk6zV26bjvKDHZQr03C0wrKaz9SvvXjUa7diwPHa8eLD5cGDAi1wuQ+ VHKZfPOMIZ70xiQ7EQaBEvL9gvBR1UDldWffCl9JrXzBf12INPc+e8cOheXvYGjXxsGe 1UJp/nnAzcXeocXl0DcSS1jKQNkU6s2+wpYASdh2ymQp+TsQKYyzEai9J6fmFk4NAWYt QJ7ia3/LgthGpYMZogBEWAjZ9Vkj3Ngfd8+nBJKWmNDyD2pslF+XD/1RaHL2FLkm7m6x Zg/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2ShnTTnQR8WHuEk3mue7gNBkuDVoCR1NHCJ3SuXV29k=; b=IIh1/0lhtx4P0P5eREVhBlsvObxoCSYG7cS6+liqOoO/IAnO9RhvPgjZcSmRs5Xc9S M2EEc4hb78xeO5TELwipXLCpfmfqNo6EXM2OMeD1TuNCOKT/PUIItMVpxyiLwNrKTjBX fgSSkLHkoUvHuaY1gblFmImbLJzjGSb3M4nHr33tHKhY4zmSMYYogvYdTLBPs7x1ozx7 1g5Mdua6dw1xkc+oX9qCQwWiXiAoAZiZfMq8zJYprQbGByfosn56La3zFgwtGmGyTpdm rbjp/tDRvAstRSu1bILJCrBYlMpIr4ECVPyeU/PrjklDWuhZB4EuNtGhn14UgSuXGFd9 smww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tomli.me header.s=1490979754 header.b=Nj6NsDsp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=tomli.me Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q13si5367339pgc.362.2019.03.16.15.26.21; Sat, 16 Mar 2019 15:26:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@tomli.me header.s=1490979754 header.b=Nj6NsDsp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=tomli.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727207AbfCPWZe (ORCPT + 99 others); Sat, 16 Mar 2019 18:25:34 -0400 Received: from tomli.me ([153.92.126.73]:56126 "EHLO tomli.me" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726418AbfCPWZc (ORCPT ); Sat, 16 Mar 2019 18:25:32 -0400 Received: from tomli.me (localhost [127.0.0.1]) by tomli.me (OpenSMTPD) with ESMTP id d58028c4; Sat, 16 Mar 2019 22:25:29 +0000 (UTC) X-HELO: localhost.lan Authentication-Results: tomli.me; auth=pass (login) smtp.auth=tomli Received: from Unknown (HELO localhost.lan) (2402:f000:1:1501:200:5efe:6fc7:8b2c) by tomli.me (qpsmtpd/0.95) with ESMTPSA (DHE-RSA-CHACHA20-POLY1305 encrypted); Sat, 16 Mar 2019 22:25:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=tomli.me; h=from:to:cc:subject:date:message-id:in-reply-to:references:mime-version:content-transfer-encoding; s=1490979754; bh=4NWBd3Ia346Cajmo+kDBGhGRvuiTuYQgNlRiz0JnB94=; b=Nj6NsDspA6ghIdTmqBt6/yGdH4GCF7YlrSaMClTWthphTL5CLeKE5jWTtJ3k3bFXfSy5n0Ej15NbnSV/9gFpYCFw28k17ECV4ZJ0R7P5RgjyaXTPxVPVHb2g+5xPH5vOkDRhssFVgyh0XtyjeeFW1ep6zLQk83B4i2e/LyzYB5mHLffvyVZmqjbgtymnR3Qm/FmRbjlYssYp2Ryt1jPWirIYJgJ7hq/I5mGSh8y97BRz02NWkybBhtKZrXjoMlrblhvRr+CGbYZGhwwmCdSFCR1blJwnj/qxFLR2yuyNv58AYHGzKGtTMgFsWw8IL+mU/b/qSfKQl+lzXXcyxMBF/A== From: Yifeng Li To: Sudip Mukherjee , Teddy Wang Cc: Bartlomiej Zolnierkiewicz , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Yifeng Li , stable@vger.kernel.org Subject: [PATCH 3/8] fbdev: sm712fb: fix VRAM detection, don't set SR70/71/74/75. Date: Sun, 17 Mar 2019 06:24:59 +0800 Message-Id: <20190316222504.27170-4-tomli@tomli.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190316222504.27170-1-tomli@tomli.me> References: <20190316222504.27170-1-tomli@tomli.me> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On a Thinkpad s30 (Pentium III / i440MX, Lynx3DM), the amount of Video RAM is not detected correctly by the xf86-video-siliconmotion driver. This is because sm712fb overwrites the GPR71 Scratch Pad Register, which is set by BIOS on x86 and used to indicate amount of VRAM. Other Scratch Pad Registers, including GPR70/74/75, don't have the same side-effect, but overwriting to them is still questionable, as they are not related to modesetting. Stop writing to SR70/71/74/75 (a.k.a GPR70/71/74/75). Signed-off-by: Yifeng Li Cc: stable@vger.kernel.org # v4.4+ --- drivers/video/fbdev/sm712fb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/video/fbdev/sm712fb.c b/drivers/video/fbdev/sm712fb.c index a19655babf67..1a3d232c2916 100644 --- a/drivers/video/fbdev/sm712fb.c +++ b/drivers/video/fbdev/sm712fb.c @@ -1146,7 +1146,9 @@ static void sm7xx_set_timing(struct smtcfb_info *sfb) /* init SEQ register SR30 - SR75 */ for (i = 0; i < SIZE_SR30_SR75; i++) if ((i + 0x30) != 0x30 && (i + 0x30) != 0x62 && - (i + 0x30) != 0x6a && (i + 0x30) != 0x6b) + (i + 0x30) != 0x6a && (i + 0x30) != 0x6b && + (i + 0x30) != 0x70 && (i + 0x30) != 0x71 && + (i + 0x30) != 0x74 && (i + 0x30) != 0x75) smtc_seqw(i + 0x30, vgamode[j].init_sr30_sr75[i]); -- 2.20.1