From owner-dev-commits-src-all@freebsd.org Fri Jan 15 15:13:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EBA7E4E8C5F; Fri, 15 Jan 2021 15:13:10 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DHPnf6HGbz5599; Fri, 15 Jan 2021 15:13:10 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id CABF5F9F6; Fri, 15 Jan 2021 15:13:10 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f177.google.com with SMTP id b64so11902745qkc.12; Fri, 15 Jan 2021 07:13:10 -0800 (PST) X-Gm-Message-State: AOAM533xRta9vM03I9RrVwiMMXkE+E2GF6jjg6wXhHlJtUOnwdsq57Pk rZbO2XfFmCaFlmsB9CmjTUKhMsfRxKx491U+WUw= X-Google-Smtp-Source: ABdhPJzLNLFvhD7V7h5NS6/V//XO0dQADJ/aH2L84uVmn7RWNs29Eubzg7BQnFa99j95MoMfGjqiweYsFedsLDkxBPk= X-Received: by 2002:ae9:e517:: with SMTP id w23mr12823548qkf.34.1610723590369; Fri, 15 Jan 2021 07:13:10 -0800 (PST) MIME-Version: 1.0 References: <202101140558.10E5wMNW079125@gitrepo.freebsd.org> In-Reply-To: From: Kyle Evans Date: Fri, 15 Jan 2021 09:12:57 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 0495ed398c4f - main - contrib/lua: update to 5.4.2 To: Mateusz Guzik Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, Warner Losh Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2021 15:13:11 -0000 On Fri, Jan 15, 2021 at 7:06 AM Mateusz Guzik wrote: > > There is some garbage shown by the boot loader since this commit. > Screenshot from VirtualBox: > https://people.freebsd.org/~mjg/loader_artifact.png > > An additional fixup is needed to see it: > commit 0974bfa3a8da2201b0a415e72593552f5ac59379 (HEAD -> main, > freebsd/main, freebsd/HEAD) > Author: Toomas Soome > Date: Fri Jan 15 14:58:12 2021 +0200 > > loader: do not update palette in text mode (real fix) > > otherwise the screen is blank. > The patch below will fix it (assuming we're both looking at the "Welcome to FreeBSD" misposition + leading garbage); there's clearly an additional hack needed with Lua 5.4 to make sure that we don't get a "float" (of course it's floored because we can't do floating point here) from division, but this comes up so rarely that I'm not sure it's worth specifically hacking around. Notably, below is the only place that stock lualoader does arithmetic that results in a "float" and, IMHO, it really should be a floor division like this anyways to be more explicit that we're flooring it. I'll push something to fix it within a couple hours. CC imp@, I'm leaning towards just pushing the below and not hacking lua further, but a second opinion would be appreciated. diff --git a/stand/lua/drawer.lua b/stand/lua/drawer.lua index 3ace3884ff8..6062d7e87a0 100644 --- a/stand/lua/drawer.lua +++ b/stand/lua/drawer.lua @@ -283,7 +283,7 @@ local function drawbox() end end if menu_header_x == nil then - menu_header_x = x + (w / 2) - (#menu_header / 2) + menu_header_x = x + (w // 2) - (#menu_header // 2) end screen.setcursor(menu_header_x, y) printc(menu_header)