lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YCuko55bGhmxvNiq@smile.fi.intel.com>
Date:   Tue, 16 Feb 2021 12:55:31 +0200
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Sakari Ailus <sakari.ailus@...ux.intel.com>
Cc:     dri-devel@...ts.freedesktop.org, linux-media@...r.kernel.org,
        linux-kernel@...r.kernel.org, Petr Mladek <pmladek@...e.com>,
        Dave Stevenson <dave.stevenson@...pberrypi.com>,
        hverkuil@...all.nl, laurent.pinchart@...asonboard.com,
        mchehab@...nel.org,
        Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Joe Perches <joe@...ches.com>,
        Jani Nikula <jani.nikula@...ux.intel.com>,
        Rasmus Villemoes <linux@...musvillemoes.dk>,
        Daniel Vetter <daniel@...ll.ch>,
        Thomas Zimmermann <tzimmermann@...e.de>
Subject: Re: [PATCH v8 3/4] drm: Switch to %p4cc format modifier

On Tue, Feb 16, 2021 at 12:19:30PM +0200, Sakari Ailus wrote:
> Switch DRM drivers from drm_get_format_name() to %p4cc. This gets rid of a
> large number of temporary variables at the same time.

...

> -	seq_printf(m, "\t\tuapi: [FB:%d] %s,0x%llx,%dx%d, visible=%s, src=" DRM_RECT_FP_FMT ", dst=" DRM_RECT_FMT ", rotation=%s\n",
> -		   fb ? fb->base.id : 0, fb ? format_name.str : "n/a",
> +	seq_printf(m, "\t\tuapi: [FB:%d] ", fb ? fb->base.id : 0);
> +	if (fb)
> +		seq_printf(m, "%p4cc", &fb->format->format);
> +	else
> +		seq_puts(m, "n/a");
> +	seq_printf(m, ",0x%llx,%dx%d, visible=%s, src=" DRM_RECT_FP_FMT ", dst=" DRM_RECT_FMT ", rotation=%s\n",
>  		   fb ? fb->modifier : 0,
>  		   fb ? fb->width : 0, fb ? fb->height : 0,
>  		   plane_visibility(plane_state),

I still think this can be improved. See below for the example:

  seq_puts(m, "\t\tuapi: ");
  if (fb)
    seq_printf(m, "[FB:%d] %p4cc,0x%llx,%dx%d, ",
       fb->base.id, &fb->format->format, fb->modifier, fb->width, fb->height);
  else
    seq_puts(m, "[FB:0] n/a,0,0x0, ");
  seq_printf(m, "visible=%s, src=" DRM_RECT_FP_FMT ", dst=" DRM_RECT_FMT ", rotation=%s\n",
       plane_visibility(plane_state), DRM_RECT_FP_ARG(&src),
       DRM_RECT_ARG(&dst), rot_str);

This will show logical parts separately and clear view on what would be printed
when !fb. Also it uses seq_puts() without any needs for formatting.

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ