[Intel-gfx] [PATCH v2] drm/i915: Add extra plane information in debugfs.

Robert Fekete robert.fekete at linux.intel.com
Wed Oct 28 02:37:08 PDT 2015


On tis, 2015-10-27 at 17:31 +0000, Chris Wilson wrote:
> On Tue, Oct 27, 2015 at 04:49:49PM +0100, Robert Fekete wrote:
> > +static const char *plane_rotation(unsigned int rotation)
> > +{
> > +	static char buf[48];
> > +	/*
> > +	 * According to doc only one DRM_ROTATE_ is allowed but this
> > +	 * will print them all to visualize if the values are misused
> > +	 */
> > +	snprintf(buf, sizeof(buf),
> > +		 "%s%s%s%s%s%s(0x%08x)",
> > +		 (rotation & BIT(DRM_ROTATE_0)) ? "0 " : "",
> > +		 (rotation & BIT(DRM_ROTATE_90)) ? "90 " : "",
> > +		 (rotation & BIT(DRM_ROTATE_180)) ? "180 " : "",
> > +		 (rotation & BIT(DRM_ROTATE_270)) ? "270 " : "",
> > +		 (rotation & BIT(DRM_REFLECT_X)) ? "FLIPX " : "",
> > +		 (rotation & BIT(DRM_REFLECT_Y)) ? "FLIPY " : "",
> > +		 rotation);
> 
> I'd do it the other away around "%x (%s...%s)", the number is the one we
> all know and love, and the human readable translation second.

I fully agree but this is printed right after drm_get_format_name() in
drm_crtc.c which in turn prints it like "%s%s..(%x)" so in order to make
it look consistent I went for this solution instead. Is it acceptable to
keep for consistency or do you still want me to change it?

BR
/R

> -Chris
> 

-- 
BR
/Robert Fekete
Intel Open Source Technology Center



More information about the Intel-gfx mailing list