From patchwork Tue Oct 27 16:37:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peilin Ye X-Patchwork-Id: 11860849 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4767C55178 for ; Tue, 27 Oct 2020 16:38:08 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 56A622076A for ; Tue, 27 Oct 2020 16:38:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="M1vwXINy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 56A622076A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EDE7E89DB8; Tue, 27 Oct 2020 16:38:06 +0000 (UTC) Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5DD8289BB0 for ; Tue, 27 Oct 2020 16:38:05 +0000 (UTC) Received: by mail-pf1-x441.google.com with SMTP id w65so1232738pfd.3 for ; Tue, 27 Oct 2020 09:38:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=T0NQC8q5PZfZ/nsIJ5qKnoN7K1varb2/TGSSOiRrezY=; b=M1vwXINyKCI2zbkqZyjRXzOz+OiTTjv5+YsMO5WomPxQ3OpKFOn7449dzir9pXj29D N5LsWZQuc+CpSU0G6fApBL8OSc3ryHX6s4+fH7/jMVFh8f3/aTe3/XJ1Ptp/jgX7r+t9 9xZFjZp26qxDvFk9dfn92Za9iIbief2hH5kZJ6lYpp2Ug7hYAdAIIbpVGHbquuB8px5+ LJQUV0NFSXrXOEc1N2TBFJmfeEId/wIGYG3QrPBOWi9ebke753T1av3HH461g4YDBEmp Rt6Abuk4cHAhe3quvhm7Y+ucPdDhEs7s8FvMm4Xd2uPJGWC7E+Bo6tSPsXJgl9VVG1XI FABw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=T0NQC8q5PZfZ/nsIJ5qKnoN7K1varb2/TGSSOiRrezY=; b=nc/3mwatQpQVKGo2IAWx+y1M3JCw0gtR5bnH+QM78UNox56EydmbTv6vmQSBk+mrgA hJsvmiyy4lsJXrXW9hELa8xbzej8eTMY8zsihCqabnGccn7c2u0MKN6RFGcwT7Xs0Rl7 5am+AueD+FClOVxbUfgw8d+QHXBI9pp2BnktZw+T9RTUaVae8/T+JIuTav5r/EynUwRr C5H3EWs7JEfUV2E3CjJImUwIzVBV1eCTbdzrO7rbXBDTnNrT2YUFxCKCklXSKYGHa9Ef yf2OOIbu0GpqJ9LFIpBMfioaaBCOACgWKTFNZbe4MrKIWSlalaSUf7j6rffb+HUchu2A E4vg== X-Gm-Message-State: AOAM532jxX3c+oGodW9bq3XNNmhxKH6MPk6vUYUJuKjNqesdjg/Mrxxu C8IXQxACNdgWoR9P87IHWg== X-Google-Smtp-Source: ABdhPJxBV7fdXTggzQ998E92lWxE1sdD8P1AgGgCr6mresHIg18LPfPSKo6TccWBfKl7Hovza/PVDw== X-Received: by 2002:a63:5d61:: with SMTP id o33mr2564224pgm.295.1603816685018; Tue, 27 Oct 2020 09:38:05 -0700 (PDT) Received: from localhost.localdomain (n11212042025.netvigator.com. [112.120.42.25]) by smtp.gmail.com with ESMTPSA id b7sm3139676pfr.171.2020.10.27.09.38.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 09:38:04 -0700 (PDT) From: Peilin Ye To: Daniel Vetter , Greg Kroah-Hartman Subject: [PATCH 4/5] fbcon: Avoid hard-coding built-in font charcount Date: Tue, 27 Oct 2020 12:37:29 -0400 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: <6c28279a10dbe7a7e5ac3e3a8dd7c67f8d63a9f2.1603788512.git.yepeilin.cs@gmail.com> References: <54f7d42e07eca2a2f13669575a9de88023ebc1ac.1603788512.git.yepeilin.cs@gmail.com> <6c28279a10dbe7a7e5ac3e3a8dd7c67f8d63a9f2.1603788512.git.yepeilin.cs@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-fbdev@vger.kernel.org, Bartlomiej Zolnierkiewicz , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Jiri Slaby , Peilin Ye Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" fbcon_startup() and fbcon_init() are hard-coding the number of characters of our built-in fonts as 256. Recently, we included that information in our kernel font descriptor `struct font_desc`, so use `font->charcount` instead of a hard-coded value. This patch depends on patch "Fonts: Add charcount field to font_desc". Signed-off-by: Peilin Ye --- drivers/video/fbdev/core/fbcon.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index cef437817b0d..e563847991b7 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -1004,7 +1004,7 @@ static const char *fbcon_startup(void) 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 */ + vc->vc_font.charcount = font->charcount; } else { p->fontdata = vc->vc_font.data; } @@ -1083,8 +1083,7 @@ static void fbcon_init(struct vc_data *vc, int init) 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 */ + vc->vc_font.charcount = font->charcount; } }