From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Jani Nikula <jani.nikula@linux.intel.com>,
Intel-gfx@lists.freedesktop.org
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
dri-devel@lists.freedesktop.org,
Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Subject: Re: [PATCH 1/9] drm: Add drm_mode_debug_printmodeline_raw
Date: Wed, 27 Apr 2016 13:58:42 +0100 [thread overview]
Message-ID: <5720B782.7080409@linux.intel.com> (raw)
In-Reply-To: <87a8kfjkl7.fsf@intel.com>
On 27/04/16 13:35, Jani Nikula wrote:
> On Wed, 27 Apr 2016, Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> wrote:
>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>
>> Purpose is to enable drivers to print out just the mode
>> string with their own formatting.
>
> Some alternatives that preserve the use of a single printk(), avoiding
> garbled console output due to races (as discussed on intel-gfx in reply
> to the cover letter [1]):
>
> 1) Simply add a prefix string parameter to use in
> drm_mode_debug_printmodeline(). Really easy and covers most
> needs. Maybe wrap this in a macro to use the caller's function name.
>
> 2) Model drm_mode_debug_printmodeline() after drm_ut_debug_printk(),
> adding a mode parameter. Maybe wrap this in a macro to use the
> caller's function name.
This sounds good to me...
> 3) Add char *drm_mode_line(mode) that kmallocs a mode line string, or a
> drm_mode_line(mode, buf, bufsize) that prints the mode string to a
> statically allocated buffer.
...but it only solved the modeline part of the story. Unless something
like 3), which I specifically wanted to avoid. String handling etc..
best to be avoided in general if possible and more so for debug code
only. Any potential bug in those is best avoided if they do not exist.
And some of them log external input so even more so.
Something like debug_start/debug_print/debug_end would solve all that
but that would be bigger and core.
I'll try to do 2) and see what to do with the rest...
Regards,
Tvrtko
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2016-04-27 12:58 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-27 10:06 [PATCH 0/9] A little bit of KMS debug logging tidy Tvrtko Ursulin
2016-04-27 10:06 ` [PATCH 1/9] drm: Add drm_mode_debug_printmodeline_raw Tvrtko Ursulin
2016-04-27 12:35 ` Jani Nikula
2016-04-27 12:58 ` Tvrtko Ursulin [this message]
2016-04-27 10:06 ` [PATCH 2/9] drm: Recognize invalid (all-zero) modes in drm_mode_debug_printmodeline(_raw) Tvrtko Ursulin
2016-04-27 10:06 ` [PATCH 3/9] drm/i915: Compact modes in intel_dump_pipe_config Tvrtko Ursulin
2016-04-27 12:37 ` Jani Nikula
2016-04-27 10:06 ` [PATCH 4/9] drm/i915: Tidy planes and scaler info " Tvrtko Ursulin
2016-04-27 10:06 ` [PATCH 5/9] drm/i915: Compact intel_dump_pipe_config some more Tvrtko Ursulin
2016-04-27 10:06 ` [PATCH 6/9] drm/i915: Log watermark latencies on a single line per plane Tvrtko Ursulin
2016-04-27 10:07 ` [PATCH 7/9] drm/i915: Compact display clock logging Tvrtko Ursulin
2016-04-27 10:07 ` [PATCH 8/9] drm/i915: Print DisplayPort clocks on a single line Tvrtko Ursulin
2016-04-27 10:07 ` [PATCH 9/9] drm: Quiet down drm_mode_getconnector Tvrtko Ursulin
2016-04-28 8:54 ` Daniel Vetter
2016-04-27 10:54 ` [PATCH 0/9] A little bit of KMS debug logging tidy Jani Nikula
2016-04-27 11:26 ` Tvrtko Ursulin
2016-04-27 11:57 ` ✗ Fi.CI.BAT: warning for " Patchwork
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=5720B782.7080409@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=Intel-gfx@lists.freedesktop.org \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=tvrtko.ursulin@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox