[igt-dev] [PATCH i-g-t] tests/kms_ccs: Avoid using plane sizes which exceed hw capability

Ville Syrjälä ville.syrjala at linux.intel.com
Fri Sep 21 14:35:06 UTC 2018


On Fri, Sep 21, 2018 at 04:38:01PM +0300, Juha-Pekka Heikkila wrote:
> Max sprite plane width at 2000 to avoid going over hw watermark
> limits.
> 
> bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105458
> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
> ---
>  tests/kms_ccs.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/kms_ccs.c b/tests/kms_ccs.c
> index e1ee588..f630029 100644
> --- a/tests/kms_ccs.c
> +++ b/tests/kms_ccs.c
> @@ -68,6 +68,8 @@ typedef struct {
>  #define CCS_UNCOMPRESSED	0x0
>  #define CCS_COMPRESSED		0x55
>  
> +#define MAX_SPRITE_PLANE_WIDTH 2000

Please include a comment explaining why we limit the plane width
like this. Avoids the next guy having to trawl git logs for the
information.

> +
>  struct local_drm_format_modifier {
>         /* Bitmask of formats in get_plane format list this info applies to. The
>  	* offset allows a sliding window of which 64 formats (bits).
> @@ -408,12 +410,12 @@ static bool try_config(data_t *data, enum test_fb_flags fb_flags,
>  	if (data->plane && fb_flags & FB_COMPRESSED) {
>  		if (!plane_has_format_with_ccs(data, data->plane, DRM_FORMAT_XRGB8888))
>  			return false;
> -		generate_fb(data, &fb, drm_mode->hdisplay,
> +		generate_fb(data, &fb, min(MAX_SPRITE_PLANE_WIDTH, drm_mode->hdisplay),
>  			    drm_mode->vdisplay,
>  			    (fb_flags & ~FB_COMPRESSED) | FB_HAS_PLANE);
>  		generate_fb(data, &fb_sprite, 256, 256, fb_flags);
>  	} else {
> -		generate_fb(data, &fb, drm_mode->hdisplay,
> +		generate_fb(data, &fb, min(MAX_SPRITE_PLANE_WIDTH, drm_mode->hdisplay),
>  			    drm_mode->vdisplay, fb_flags);
>  	}
>  
> -- 
> 2.7.4
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev

-- 
Ville Syrjälä
Intel


More information about the igt-dev mailing list