Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp460709yba; Mon, 1 Apr 2019 09:45:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqw79CdAmYFyW4U+5vW116QTQFJ7rRKpg4D+tT6UpDA1vQYrLVw5fWL7uNWgb+If4hMSAO5x X-Received: by 2002:a65:5189:: with SMTP id h9mr60678729pgq.304.1554137110416; Mon, 01 Apr 2019 09:45:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554137110; cv=none; d=google.com; s=arc-20160816; b=N0Xh74+CMJZeY8GRgTSoKUreBVuQYb1N6VjAIQxeQI/Vq3dkbI9uGAHq+dnxxbC7zk TBkIw7bOzXZZOTIRSW2Q6ozmTWMlXg48Rly0VBTwxkJnt2Mbw67DXrp2CFKvahQu2EW+ GxGoFibZmXb6i5JxSezY+ICK9vQLLdAyU4eLfue0Zk5D4ZldtZsxiguhn/VCBSDa/Uy/ FUMN5b8vpVdGQ3lOex9RsBxOOZOhGrWPWRWweMb0+KqS3Ed4Xb2IdJD7z/Upa2ZkVFPQ 7wI7PmYOgJ7sis4FC6OZiS2AndwrKPGotkfVUMSFLUo4D2fp9dTMOEYqjMULi4iPoPjk hqhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=4HQPgQiL90EWcw3caIa1Bcc1goGbarAj3Rn74g8r9C4=; b=G4Toq9H8XSOxXgDBCx1gzqitJj+7NbLW7tdHTj8OETqS7lLrMyyxh+8mSHEdLKRyZ7 igmz9avPu/aQx7uZ8yaBZzzqzTpmKbi3a+UbgG4GfTJCE1Y8TuHq/4mu0PolMPDbZejV hdVq8xrv352X/22X5HfRzay1v0iRctevtWNLbpjNQ5K3jyiOkFeUGHrGxfnI5K9WYkBr CC/bsOydSjK2pw7w6AGmixejd6azA3d1cT3u/2qGiTb9F07f4MB65GofiRW7tqJwzzVR 1G4/cFloNSCKSkOxXjoCvHLlmKO+EnrLaUGztl+Nb2JhAFv86ZeHwHLfnBQi00Xt5gC4 52jQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tomli.me header.s=1490979754 header.b=gDWl9FmD; 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 s79si9064998pgs.245.2019.04.01.09.44.55; Mon, 01 Apr 2019 09:45:10 -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=gDWl9FmD; 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 S1728739AbfDAQmL (ORCPT + 99 others); Mon, 1 Apr 2019 12:42:11 -0400 Received: from tomli.me ([153.92.126.73]:32906 "EHLO tomli.me" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728730AbfDAQmL (ORCPT ); Mon, 1 Apr 2019 12:42:11 -0400 Received: from tomli.me (localhost [127.0.0.1]) by tomli.me (OpenSMTPD) with ESMTP id bae52b23; Mon, 1 Apr 2019 16:42:09 +0000 (UTC) X-HELO: localhost.localdomain Authentication-Results: tomli.me; auth=pass (login) smtp.auth=tomli Received: from Unknown (HELO localhost.localdomain) (2402:f000:1:1501:200:5efe:ddd9:ae88) by tomli.me (qpsmtpd/0.95) with ESMTPSA (DHE-RSA-CHACHA20-POLY1305 encrypted); Mon, 01 Apr 2019 16:42:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=tomli.me; h=date:from:to:cc:subject:message-id:references:mime-version:content-type:in-reply-to; s=1490979754; bh=9igJtPrqsS6O6dliEnhAbQB7ye7/fXgeV4i+qs9mdJA=; b=gDWl9FmD/ftmV6kUDcCT8MVeLONcChy7MSrdWkkHsp+bmJUQvxwukzTPv4E1SEB/M58gLPNJGKgFPDOR5Ztc3iIsq/fT6Xi7NQfkFeZQbjdzowf/9PUYenzV2APoxEPrZORrxBEuYryY4VvlYL5/phMONbT7coQ4M93TC8/kI5VPi6I9Gnz5k2ygFaA0S8F0315g09YixJSgBBH1uHIlJkbY4Fu9F7w8K8ITixzVTjasTd4k9MUpdlkuVaMTYDkF/pmD8DhYnPoBb8i6reFB+nVx3Fxr8phAqBP6e51qC2HTG3RY4CxvngrgoioiVKKtsx1K1ca2LwcYHSkBKL4pUw== Date: Tue, 2 Apr 2019 00:41:58 +0800 From: Tom Li To: Sudip Mukherjee Cc: Teddy Wang , linux-kernel@vger.kernel.org, Bartlomiej Zolnierkiewicz , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: Re: [PATCH v2 4/7] fbdev: sm712fb: add 32-bit color modes, drops some other modes. Message-ID: <20190401164158.GC15736@localhost.localdomain> References: <20190322051759.15007-1-tomli@tomli.me> <20190322051759.15007-5-tomli@tomli.me> <20190331183333.kpyt2hm5iy6m5u34@debian> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190331183333.kpyt2hm5iy6m5u34@debian> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Mar 31, 2019 at 07:33:33PM +0100, Sudip Mukherjee wrote: > Why are you removing existing functionality from the driver? These are > supported but were never listed so could not be used. I think you can > just add these to vesa_mode_table[] and they can be used. If there are some "functionalities" in a system, but they are never used, even worse, they are programmed in a way that they cannot be used by any user no matter what, meanwhile not a single user had filed a bug report in the entire lifecycle of the program, then I'd call them "dead code", that serves no useful purposes, rather than "functionalities". I think most kernel developers can agree on this. > I have an old CRT in India which supports 320x240 mode and can test there > when I am there next. Well... If someone (e.g. you) do see a need of this feature, then fixing them (instead of removing them) becomes a reasonable choice. Coincidentally, I've also purchased a video converter a few days ago. Please allow some time for me to testing it, so I can see if they're working. If so, I'll add them to the vesa_mode_table[] in PATCH v3. > > /********************************************************************** > > SM712 Mode table. > > - **********************************************************************/ > > + > > + The modesetting in sm712fb is an ugly hack. First, all the registers > > + are programmed by hardcoded register arrays, which makes it difficult > > + to support different variations of color depths, refresh rates, CRT/LCD > > + panel, etc of the same resolution. Second, it means the standard > > + fb_find_mode() cannot be used and a confusing non-standard "vga=" > > + parameter is needed. Third, there's only minimum differences between > > + some modes, yet around 70 lines of code and 100 registers are needed to > > + be indepentently specified for each mode. Fourth, the register between > > + some modes are inconsistent: the register configuration of different > > + color depths in 640 x 480 modes are identical, but for 800 x 600 modes > > + it's completely different. Also, some modes can drive the LCD panel > > + properly yet some other modes will only show a white screen of death on > > + the LCD panel. Fifth, there is a specific hack for Lemote Loongson 8089D > > + laptop, the 1024x768, 16-bit color mode was modified to drive its LCD panel > > + and changed to 1024x600, but the original mode was not preserved, so > > + 1024x768 16-bit color mode is completely unsupported. And previously, > > + some modes are listed, such as 1280x1024 modes, but never supported by > > + the register configuration arrays, so they are now removed. And some modes > > + are partially implemented but neither listed nor supported, i.e. the 8-bit > > + color modes, so they have been removed from vesa_mode_table, too. > > I think this comment sounds more like a commit message instead of a > code comment. Does this improve readability? Will remove, thanks. > > > + > > + I'm not the original author of the code, fixing these problems requires a > > + complete rewrite of modesetting code, which is well-beyond my motivation. > > + > > + See Documentation/fb/sm712fb.txt for more information. > > +**********************************************************************/ > > Is this needed? Many of the commits of the driver are done by people who > are not the original author. I'll reword it. Thanks, Tom Li