Message ID | 33ad9757-ed50-486a-9fe1-8add160286e9@HUB1.rwth-ad.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Thu, 20 Nov 2014, Stefan Brüns <stefan.bruens@rwth-aachen.de> wrote: > There is no need to dump the whole EDID block in case it contains no > information. Just print a single line stating the block is empty instead > of 8 lines containing only zeroes. > > Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by: Jani Nikula <jani.nikula@intel.com> > --- > drivers/gpu/drm/drm_edid.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c > index 3bf9991..ec4f91f 100644 > --- a/drivers/gpu/drm/drm_edid.c > +++ b/drivers/gpu/drm/drm_edid.c > @@ -1080,9 +1080,13 @@ bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid) > > bad: > if (print_bad_edid) { > - printk(KERN_ERR "Raw EDID:\n"); > - print_hex_dump(KERN_ERR, " \t", DUMP_PREFIX_NONE, 16, 1, > + if (drm_edid_is_zero(raw_edid, EDID_LENGTH)) { > + printk(KERN_ERR "EDID block is all zeroes\n"); > + } else { > + printk(KERN_ERR "Raw EDID:\n"); > + print_hex_dump(KERN_ERR, " \t", DUMP_PREFIX_NONE, 16, 1, > raw_edid, EDID_LENGTH, false); > + } > } > return false; > } > -- > 2.1.2 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/dri-devel
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 3bf9991..ec4f91f 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -1080,9 +1080,13 @@ bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid) bad: if (print_bad_edid) { - printk(KERN_ERR "Raw EDID:\n"); - print_hex_dump(KERN_ERR, " \t", DUMP_PREFIX_NONE, 16, 1, + if (drm_edid_is_zero(raw_edid, EDID_LENGTH)) { + printk(KERN_ERR "EDID block is all zeroes\n"); + } else { + printk(KERN_ERR "Raw EDID:\n"); + print_hex_dump(KERN_ERR, " \t", DUMP_PREFIX_NONE, 16, 1, raw_edid, EDID_LENGTH, false); + } } return false; }
There is no need to dump the whole EDID block in case it contains no information. Just print a single line stating the block is empty instead of 8 lines containing only zeroes. Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> --- drivers/gpu/drm/drm_edid.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)