Jani Nikula
2022-Sep-23 09:18 UTC
[Nouveau] [PATCH v2 10/33] drm/modes: Add a function to generate analog display modes
On Fri, 23 Sep 2022, Thomas Zimmermann <tzimmermann at suse.de> wrote:> Am 22.09.22 um 16:25 schrieb Maxime Ripard: >> + drm_dbg_kms(dev, >> + "Generating a %ux%u%c, %u-line mode with a %lu kHz clock\n", >> + hactive, vactive, >> + interlace ? 'i' : 'p', >> + params->num_lines, >> + pixel_clock_hz / 1000); > > Divide by HZ_PER_KHZ here and in other places. > > https://elixir.bootlin.com/linux/latest/source/include/linux/units.h#L23>From the Department of Bikeshedding:I find "pixel_clock_hz / 1000" has much more clarity than "pixel_clock_hz / HZ_PER_KHZ". I don't consider the SI prefixes magic numbers. BR, Jani. -- Jani Nikula, Intel Open Source Graphics Center
Thomas Zimmermann
2022-Sep-23 10:16 UTC
[Nouveau] [PATCH v2 10/33] drm/modes: Add a function to generate analog display modes
Hi Am 23.09.22 um 11:18 schrieb Jani Nikula:> On Fri, 23 Sep 2022, Thomas Zimmermann <tzimmermann at suse.de> wrote: >> Am 22.09.22 um 16:25 schrieb Maxime Ripard: >>> + drm_dbg_kms(dev, >>> + "Generating a %ux%u%c, %u-line mode with a %lu kHz clock\n", >>> + hactive, vactive, >>> + interlace ? 'i' : 'p', >>> + params->num_lines, >>> + pixel_clock_hz / 1000); >> >> Divide by HZ_PER_KHZ here and in other places. >> >> https://elixir.bootlin.com/linux/latest/source/include/linux/units.h#L23 > > From the Department of Bikeshedding: > > I find "pixel_clock_hz / 1000" has much more clarity than > "pixel_clock_hz / HZ_PER_KHZ".This one's easy to see because it tells you with the _hz postfix. Many places don't and then it quickly gets confusing what units the code's converting. Best regards Thomas> > I don't consider the SI prefixes magic numbers. > > > BR, > Jani. >-- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 N?rnberg, Germany (HRB 36809, AG N?rnberg) Gesch?ftsf?hrer: Ivo Totev -------------- next part -------------- A non-text attachment was scrubbed... Name: OpenPGP_signature Type: application/pgp-signature Size: 840 bytes Desc: OpenPGP digital signature URL: <https://lists.freedesktop.org/archives/nouveau/attachments/20220923/47f8e156/attachment-0001.sig>