diff mbox series

[4/7] drm/vkms: Fix compilation issues

Message ID 20240306-louis-vkms-conv-v1-4-5bfe7d129fdd@riseup.net (mailing list archive)
State New, archived
Headers show
Series Additions to "Reimplement line-per-line pixel conversion for plane reading" series | expand

Commit Message

Arthur Grillo March 6, 2024, 8:03 p.m. UTC
Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net>
---
 drivers/gpu/drm/vkms/tests/vkms_format_test.c | 2 +-
 drivers/gpu/drm/vkms/vkms_drv.h               | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

Comments

Louis Chauvet March 7, 2024, 12:03 a.m. UTC | #1
Le 06/03/24 - 17:03, Arthur Grillo a écrit :
> Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net>
> ---
>  drivers/gpu/drm/vkms/tests/vkms_format_test.c | 2 +-
>  drivers/gpu/drm/vkms/vkms_drv.h               | 4 ++++
>  2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/vkms/tests/vkms_format_test.c b/drivers/gpu/drm/vkms/tests/vkms_format_test.c
> index 4636b013602f..3522ecee960f 100644
> --- a/drivers/gpu/drm/vkms/tests/vkms_format_test.c
> +++ b/drivers/gpu/drm/vkms/tests/vkms_format_test.c
> @@ -113,7 +113,7 @@ static void vkms_format_test_yuv_u8_to_argb_u16(struct kunit *test)
>  	for (size_t i = 0; i < param->n_colors; i++) {
>  		const struct format_pair *color = &param->colors[i];
>  
> -		const struct conversion_matrix *matrix = get_conversion_matrix_to_argb_u16
> +		struct conversion_matrix *matrix = get_conversion_matrix_to_argb_u16
>  			(DRM_FORMAT_NV12, param->encoding, param->range);
>  
>  		argb = argb_u16_from_yuv888(color->yuv.y, color->yuv.u, color->yuv.v, matrix);
> diff --git a/drivers/gpu/drm/vkms/vkms_drv.h b/drivers/gpu/drm/vkms/vkms_drv.h
> index 393b76e7c694..3d62578499ab 100644
> --- a/drivers/gpu/drm/vkms/vkms_drv.h
> +++ b/drivers/gpu/drm/vkms/vkms_drv.h
> @@ -47,6 +47,10 @@ struct pixel_argb_u16 {
>  	u16 a, r, g, b;
>  };
>  
> +struct pixel_yuv_u8 {
> +	u8 y, u, v;
> +};

Can I move this structure in the test itself? As discussed with Pekka, I 
think it's not a good idea to have such specific `pixel_{fmt}_{size}` for 
each variant. Leaving it in vkms_drv.h give the idea of "for each new kind 
of format we have to create a new structure".

> +
>  struct line_buffer {
>  	size_t n_pixels;
>  	struct pixel_argb_u16 *pixels;
> 
> -- 
> 2.43.0
>
Arthur Grillo March 7, 2024, 11:43 a.m. UTC | #2
On 06/03/24 21:03, Louis Chauvet wrote:
> Le 06/03/24 - 17:03, Arthur Grillo a écrit :
>> Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net>
>> ---
>>  drivers/gpu/drm/vkms/tests/vkms_format_test.c | 2 +-
>>  drivers/gpu/drm/vkms/vkms_drv.h               | 4 ++++
>>  2 files changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/vkms/tests/vkms_format_test.c b/drivers/gpu/drm/vkms/tests/vkms_format_test.c
>> index 4636b013602f..3522ecee960f 100644
>> --- a/drivers/gpu/drm/vkms/tests/vkms_format_test.c
>> +++ b/drivers/gpu/drm/vkms/tests/vkms_format_test.c
>> @@ -113,7 +113,7 @@ static void vkms_format_test_yuv_u8_to_argb_u16(struct kunit *test)
>>  	for (size_t i = 0; i < param->n_colors; i++) {
>>  		const struct format_pair *color = &param->colors[i];
>>  
>> -		const struct conversion_matrix *matrix = get_conversion_matrix_to_argb_u16
>> +		struct conversion_matrix *matrix = get_conversion_matrix_to_argb_u16
>>  			(DRM_FORMAT_NV12, param->encoding, param->range);
>>  
>>  		argb = argb_u16_from_yuv888(color->yuv.y, color->yuv.u, color->yuv.v, matrix);
>> diff --git a/drivers/gpu/drm/vkms/vkms_drv.h b/drivers/gpu/drm/vkms/vkms_drv.h
>> index 393b76e7c694..3d62578499ab 100644
>> --- a/drivers/gpu/drm/vkms/vkms_drv.h
>> +++ b/drivers/gpu/drm/vkms/vkms_drv.h
>> @@ -47,6 +47,10 @@ struct pixel_argb_u16 {
>>  	u16 a, r, g, b;
>>  };
>>  
>> +struct pixel_yuv_u8 {
>> +	u8 y, u, v;
>> +};
> 
> Can I move this structure in the test itself? As discussed with Pekka, I 
> think it's not a good idea to have such specific `pixel_{fmt}_{size}` for 
> each variant. Leaving it in vkms_drv.h give the idea of "for each new kind 
> of format we have to create a new structure".

Sure, it makes more sense.

Best Regards,
~Arthur Grillo

> 
>> +
>>  struct line_buffer {
>>  	size_t n_pixels;
>>  	struct pixel_argb_u16 *pixels;
>>
>> -- 
>> 2.43.0
>>
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/vkms/tests/vkms_format_test.c b/drivers/gpu/drm/vkms/tests/vkms_format_test.c
index 4636b013602f..3522ecee960f 100644
--- a/drivers/gpu/drm/vkms/tests/vkms_format_test.c
+++ b/drivers/gpu/drm/vkms/tests/vkms_format_test.c
@@ -113,7 +113,7 @@  static void vkms_format_test_yuv_u8_to_argb_u16(struct kunit *test)
 	for (size_t i = 0; i < param->n_colors; i++) {
 		const struct format_pair *color = &param->colors[i];
 
-		const struct conversion_matrix *matrix = get_conversion_matrix_to_argb_u16
+		struct conversion_matrix *matrix = get_conversion_matrix_to_argb_u16
 			(DRM_FORMAT_NV12, param->encoding, param->range);
 
 		argb = argb_u16_from_yuv888(color->yuv.y, color->yuv.u, color->yuv.v, matrix);
diff --git a/drivers/gpu/drm/vkms/vkms_drv.h b/drivers/gpu/drm/vkms/vkms_drv.h
index 393b76e7c694..3d62578499ab 100644
--- a/drivers/gpu/drm/vkms/vkms_drv.h
+++ b/drivers/gpu/drm/vkms/vkms_drv.h
@@ -47,6 +47,10 @@  struct pixel_argb_u16 {
 	u16 a, r, g, b;
 };
 
+struct pixel_yuv_u8 {
+	u8 y, u, v;
+};
+
 struct line_buffer {
 	size_t n_pixels;
 	struct pixel_argb_u16 *pixels;