[igt-dev] [PATCH i-g-t 3/3] tests/kms_modes_available_crc: Fix NV12 failure

Souza, Jose jose.souza at intel.com
Fri Jan 18 22:44:09 UTC 2019


On Fri, 2019-01-18 at 00:58 -0800, Dhinakaran Pandiyan wrote:
> The size of the UV is not calculated correctly - height is not tile
> aligned. Make use the stride and offset values intilized in the
> previous patch to calculate plane size. The next step would be to
> rewrite
> test to make use of the library functions, but for now this should
> fix
> NV12.

Reviewed-by: José Roberto de Souza <jose.souza at intel.com>

> 
> Cc: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan at intel.com>
> ---
>  tests/kms_available_modes_crc.c | 17 +++++++++++------
>  1 file changed, 11 insertions(+), 6 deletions(-)
> 
> diff --git a/tests/kms_available_modes_crc.c
> b/tests/kms_available_modes_crc.c
> index fbc40297..c0f33f3c 100644
> --- a/tests/kms_available_modes_crc.c
> +++ b/tests/kms_available_modes_crc.c
> @@ -197,17 +197,18 @@ static bool fill_in_fb(data_t *data,
> igt_output_t *output, igt_plane_t *plane,
>  		writesize = data->size;
>  		break;
>  	case BYTES_PP_1:
> -		memset((void*)data->buf, fillers[i].value, data->size);
> +		memset((void *)data->buf, fillers[i].value, data-
> >size);
>  		writesize = data->size;
>  		break;
>  	case NV12:
> -		memset((void*)data->buf, fillers[i].value&0xff,
> -		       data->size);
> +		memset((void *)data->buf, fillers[i].value&0xff,
> +		       data->fb.offsets[1]);

Nit:
s/fillers[i].value&0xff/fillers[i].value & 0xff

>  
> -		memset((void*)(data->buf+data->size),
> -		       (fillers[i].value>>8)&0xff, data->size/2);
> +		memset((void *)(data->buf+data->fb.offsets[1]),
> +		       (fillers[i].value>>8)&0xff,
> +		       data->size - data->fb.offsets[1]);
>  
> -		writesize = data->size+data->size/2;
> +		writesize = data->size;
>  		break;
>  	case P010:
>  		ptemp_16_buf = (unsigned short*)data->buf;
> @@ -302,6 +303,10 @@ static bool setup_fb(data_t *data, igt_output_t
> *output, igt_plane_t *plane,
>  		data->fb.offsets[1] = data->size;
>  		data->fb.strides[1] = data->fb.strides[0];
>  		gemsize = data->size * 2;
> +
> +		if (fillers[i].bpp == NV12)
> +			data->size += data->fb.strides[1] * ALIGN(h/2,
> tile_height);
> +
>  		num_planes = 2;
>  	}
>  
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/igt-dev/attachments/20190118/201c74aa/attachment.sig>


More information about the igt-dev mailing list