Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1198139pxx; Tue, 27 Oct 2020 10:28:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpou+ZC6DwAegcMolP99HNQWgBIcELAt7FqcfCIzvCb1oT5tCMVQgvtg4l3yjYxlWgjMrU X-Received: by 2002:a05:6402:1c1b:: with SMTP id ck27mr3421002edb.218.1603819688573; Tue, 27 Oct 2020 10:28:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603819688; cv=none; d=google.com; s=arc-20160816; b=I0+o60GqFVfMcKXQpCYRmtWdAruylN8XKvez4ClO6DJU75lpG/ZZHsxIxwU/8HwD/E HdaJcIeNydVdMoxlWv7JnqzRR6BRoGHFm/kMBsenxpMgaRw0VSxph+Mt8j6MyuJMwnrZ 55Tprkg2ARvcbCHyFXlucW6IBM8SaXYrt34UrLaPsxVTaDopmBIhtFoLxSTWTPyYUJ4V VQlxFD4joLdW9+193mTD8imyn7kvFlvDH8+7bzV/lf96Ap6HHfqZAjDfjt9SOIg7kj/C 9GkmbLzCIYZwsW1cAw69UJB5tKdJ2i25NtT46xvEytPTB0aeIYWWnaVry008fme9CV6R HCXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=HptrGwBSY+SD+CDa0bd+3OxbTLi4hMQSBZc7Kms8AlM=; b=p+JGB8ZSu0rXx8imEve+e+VcUXmmaERv+VrDPHxvPkbCviAGDav7op/LR41gfj8Dm7 mGYgmw7jyWpFqFfTyhND16XYfKGeSaYLXuRVs0wk0CHMcTWgTUDU0nOuXYXFTIoWsv0G JVbLrCLPP8TaUiGrOoERtwmzF7zcWv8oWyV3Obr+riM+Fi5KTnMRZt50hCTocx1efbd2 rJXGIJl9YXTuzajNV2A5WRbdQ0zzHEkPkzrvyZ1gXSiQ63OMiohrATa8Xtn2FKwlaogX fx2Att0R+/AG38EmVXfr4A8n6jbQWKFmoLsYQnyE97ZG6e6Dn9AntSQ607lsp/tAa6bk xJ4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="SloE/kKe"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z8si1437411ejp.314.2020.10.27.10.27.44; Tue, 27 Oct 2020 10:28:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="SloE/kKe"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1813553AbgJ0Qu5 (ORCPT + 99 others); Tue, 27 Oct 2020 12:50:57 -0400 Received: from mail-pj1-f43.google.com ([209.85.216.43]:35323 "EHLO mail-pj1-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1813496AbgJ0Qu3 (ORCPT ); Tue, 27 Oct 2020 12:50:29 -0400 Received: by mail-pj1-f43.google.com with SMTP id h4so1041130pjk.0; Tue, 27 Oct 2020 09:50:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=HptrGwBSY+SD+CDa0bd+3OxbTLi4hMQSBZc7Kms8AlM=; b=SloE/kKeI7PO02Z+h+wXGCAWMViSW6igjNsKi66UgTllzsf3Xo6lcfNN9TKzvnGz+O XdUGidI0SkH6IYKDAy6fCGH7p45ca7aCZPPpBs+hzcCKoaTXmYy1hRg1UxzuO9/Ir52v 2GHeyuWwCB3PgNUJyCJ99aWZ19Ta+Swx/eL8cyS04LCr67nbMkcvk+AiQLkiCrXLtGaa 1bI5nNiH/BumJ7Kfksftg+A48qlnMSXf91iRXxjciYyPK50SL8nGjswljjr+F3yUqq6G KX+R6b8X5fPOfTFGIOkwhGfPyjq22j391lukmuhQ5KjUA2gOJDoXLmpIoW+sDYulXSh3 GqdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=HptrGwBSY+SD+CDa0bd+3OxbTLi4hMQSBZc7Kms8AlM=; b=oSMoEGsIafUtj1LfXPxVZoAIDQ9GH0jk8OR2yvO3t1d0xhCbmw4hxjSplGYdeO1xbY NdyYd4fLi7VPXF9y1kb45m3c3nbTvUOeFWouccw+zHf55RFFEkI49oVjGW8DN1so7WEN sYCKXB435HROPKMiEowB/2xgCzj1VZ9FGKrGpJoqfc3cOubzqED8ZlnGa2k/0mTc9O1y D8WxoDgSsetXDlkXVe8pOEWY3ZNBwKYd0YvqtERUyuvtFUed4PvpbVJInUjbVcyQ8V33 PU/q4tZFzRSKba8sqSzD5HMZVWNtflfJYzHfFBZjNyVQWhcMwqOhDZEKnVKKi1MhU4EW rR3Q== X-Gm-Message-State: AOAM532ZJVIo9N4SkO0x7BW0iYDllaBOd1oiYPbkKbzFRwHOa9XmmCcQ 1ANFAwZzPb/HM+X0uy2s4Q== X-Received: by 2002:a17:902:9a84:b029:d3:8b4f:50d5 with SMTP id w4-20020a1709029a84b02900d38b4f50d5mr3605768plp.48.1603817428057; Tue, 27 Oct 2020 09:50:28 -0700 (PDT) Received: from PWN (n11212042025.netvigator.com. [112.120.42.25]) by smtp.gmail.com with ESMTPSA id b3sm2840505pfd.66.2020.10.27.09.50.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 09:50:27 -0700 (PDT) Date: Tue, 27 Oct 2020 12:50:21 -0400 From: Peilin Ye To: Daniel Vetter Cc: Greg Kroah-Hartman , Bartlomiej Zolnierkiewicz , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Following up Message-ID: <20201027165021.GA1178130@PWN> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Daniel, More about the 3 things we've discussed before: 1. Cleaning up con_font_op(): (drivers/tty/vt/vt.c) int con_font_op(struct vc_data *vc, struct console_font_op *op) { switch (op->op) { case KD_FONT_OP_SET: return con_font_set(vc, op); case KD_FONT_OP_GET: return con_font_get(vc, op); case KD_FONT_OP_SET_DEFAULT: return con_font_default(vc, op); case KD_FONT_OP_COPY: return con_font_copy(vc, op); } return -ENOSYS; } On Tue, Sep 29, 2020 at 04:38:49PM +0200, Daniel Vetter wrote: > I think if we change the conf_font_get/set/default/copy functions to not > take the *op struct (which is take pretty arbitrarily from one of the > ioctl), but the parameters each needs directly, that would clean up the > code a _lot_. This is on my TODO list! One day I came up with some idea about fbcon.c, so I postponed this a bit... 2. Removing dummy functions, like sisusbdummycon_font_set(): Turns out, before c396a5bf457f ("console: Expand dummy functions for CFI"), they were just some macros: -#define SISUSBCONDUMMY (void *)sisusbdummycon_dummy +static int sisusbdummycon_font_set(struct vc_data *vc, + struct console_font *font, + unsigned int flags) +{ + return 0; +} ...and they had been there for a very long (10+ years) time. Removing code like this makes me a bit nervous, and... On Tue, Sep 29, 2020 at 04:38:49PM +0200, Daniel Vetter wrote: > This actually does something. tbh I would not be surprises if the > fb_set utility is the only thing that uses this - with a bit of code > search we could perhaps confirm this, and delete all the other > implementations. ...you mentioned code search, where & what should we look at, in order to confirm it's safe to remove them? 3. Using `font_desc` in `vc_data`: Our plan for the gradual conversion was to use a helper function to set font for a vc, but after reviewing the 300-ish occurrence of `vc_font`, it seems like code doesn't usually set it as a whole: (drivers/usb/misc/sisusbvga/sisusb_con.c) [...] c->vc_font.height = sisusb->current_font_height; [...] ...that's it! It only cares about the height. There are only 4 or 5 places in fbcon.c that actually set all fields of `vc_font`, like: vc->vc_font.width = font->width; vc->vc_font.height = font->height; vc->vc_font.data = (void *)(p->fontdata = font->data); vc->vc_font.charcount = 256; /* FIXME Need to support more fonts */ To make it even more complicated, `p` is a `struct fbcon_display *`, containing yet another font data pointer (`fontdata`) that I think should be replaced by a `font_desc *`... In conclusion, I think it's all about a few hard problems in fbcon.c. I'll keep trying and see how it goes. Thank you, Peilin Ye