linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Pitre <nicolas.pitre@linaro.org>
To: Joe Perches <joe@perches.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Dave Mielke <Dave@mielke.cc>,
	Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 4/4] vt: coherence validation code for the unicode screen buffer
Date: Tue, 19 Jun 2018 08:14:57 -0400 (EDT)	[thread overview]
Message-ID: <nycvar.YSQ.7.76.1806190812550.16670@knanqh.ubzr> (raw)
In-Reply-To: <800831730e3aeaf4da23f7f97cfa80103236c3cb.camel@perches.com>

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

  reply	other threads:[~2018-06-19 12:15 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-17 19:07 [PATCH v2 0/4] have the vt console preserve unicode characters Nicolas Pitre
2018-06-17 19:07 ` [PATCH v2 1/4] vt: preserve unicode values corresponding to screen characters Nicolas Pitre
2018-06-17 22:59   ` valdis.kletnieks
2018-06-17 23:17     ` Nicolas Pitre
2018-06-17 23:23       ` valdis.kletnieks
2018-06-17 19:07 ` [PATCH v2 2/4] vt: introduce unicode mode for /dev/vcs Nicolas Pitre
2018-06-17 19:07 ` [PATCH v2 3/4] vt: unicode fallback for scrollback Nicolas Pitre
2018-06-17 19:07 ` [PATCH v2 4/4] vt: coherence validation code for the unicode screen buffer Nicolas Pitre
2018-06-18 22:01   ` Andy Shevchenko
2018-06-19  1:50     ` Nicolas Pitre
2018-06-19  4:52       ` Joe Perches
2018-06-19 12:14         ` Nicolas Pitre [this message]
2018-06-19 13:09 ` [PATCH v2 0/4] have the vt console preserve unicode characters Adam Borowski
2018-06-19 13:52   ` Dave Mielke
2018-06-19 15:14     ` Adam Borowski
2018-06-19 15:30       ` Dave Mielke
2018-06-19 15:34   ` Nicolas Pitre
2018-06-21  1:43     ` Adam Borowski
2018-06-21  2:21       ` Dave Mielke
2018-06-21  3:03         ` Nicolas Pitre
2018-06-22  1:54         ` Adam Borowski
2018-06-22  6:41           ` Samuel Thibault
2018-06-22 15:59           ` Alan Cox
2018-06-22 16:28             ` Nicolas Pitre
2018-06-22 17:51               ` Alan Cox
2018-06-21  2:59       ` Nicolas Pitre
2018-06-25  0:33         ` Adam Borowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=nycvar.YSQ.7.76.1806190812550.16670@knanqh.ubzr \
    --to=nicolas.pitre@linaro.org \
    --cc=Dave@mielke.cc \
    --cc=andy.shevchenko@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=samuel.thibault@ens-lyon.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).