[igt-dev] [i-g-t] lib/igt_fb: Add checks for intel device

Petri Latvala petri.latvala at intel.com
Wed Jun 16 07:44:15 UTC 2021


On Mon, Jun 14, 2021 at 06:40:41PM -0400, Anson Jacob wrote:
> Certain tests (eg: kms_plane_multiple) are failing on amdgpu due to
> an assert in intel_get_drm_devid which checks for an i915 device.
> 
> Add check for intel device before calling intel_get_drm_devid.
> 
> Fixes: 801309d0c245 ("lib/i915: Add ADL-P plane offset restriction for CCS framebuffers")
> 
> Signed-off-by: Anson Jacob <Anson.Jacob at amd.com>
> Cc: Imre Deak <imre.deak at intel.com>

Reviewed-by: Petri Latvala <petri.latvala at intel.com>


> ---
>  lib/igt_fb.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/igt_fb.c b/lib/igt_fb.c
> index ab52ea9f7cf2..71b8985529a6 100644
> --- a/lib/igt_fb.c
> +++ b/lib/igt_fb.c
> @@ -760,7 +760,8 @@ static uint32_t calc_plane_stride(struct igt_fb *fb, int plane)
>  			stride = ALIGN(min_stride, tile_width * 4);
>  
>  			/* TODO: add support to kernel to POT align CCS format strides */
> -			if (IS_ALDERLAKE_P(intel_get_drm_devid(fb->fd)))
> +			if (is_i915_device(fb->fd) &&
> +			    IS_ALDERLAKE_P(intel_get_drm_devid(fb->fd)))
>  				stride = roundup_power_of_two(max(stride, tile_width * 8));
>  		} else {
>  			stride = ALIGN(min_stride, tile_width);
> @@ -836,7 +837,8 @@ static uint64_t calc_plane_size(struct igt_fb *fb, int plane)
>  		 * On ADL_P CCS color planes must be 2MB aligned, until remapping
>  		 * support is added for CCS FBs.
>  		 */
> -		if (IS_ALDERLAKE_P(intel_get_drm_devid(fb->fd)) &&
> +		if (is_i915_device(fb->fd) &&
> +		    IS_ALDERLAKE_P(intel_get_drm_devid(fb->fd)) &&
>  		    is_ccs_modifier(fb->modifier))
>  			size = ALIGN(size, 2 * 1024 * 1024);
>  


More information about the igt-dev mailing list