Re: [PATCH 1/9] drm: Add drm_mode_debug_printmodeline_raw

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 27/04/16 13:35, Jani Nikula wrote:
On Wed, 27 Apr 2016, Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxxxxxxxx> wrote:
From: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx>

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@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux