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

Chris Wilson chris at chris-wilson.co.uk
Tue Oct 27 10:31:50 PDT 2015


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.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list