All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Jani Nikula <jani.nikula@intel.com>, dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH 1/6] drm/modes: add drm_mode_print() to dump mode in drm_printer
Date: Fri, 5 Apr 2024 10:45:42 +0200	[thread overview]
Message-ID: <375332cc-5d12-4afb-b00f-a9ef08209038@suse.de> (raw)
In-Reply-To: <54199d36993bfb00e29cc059ab9a215495405a99.1709843865.git.jani.nikula@intel.com>

Hi

Am 07.03.24 um 21:39 schrieb Jani Nikula:
> Add a printer based function for dumping the modeline, so it's not
> limited to KMS debug.
>
> Note: The printed output intentionally does not have the "Modeline"
> prefix. Prefix, if any, is for the caller to decide when initializing
> drm_printer.
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>   drivers/gpu/drm/drm_modes.c | 13 +++++++++++++
>   include/drm/drm_modes.h     |  2 ++
>   2 files changed, 15 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
> index c4f88c3a93b7..711750ab57c7 100644
> --- a/drivers/gpu/drm/drm_modes.c
> +++ b/drivers/gpu/drm/drm_modes.c
> @@ -49,6 +49,19 @@
>   
>   #include "drm_crtc_internal.h"
>   
> +/**
> + * drm_mode_print - print a mode to drm printer
> + * @p: drm printer
> + * @mode: mode to print
> + *
> + * Write @mode description to struct drm_printer @p.
> + */
> +void drm_mode_print(struct drm_printer *p, const struct drm_display_mode *mode)

Could this be a printf function with a trailing format string as final 
argument? The printed mode could then be part of another string instead 
of just at the end of it.

Best regards
Thomas

> +{
> +	drm_printf(p, DRM_MODE_FMT "\n", DRM_MODE_ARG(mode));
> +}
> +EXPORT_SYMBOL(drm_mode_print);
> +
>   /**
>    * drm_mode_debug_printmodeline - print a mode to dmesg
>    * @mode: mode to print
> diff --git a/include/drm/drm_modes.h b/include/drm/drm_modes.h
> index b9bb92e4b029..10c45014fbff 100644
> --- a/include/drm/drm_modes.h
> +++ b/include/drm/drm_modes.h
> @@ -32,6 +32,7 @@
>   #include <drm/drm_mode_object.h>
>   #include <drm/drm_connector.h>
>   
> +struct drm_printer;
>   struct videomode;
>   
>   /*
> @@ -460,6 +461,7 @@ int drm_mode_convert_umode(struct drm_device *dev,
>   			   struct drm_display_mode *out,
>   			   const struct drm_mode_modeinfo *in);
>   void drm_mode_probed_add(struct drm_connector *connector, struct drm_display_mode *mode);
> +void drm_mode_print(struct drm_printer *p, const struct drm_display_mode *mode);
>   void drm_mode_debug_printmodeline(const struct drm_display_mode *mode);
>   bool drm_mode_is_420_only(const struct drm_display_info *display,
>   			  const struct drm_display_mode *mode);

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)


  reply	other threads:[~2024-04-05  8:45 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-07 20:39 [PATCH 0/6] drm: debug logging improvements Jani Nikula
2024-03-07 20:39 ` [PATCH 1/6] drm/modes: add drm_mode_print() to dump mode in drm_printer Jani Nikula
2024-04-05  8:45   ` Thomas Zimmermann [this message]
2024-04-05 18:45     ` Ville Syrjälä
2024-04-08  9:24       ` Jani Nikula
2024-03-07 20:39 ` [PATCH 2/6] drm/probe-helper: switch to drm device based logging Jani Nikula
2024-03-07 20:39 ` [PATCH 3/6] drm/modes: switch drm_mode_prune_invalid() to use struct drm_printer Jani Nikula
2024-03-07 20:39 ` [PATCH 4/6] drm/modes: switch to drm device based error logging Jani Nikula
2024-03-07 20:39 ` [PATCH 5/6] drm/sysfs: switch to drm device based logging Jani Nikula
2024-03-07 20:44   ` Jani Nikula
2024-03-07 20:39 ` [PATCH 6/6] drm/client: switch to drm device based logging, and more Jani Nikula
2024-03-07 20:47   ` Jani Nikula
2024-03-07 20:48 ` ✓ CI.Patch_applied: success for drm: debug logging improvements Patchwork
2024-03-07 20:48 ` ✗ CI.checkpatch: warning " Patchwork
2024-03-07 20:49 ` ✓ CI.KUnit: success " Patchwork
2024-03-07 20:59 ` ✓ CI.Build: " Patchwork
2024-03-07 21:00 ` ✗ CI.Hooks: failure " Patchwork
2024-03-07 21:01 ` ✗ CI.checksparse: warning " Patchwork
2024-03-07 21:42 ` ✓ CI.BAT: success " Patchwork
2024-03-07 23:17 ` ✗ Fi.CI.CHECKPATCH: warning " Patchwork
2024-03-07 23:17 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-03-07 23:32 ` ✓ Fi.CI.BAT: success " Patchwork
2024-03-08 11:09 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-03-14 12:07 ` [PATCH 0/6] " Jani Nikula
2024-04-05  8:55 ` Thomas Zimmermann
2024-04-08  9:26   ` Jani Nikula

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=375332cc-5d12-4afb-b00f-a9ef08209038@suse.de \
    --to=tzimmermann@suse.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.