mirror of
https://github.com/Dasharo/linux.git
synced 2026-03-06 15:25:10 -08:00
Merge v6.13 into drm-next
A regression was caused by commite4b5ccd392("drm/v3d: Ensure job pointer is set to NULL after job completion"), but this commit is not yet in next-fixes, fast-forward it. Note that this recreates Linus merge in96c84703f1("Merge tag 'drm-next-2025-01-17' of https://gitlab.freedesktop.org/drm/kernel") because I didn't want to backmerge a random point in the merge window. Signed-off-by: Simona Vetter <simona.vetter@ffwll.ch>
This commit is contained in:
@@ -1095,6 +1095,64 @@ static void drm_test_connector_hdmi_init_formats_no_rgb(struct kunit *test)
|
||||
KUNIT_EXPECT_LT(test, ret, 0);
|
||||
}
|
||||
|
||||
struct drm_connector_hdmi_init_formats_yuv420_allowed_test {
|
||||
unsigned long supported_formats;
|
||||
bool yuv420_allowed;
|
||||
int expected_result;
|
||||
};
|
||||
|
||||
#define YUV420_ALLOWED_TEST(_formats, _allowed, _result) \
|
||||
{ \
|
||||
.supported_formats = BIT(HDMI_COLORSPACE_RGB) | (_formats), \
|
||||
.yuv420_allowed = _allowed, \
|
||||
.expected_result = _result, \
|
||||
}
|
||||
|
||||
static const struct drm_connector_hdmi_init_formats_yuv420_allowed_test
|
||||
drm_connector_hdmi_init_formats_yuv420_allowed_tests[] = {
|
||||
YUV420_ALLOWED_TEST(BIT(HDMI_COLORSPACE_YUV420), true, 0),
|
||||
YUV420_ALLOWED_TEST(BIT(HDMI_COLORSPACE_YUV420), false, -EINVAL),
|
||||
YUV420_ALLOWED_TEST(BIT(HDMI_COLORSPACE_YUV422), true, -EINVAL),
|
||||
YUV420_ALLOWED_TEST(BIT(HDMI_COLORSPACE_YUV422), false, 0),
|
||||
};
|
||||
|
||||
static void
|
||||
drm_connector_hdmi_init_formats_yuv420_allowed_desc(const struct drm_connector_hdmi_init_formats_yuv420_allowed_test *t,
|
||||
char *desc)
|
||||
{
|
||||
sprintf(desc, "supported_formats=0x%lx yuv420_allowed=%d",
|
||||
t->supported_formats, t->yuv420_allowed);
|
||||
}
|
||||
|
||||
KUNIT_ARRAY_PARAM(drm_connector_hdmi_init_formats_yuv420_allowed,
|
||||
drm_connector_hdmi_init_formats_yuv420_allowed_tests,
|
||||
drm_connector_hdmi_init_formats_yuv420_allowed_desc);
|
||||
|
||||
/*
|
||||
* Test that the registration of an HDMI connector succeeds only when
|
||||
* the presence of YUV420 in the supported formats matches the value
|
||||
* of the ycbcr_420_allowed flag.
|
||||
*/
|
||||
static void drm_test_connector_hdmi_init_formats_yuv420_allowed(struct kunit *test)
|
||||
{
|
||||
const struct drm_connector_hdmi_init_formats_yuv420_allowed_test *params;
|
||||
struct drm_connector_init_priv *priv = test->priv;
|
||||
int ret;
|
||||
|
||||
params = test->param_value;
|
||||
priv->connector.ycbcr_420_allowed = params->yuv420_allowed;
|
||||
|
||||
ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector,
|
||||
"Vendor", "Product",
|
||||
&dummy_funcs,
|
||||
&dummy_hdmi_funcs,
|
||||
DRM_MODE_CONNECTOR_HDMIA,
|
||||
&priv->ddc,
|
||||
params->supported_formats,
|
||||
8);
|
||||
KUNIT_EXPECT_EQ(test, ret, params->expected_result);
|
||||
}
|
||||
|
||||
/*
|
||||
* Test that the registration of an HDMI connector with an HDMI
|
||||
* connector type succeeds.
|
||||
@@ -1186,6 +1244,8 @@ static struct kunit_case drmm_connector_hdmi_init_tests[] = {
|
||||
KUNIT_CASE(drm_test_connector_hdmi_init_bpc_null),
|
||||
KUNIT_CASE(drm_test_connector_hdmi_init_formats_empty),
|
||||
KUNIT_CASE(drm_test_connector_hdmi_init_formats_no_rgb),
|
||||
KUNIT_CASE_PARAM(drm_test_connector_hdmi_init_formats_yuv420_allowed,
|
||||
drm_connector_hdmi_init_formats_yuv420_allowed_gen_params),
|
||||
KUNIT_CASE(drm_test_connector_hdmi_init_null_ddc),
|
||||
KUNIT_CASE(drm_test_connector_hdmi_init_null_product),
|
||||
KUNIT_CASE(drm_test_connector_hdmi_init_null_vendor),
|
||||
|
||||
@@ -320,8 +320,7 @@ static void kunit_action_drm_mode_destroy(void *ptr)
|
||||
}
|
||||
|
||||
/**
|
||||
* drm_kunit_display_mode_from_cea_vic() - return a mode for CEA VIC
|
||||
for a KUnit test
|
||||
* drm_kunit_display_mode_from_cea_vic() - return a mode for CEA VIC for a KUnit test
|
||||
* @test: The test context object
|
||||
* @dev: DRM device
|
||||
* @video_code: CEA VIC of the mode
|
||||
|
||||
Reference in New Issue
Block a user