[igt-dev] [PATCH i-g-t] tests/kms_plane_scaling: Check supported format for rotation

Daniel Vetter daniel at ffwll.ch
Thu Apr 4 12:57:56 UTC 2019


On Thu, Apr 04, 2019 at 01:37:02PM +0300, Mika Kahola wrote:
> Let's align with kernel and add checks for formats that are
> not allowed to do 90/270 rotation.
> 
> In dmesg we see for example, the following
> 
> "[drm:skl_plane_check [i915]] Unsupported pixel format Y210
> little-endian (0x30313259) for 90/270!"
> 
> Signed-off-by: Mika Kahola <mika.kahola at intel.com>

Can we try to use try_commit/TEST_ONLY to figure at least some of this
out? Duplicating hard-coded tables in tests from the kernel isn't great.

Note that the rotation support predates i915 atomic support, so back then
we didn't have any other choice really. Now we do.
-Daniel

> ---
>  tests/kms_plane_scaling.c | 20 ++++++++++++++++++--
>  1 file changed, 18 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/kms_plane_scaling.c b/tests/kms_plane_scaling.c
> index 3364073c..2d47c14b 100644
> --- a/tests/kms_plane_scaling.c
> +++ b/tests/kms_plane_scaling.c
> @@ -176,9 +176,25 @@ static const igt_rotation_t rotations[] = {
>  
>  static bool can_rotate(data_t *d, unsigned format)
>  {
> -	if (format == DRM_FORMAT_C8 ||
> -	    (intel_gen(d->devid) < 11 && format == DRM_FORMAT_RGB565))
> +	switch (format) {
> +	case DRM_FORMAT_RGB565:
> +		if (intel_gen(d->devid) >= 11)
> +			break;
> +	/* fall through */
> +	case DRM_FORMAT_C8:
> +	case DRM_FORMAT_XRGB16161616F:
> +	case DRM_FORMAT_XBGR16161616F:
> +	case DRM_FORMAT_ARGB16161616F:
> +	case DRM_FORMAT_ABGR16161616F:
> +	case DRM_FORMAT_Y210:
> +	case DRM_FORMAT_Y212:
> +	case DRM_FORMAT_Y216:
> +	case DRM_FORMAT_XVYU12_16161616:
> +	case DRM_FORMAT_XVYU16161616:
>  		return false;
> +	default:
> +		break;
> +	}
>  
>  	return true;
>  }
> -- 
> 2.17.1
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the igt-dev mailing list