Re: [PATCH v2 02/11] drm/tests: Add parameters to the drm_test_framebuffer_create test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Tue, Oct 24, 2023 at 04:09:53PM -0300, Carlos Eduardo Gallo Filho wrote:
> Extend the existing test case to cover:
> 1. Invalid flag atribute in the struct drm_mode_fb_cmd2.
> 2. Pixel format which requires non-linear modifier with
> DRM_FORMAT_MOD_LINEAR set.
> 3. Non-zero buffer offset for an unused plane
> 
> Also replace strcpy to strscpy on test_to_desc for improved security
> and reliability.
> 
> Signed-off-by: Carlos Eduardo Gallo Filho <gcarlos@xxxxxxxxxxx>
> ---
> v2:
>   - Remove strcpy to strscpy change.
> ---
>  drivers/gpu/drm/tests/drm_framebuffer_test.c | 21 ++++++++++++++++++++
>  1 file changed, 21 insertions(+)
> 
> diff --git a/drivers/gpu/drm/tests/drm_framebuffer_test.c b/drivers/gpu/drm/tests/drm_framebuffer_test.c
> index 9c6170edd5f7..659cbd5a3be3 100644
> --- a/drivers/gpu/drm/tests/drm_framebuffer_test.c
> +++ b/drivers/gpu/drm/tests/drm_framebuffer_test.c
> @@ -21,6 +21,8 @@
>  #define MIN_HEIGHT 4
>  #define MAX_HEIGHT 4096
>  
> +#define DRM_MODE_FB_INVALID BIT(2)
> +
>  struct drm_framebuffer_test {
>  	int buffer_created;
>  	struct drm_mode_fb_cmd2 cmd;
> @@ -85,6 +87,18 @@ static const struct drm_framebuffer_test drm_framebuffer_create_cases[] = {
>  		 .pitches = { 4 * MAX_WIDTH, 0, 0 },
>  	}
>  },
> +{ .buffer_created = 0, .name = "ABGR8888 Non-zero buffer offset for unused plane",
> +	.cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_ABGR8888,
> +		 .handles = { 1, 0, 0 }, .offsets = { UINT_MAX / 2, UINT_MAX / 2, 0 },
> +		 .pitches = { 4 * MAX_WIDTH, 0, 0 }, .flags = DRM_MODE_FB_MODIFIERS,
> +	}
> +},

I know that the other tests are like that too, but I'd really like a
comment that explains what corner case this test is supposed to test.

Maxime

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux