Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp636089pxx; Wed, 28 Oct 2020 13:02:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytH6nNfFYEcGXz5jg+Qnl+SHge6aECd7h3lYumom4rqtVk5yWdYcgjNQgdhrP89fAj7onZ X-Received: by 2002:a50:d517:: with SMTP id u23mr604172edi.338.1603915361489; Wed, 28 Oct 2020 13:02:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603915361; cv=none; d=google.com; s=arc-20160816; b=vemx5ARSnJI6dSMUUSSdiMO6vjIaX+ttzyqGIbCeU7UluFBQ21YDSdb2vhZ9A9zSK4 HutPz8OIuI+u08UcID4RKk7VQ7sfwShwo/bEi58fGoFoXI4UYMJdinbZJdkH2YpXmAgF q0oKkb+NgIzpgtRHdwG1xGmxeldLGvX6wlYYFJ5/f3YL1bS1sJu1V6IcjKyA5dw3nuuh OrhjgJoYkFQLHJJAerPt7dgvZeIhpCVhAgy/Yg0o4+Uqc0y4cbEHSYBiq3652TnmQDpL Ak86OxLd2Du8KRQIIP/qBNbOE1NzdvqAnAS3B6odCBbP8VbyLBrrz1AVfZBfRzvykgLf +4ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=IgE8yf8VvPCLXY3kXPndgQiUgJhhV1XD/7Oo36pvGbU=; b=hK6zkkrsZN8pKl0k1s/qOVrD/3BrlOoDKHQdG07LIwQHjkmlVu9eF8DEPRXfzUgjen kkEqiNPxWBY78Yh/gnwE6NEJ+Wyczw6PhPLl/HF+gmALOUxGwAVDRViUvVoVxYcRKBUX V4GhUtdHpd9EUzVd1qc+xzqlBLO58fMf3e/f91P4ymhZH+Mih6Z6AJykVF96uMtLRC6w QSuwVqDxadIv39qDpfia6msZ74F7goTKQ2eARwCCuP7gPpJNW2fbtcQ6H4DYrR2b2RqL yMV9mQZHcR/kUXvQ8kySEwHLGOKWLMcXQ9fH1DboP7veMCRwF8iy10a3VCldAzg5qg0b 1FBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=MygqLEYK; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id co4si129868edb.461.2020.10.28.13.02.18; Wed, 28 Oct 2020 13:02:41 -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=@ffwll.ch header.s=google header.b=MygqLEYK; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1794409AbgJ0ShJ (ORCPT + 99 others); Tue, 27 Oct 2020 14:37:09 -0400 Received: from mail-oi1-f194.google.com ([209.85.167.194]:33767 "EHLO mail-oi1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1763668AbgJ0ShJ (ORCPT ); Tue, 27 Oct 2020 14:37:09 -0400 Received: by mail-oi1-f194.google.com with SMTP id s21so2336285oij.0 for ; Tue, 27 Oct 2020 11:37:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IgE8yf8VvPCLXY3kXPndgQiUgJhhV1XD/7Oo36pvGbU=; b=MygqLEYK5L/J+eMI396OafToclJIM8p9jDuPmPtJd7fAX+/4M5rpvwarc0itBKpmzs /bw5UPnSDfKCpmC9FP4VwDlk8Udr76hnDLOjvfhGFsddQfip47U2C4Ynt/vbfjdGuZjm GjYxNRv+DOxPE603nQ/5mwrW8dV+DBlUfcTRc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IgE8yf8VvPCLXY3kXPndgQiUgJhhV1XD/7Oo36pvGbU=; b=dc+LZ41eOqkbpPXKl4xLsn4gDjwWXJaNpP9f9ezj48ki/Hza3gWBUwd6mbnCUfajZP 9NTCDoa9XxxvEUGPzOx2wHWs7V2qCLGyETMdXc/U1SW7hutOeynAN9AXCOHV9qlVwCOl QPRHPeF8uyj8hCCKqRZgmYldTf5uNCIoPbjzWbFGURbG712+Jo4qCubSG/szj35Q97Ja jv3F8JttcCrLs9QHeYKngwBJsqZ5adBj+1yaU8wPLT8DP5Zdz47ossu6Fmk2cHsmbXPs yz/Spea3+ml2k+ePxqpK7/pnx414YAkY8AqTejPQVTKUeNY4aWnJ2uaiHHLm/nQie4J/ 0Sqw== X-Gm-Message-State: AOAM531pgwsNsi3aokxVOPWiQBOtTYhYUwL0H3Sj1mwjuIc9mTtl/ZpX sspgB4ZTDicWxVG1SpX2LhMXGb3IBpgvSGx/MZB4JQ== X-Received: by 2002:aca:cc01:: with SMTP id c1mr2475031oig.128.1603823826322; Tue, 27 Oct 2020 11:37:06 -0700 (PDT) MIME-Version: 1.0 References: <20201027165021.GA1178130@PWN> In-Reply-To: <20201027165021.GA1178130@PWN> From: Daniel Vetter Date: Tue, 27 Oct 2020 19:36:54 +0100 Message-ID: Subject: Re: Following up To: Peilin Ye Cc: Greg Kroah-Hartman , Bartlomiej Zolnierkiewicz , dri-devel , Linux Fbdev development list , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 27, 2020 at 5:50 PM Peilin Ye wrote: > > 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? Way back there was google's code search, which was awesome. Now I just put the structure name/ioctl #define/number into google/bing/duckduckgo and see if anything turns up. Plus check how it's used in fb tools (although I just recently learned that fb-test pretty much disappeared from the internet, very hard to find the original). If you're unsure, we can merge a patch, then wait about 1 year for any users to show up with problems. If that's not the case, assume they're all gone, or it was never used and just implemented because it was copied from somewhere else, or "just in case". There's lots of dead uapi around. > 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. Yeah fbcon.c is pretty good horrors unfortunately :-/ -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch