[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <nycvar.YSQ.7.76.1806190812550.16670@knanqh.ubzr>
Date: Tue, 19 Jun 2018 08:14:57 -0400 (EDT)
From: Nicolas Pitre <nicolas.pitre@...aro.org>
To: Joe Perches <joe@...ches.com>
cc: Andy Shevchenko <andy.shevchenko@...il.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Dave Mielke <Dave@...lke.cc>,
Samuel Thibault <samuel.thibault@...-lyon.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 4/4] vt: coherence validation code for the unicode
screen buffer
On Mon, 18 Jun 2018, Joe Perches wrote:
> On Mon, 2018-06-18 at 21:50 -0400, Nicolas Pitre wrote:
> > On Tue, 19 Jun 2018, Andy Shevchenko wrote:
> []
> > > > + /*
> > > > + * Make sure our unicode screen translates into the same glyphs
> > > > + * as the actual screen. This is brutal indeed.
> > > > + */
> > > > + p = (unsigned short *)vc->vc_origin;
> > > > + mask = vc->vc_hi_font_mask | 0xff;
> > > > + for (y = 0; y < vc->vc_rows; y++) {
> > > > + char32_t *line = uniscr->lines[y];
> > > > + for (x = 0; x < vc->vc_cols; x++) {
> > > > + u16 glyph = scr_readw(p++) & mask;
> > > > + char32_t uc = line[x];
> > > > + int tc = conv_uni_to_pc(vc, uc);
> > > > + if (tc == -4)
> > > > + tc = conv_uni_to_pc(vc, 0xfffd);
> > > > + if (tc == -4)
> > > > + tc = conv_uni_to_pc(vc, '?');
> > > > + if (tc != glyph)
> > > > + pr_notice("%s: mismatch at %d,%d: "
> > > > + "glyph=%#x tc=%#x\n", __func__,
> > > > + x, y, glyph, tc);
> > >
> > > Don't split format string in printk(). checkpatch will not warn on longer lines.
> >
> > I didn't do it like that for checkpatch but to keep the code readable.
> > I don't particularly care either ways though.
>
> If one glyph is off, then perhaps others are off too.
> Perhaps this message should be ratelimited.
Remember that this is costly debugging code that is off by default.
No production kernel should have it enabled.
Nicolas
Powered by blists - more mailing lists