Skip to contentSkip to conversation

drm/tests: Fix swapped test parameter names

PATCH Superseded Carlos Eduardo Gallo Filho 3 participants 3 messages Jun 23, 2023 – Jun 24, 2023

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/tests: Fix swapped test parameter names

The "YVU420 DRM_MODE_FB_MODIFIERS set without modifier" test hadn't DRM_MODE_FB_MODIFIERS set, so that it was in fact testing another case, while the "YVU420 Normal sizes" test in turn was with DRM_MODE_FB_MODIFIERS set and without modifiers, what should be the case tested by the former, which also in turn fit in what "YVU320 Normal sizes" should be, meaning that they were swapped.

---
 drivers/gpu/drm/tests/drm_framebuffer_test.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/tests/drm_framebuffer_test.c +2 -2
index df235b7fdaa5..f759d9f3b76e 100644
@@ -178,13 +178,13 @@ static const struct drm_framebuffer_test drm_framebuffer_create_cases[] = {
 		 .handles = { 1, 1, 1 }, .pitches = { 600, 600, 600 },
 	}
 },
-{ .buffer_created = 1, .name = "YVU420 Normal sizes",
+{ .buffer_created = 1, .name = "YVU420 DRM_MODE_FB_MODIFIERS set without modifier",
 	.cmd = { .width = 600, .height = 600, .pixel_format = DRM_FORMAT_YVU420,
 		 .handles = { 1, 1, 1 }, .flags = DRM_MODE_FB_MODIFIERS,
 		 .pitches = { 600, 300, 300 },
 	}
 },
-{ .buffer_created = 1, .name = "YVU420 DRM_MODE_FB_MODIFIERS set without modifier",
+{ .buffer_created = 1, .name = "YVU420 Normal sizes",
 	.cmd = { .width = 600, .height = 600, .pixel_format = DRM_FORMAT_YVU420,
 		 .handles = { 1, 1, 1 }, .pitches = { 600, 300, 300 },
 	}
Signature · 1 line
2.39.3
Reviewed-by on v1 1/1
#1 lore raw

Hi Carlos!

Em 23/06/2023 12:25, Carlos Eduardo Gallo Filho escreveu:

Quoted 7 lines

The "YVU420 DRM_MODE_FB_MODIFIERS set without modifier" test hadn't DRM_MODE_FB_MODIFIERS set, so that it was in fact testing another case, while the "YVU420 Normal sizes" test in turn was with DRM_MODE_FB_MODIFIERS set and without modifiers, what should be the case tested by the former, which also in turn fit in what "YVU320 Normal sizes" should be, meaning that they were swapped.

I think the patch is simple enough to have a simple message, the diff itself tells a lot here. I would write something like this:

drm/tests: Swap drm_framebuffer tests parameter names

Swap tests parameters names so they actually reflect what is being tested.

Quoted 1 line

Anyway, your version also works for me.

Quoted 24 lines
---
  drivers/gpu/drm/tests/drm_framebuffer_test.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/tests/drm_framebuffer_test.c +2 -2
index df235b7fdaa5..f759d9f3b76e 100644
@@ -178,13 +178,13 @@ static const struct drm_framebuffer_test drm_framebuffer_create_cases[] = {
  		 .handles = { 1, 1, 1 }, .pitches = { 600, 600, 600 },
  	}
  },
-{ .buffer_created = 1, .name = "YVU420 Normal sizes",
+{ .buffer_created = 1, .name = "YVU420 DRM_MODE_FB_MODIFIERS set without modifier",
  	.cmd = { .width = 600, .height = 600, .pixel_format = DRM_FORMAT_YVU420,
  		 .handles = { 1, 1, 1 }, .flags = DRM_MODE_FB_MODIFIERS,
  		 .pitches = { 600, 300, 300 },
  	}
  },
-{ .buffer_created = 1, .name = "YVU420 DRM_MODE_FB_MODIFIERS set without modifier",
+{ .buffer_created = 1, .name = "YVU420 Normal sizes",
  	.cmd = { .width = 600, .height = 600, .pixel_format = DRM_FORMAT_YVU420,
  		 .handles = { 1, 1, 1 }, .pitches = { 600, 300, 300 },
  	}
Reviewed-by on v1 1/1
#2 lore raw
In reply to Carlos Eduardo Gallo Filho

Hi Carlos,

Great catch!

Quoted 8 lines · Carlos Eduardo Gallo Filho

The "YVU420 DRM_MODE_FB_MODIFIERS set without modifier" test hadn't DRM_MODE_FB_MODIFIERS set, so that it was in fact testing another case, while the "YVU420 Normal sizes" test in turn was with DRM_MODE_FB_MODIFIERS set and without modifiers, what should be the case tested by the former, which also in turn fit in what "YVU320 Normal sizes" should be, meaning that they were swapped.

With André's comment addressed,

Best Regards,
- Maíra

Quoted 24 lines
---
  drivers/gpu/drm/tests/drm_framebuffer_test.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/tests/drm_framebuffer_test.c +2 -2
index df235b7fdaa5..f759d9f3b76e 100644
@@ -178,13 +178,13 @@ static const struct drm_framebuffer_test drm_framebuffer_create_cases[] = {
  		 .handles = { 1, 1, 1 }, .pitches = { 600, 600, 600 },
  	}
  },
-{ .buffer_created = 1, .name = "YVU420 Normal sizes",
+{ .buffer_created = 1, .name = "YVU420 DRM_MODE_FB_MODIFIERS set without modifier",
  	.cmd = { .width = 600, .height = 600, .pixel_format = DRM_FORMAT_YVU420,
  		 .handles = { 1, 1, 1 }, .flags = DRM_MODE_FB_MODIFIERS,
  		 .pitches = { 600, 300, 300 },
  	}
  },
-{ .buffer_created = 1, .name = "YVU420 DRM_MODE_FB_MODIFIERS set without modifier",
+{ .buffer_created = 1, .name = "YVU420 Normal sizes",
  	.cmd = { .width = 600, .height = 600, .pixel_format = DRM_FORMAT_YVU420,
  		 .handles = { 1, 1, 1 }, .pitches = { 600, 300, 300 },
  	}