KUNIT_EXPECT_MEMEQ(test, buf, result->expected, dst_size);
}
@@ -560,7 +565,10 @@ static void drm_test_fb_xrgb8888_to_rgb332(struct kunit *test)
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, xrgb8888);
iosys_map_set_vaddr(&src, xrgb8888);
- drm_fb_xrgb8888_to_rgb332(&dst, &result->dst_pitch, &src, &fb, ¶ms->clip);
+ if (result->dst_pitch == TEST_USE_DEFAULT_PITCH)
+ drm_fb_xrgb8888_to_rgb332(&dst, NULL, &src, &fb, ¶ms->clip);
+ else
+ drm_fb_xrgb8888_to_rgb332(&dst, &result->dst_pitch, &src, &fb, ¶ms->clip);
KUNIT_EXPECT_MEMEQ(test, buf, result->expected, dst_size);
}
@@ -590,12 +598,19 @@ static void drm_test_fb_xrgb8888_to_rgb565(struct kunit *test)
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, xrgb8888);
iosys_map_set_vaddr(&src, xrgb8888);
- drm_fb_xrgb8888_to_rgb565(&dst, &result->dst_pitch, &src, &fb, ¶ms->clip, false);
+ if (result->dst_pitch == TEST_USE_DEFAULT_PITCH)
+ drm_fb_xrgb8888_to_rgb565(&dst, NULL, &src, &fb, ¶ms->clip, false);
+ else
+ drm_fb_xrgb8888_to_rgb565(&dst, &result->dst_pitch, &src, &fb, ¶ms->clip,
+ false);
buf = le16buf_to_cpu(test, (__force const __le16 *)buf, dst_size / sizeof(__le16));
KUNIT_EXPECT_MEMEQ(test, buf, result->expected, dst_size);
buf = dst.vaddr; /* restore original value of buf */
- drm_fb_xrgb8888_to_rgb565(&dst, &result->dst_pitch, &src, &fb, ¶ms->clip, true);
+ if (result->dst_pitch == TEST_USE_DEFAULT_PITCH)
+ drm_fb_xrgb8888_to_rgb565(&dst, NULL, &src, &fb, ¶ms->clip, true);
+ else
+ drm_fb_xrgb8888_to_rgb565(&dst, &result->dst_pitch, &src, &fb, ¶ms->clip, true);
buf = le16buf_to_cpu(test, (__force const __le16 *)buf, dst_size / sizeof(__le16));
KUNIT_EXPECT_MEMEQ(test, buf, result->expected_swab, dst_size);
}
@@ -626,7 +641,10 @@ static void drm_test_fb_xrgb8888_to_xrgb1555(struct kunit *test)
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, xrgb8888);
iosys_map_set_vaddr(&src, xrgb8888);
- drm_fb_xrgb8888_to_xrgb1555(&dst, &result->dst_pitch, &src, &fb, ¶ms->clip);
+ if (result->dst_pitch == TEST_USE_DEFAULT_PITCH)
+ drm_fb_xrgb8888_to_xrgb1555(&dst, NULL, &src, &fb, ¶ms->clip);
+ else
+ drm_fb_xrgb8888_to_xrgb1555(&dst, &result->dst_pitch, &src, &fb, ¶ms->clip);
buf = le16buf_to_cpu(test, (__force const __le16 *)buf, dst_size / sizeof(__le16));
KUNIT_EXPECT_MEMEQ(test, buf, result->expected, dst_size);
}
@@ -657,7 +675,10 @@ static void drm_test_fb_xrgb8888_to_argb1555(struct kunit *test)
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, xrgb8888);
iosys_map_set_vaddr(&src, xrgb8888);
- drm_fb_xrgb8888_to_argb1555(&dst, &result->dst_pitch, &src, &fb, ¶ms->clip);
+ if (result->dst_pitch == TEST_USE_DEFAULT_PITCH)
+ drm_fb_xrgb8888_to_argb1555(&dst, NULL, &src, &fb, ¶ms->clip);
+ else
+ drm_fb_xrgb8888_to_argb1555(&dst, &result->dst_pitch, &src, &fb, ¶ms->clip);
buf = le16buf_to_cpu(test, (__force const __le16 *)buf, dst_size / sizeof(__le16));
KUNIT_EXPECT_MEMEQ(test, buf, result->expected, dst_size);
}
@@ -688,7 +709,10 @@ static void drm_test_fb_xrgb8888_to_rgba5551(struct kunit *test)
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, xrgb8888);
iosys_map_set_vaddr(&src, xrgb8888);
- drm_fb_xrgb8888_to_rgba5551(&dst, &result->dst_pitch, &src, &fb, ¶ms->clip);
+ if (result->dst_pitch == TEST_USE_DEFAULT_PITCH)
+ drm_fb_xrgb8888_to_rgba5551(&dst, &result->dst_pitch, &src, &fb, ¶ms->clip);
+ else
+ drm_fb_xrgb8888_to_rgba5551(&dst, &result->dst_pitch, &src, &fb, ¶ms->clip);
buf = le16buf_to_cpu(test, (__force const __le16 *)buf, dst_size / sizeof(__le16));
KUNIT_EXPECT_MEMEQ(test, buf, result->expected, dst_size);
}
@@ -723,7 +747,11 @@ static void drm_test_fb_xrgb8888_to_rgb888(struct kunit *test)
* RGB888 expected results are already in little-endian
* order, so there's no need to convert the test output.
*/
- drm_fb_xrgb8888_to_rgb888(&dst, &result->dst_pitch, &src, &fb, ¶ms->clip);
+ if (result->dst_pitch == TEST_USE_DEFAULT_PITCH)
+ drm_fb_xrgb8888_to_rgb888(&dst, NULL, &src, &fb, ¶ms->clip);
+ else
+ drm_fb_xrgb8888_to_rgb888(&dst, &result->dst_pitch, &src, &fb, ¶ms->clip);
+
KUNIT_EXPECT_MEMEQ(test, buf, result->expected, dst_size);
}
@@ -753,7 +781,11 @@ static void drm_test_fb_xrgb8888_to_argb8888(struct kunit *test)
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, xrgb8888);
iosys_map_set_vaddr(&src, xrgb8888);
- drm_fb_xrgb8888_to_argb8888(&dst, &result->dst_pitch, &src, &fb, ¶ms->clip);
+ if (result->dst_pitch == TEST_USE_DEFAULT_PITCH)
+ drm_fb_xrgb8888_to_argb8888(&dst, NULL, &src, &fb, ¶ms->clip);
+ else
+ drm_fb_xrgb8888_to_argb8888(&dst, &result->dst_pitch, &src, &fb, ¶ms->clip);
+
buf = le32buf_to_cpu(test, (__force const __le32 *)buf, dst_size / sizeof(u32));
KUNIT_EXPECT_MEMEQ(test, buf, result->expected, dst_size);
}
@@ -784,7 +816,10 @@ static void drm_test_fb_xrgb8888_to_xrgb2101010(struct kunit *test)
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, xrgb8888);
iosys_map_set_vaddr(&src, xrgb8888);
- drm_fb_xrgb8888_to_xrgb2101010(&dst, &result->dst_pitch, &src, &fb, ¶ms->clip);
+ if (result->dst_pitch == TEST_USE_DEFAULT_PITCH)
+ drm_fb_xrgb8888_to_xrgb2101010(&dst, NULL, &src, &fb, ¶ms->clip);
+ else
+ drm_fb_xrgb8888_to_xrgb2101010(&dst, &result->dst_pitch, &src, &fb, ¶ms->clip);
buf = le32buf_to_cpu(test, buf, dst_size / sizeof(u32));
KUNIT_EXPECT_MEMEQ(test, buf, result->expected, dst_size);
}
@@ -815,7 +850,11 @@ static void drm_test_fb_xrgb8888_to_argb2101010(struct kunit *test)
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, xrgb8888);
iosys_map_set_vaddr(&src, xrgb8888);
- drm_fb_xrgb8888_to_argb2101010(&dst, &result->dst_pitch, &src, &fb, ¶ms->clip);
+ if (result->dst_pitch == TEST_USE_DEFAULT_PITCH)
+ drm_fb_xrgb8888_to_argb2101010(&dst, NULL, &src, &fb, ¶ms->clip);
+ else
+ drm_fb_xrgb8888_to_argb2101010(&dst, &result->dst_pitch, &src, &fb, ¶ms->clip);
+
buf = le32buf_to_cpu(test, (__force const __le32 *)buf, dst_size / sizeof(u32));
KUNIT_EXPECT_MEMEQ(test, buf, result->expected, dst_size);
}
@@ -846,7 +885,10 @@ static void drm_test_fb_xrgb8888_to_mono(struct kunit *test)
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, xrgb8888);
iosys_map_set_vaddr(&src, xrgb8888);
- drm_fb_xrgb8888_to_mono(&dst, &result->dst_pitch, &src, &fb, ¶ms->clip);
+ if (result->dst_pitch == TEST_USE_DEFAULT_PITCH)
+ drm_fb_xrgb8888_to_mono(&dst, NULL, &src, &fb, ¶ms->clip);
+ else
+ drm_fb_xrgb8888_to_mono(&dst, &result->dst_pitch, &src, &fb, ¶ms->clip);
KUNIT_EXPECT_MEMEQ(test, buf, result->expected, dst_size);
}