mirror of
https://github.com/torvalds/linux.git
synced 2026-04-26 18:42:25 -04:00
drm/connector: hdmi: Add support for output format
Just like BPC, we'll add support for automatic selection of the output format for HDMI connectors. Let's add the needed defaults and fields for now. Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20240527-kms-hdmi-connector-state-v15-7-c5af16c3aae2@kernel.org Signed-off-by: Maxime Ripard <mripard@kernel.org>
This commit is contained in:
@@ -187,6 +187,7 @@ static void drm_test_connector_hdmi_init_valid(struct kunit *test)
|
||||
&dummy_funcs,
|
||||
DRM_MODE_CONNECTOR_HDMIA,
|
||||
&priv->ddc,
|
||||
BIT(HDMI_COLORSPACE_RGB),
|
||||
8);
|
||||
KUNIT_EXPECT_EQ(test, ret, 0);
|
||||
}
|
||||
@@ -204,6 +205,7 @@ static void drm_test_connector_hdmi_init_null_ddc(struct kunit *test)
|
||||
&dummy_funcs,
|
||||
DRM_MODE_CONNECTOR_HDMIA,
|
||||
NULL,
|
||||
BIT(HDMI_COLORSPACE_RGB),
|
||||
8);
|
||||
KUNIT_EXPECT_EQ(test, ret, 0);
|
||||
}
|
||||
@@ -221,6 +223,7 @@ static void drm_test_connector_hdmi_init_bpc_invalid(struct kunit *test)
|
||||
&dummy_funcs,
|
||||
DRM_MODE_CONNECTOR_HDMIA,
|
||||
&priv->ddc,
|
||||
BIT(HDMI_COLORSPACE_RGB),
|
||||
9);
|
||||
KUNIT_EXPECT_LT(test, ret, 0);
|
||||
}
|
||||
@@ -238,6 +241,7 @@ static void drm_test_connector_hdmi_init_bpc_null(struct kunit *test)
|
||||
&dummy_funcs,
|
||||
DRM_MODE_CONNECTOR_HDMIA,
|
||||
&priv->ddc,
|
||||
BIT(HDMI_COLORSPACE_RGB),
|
||||
0);
|
||||
KUNIT_EXPECT_LT(test, ret, 0);
|
||||
}
|
||||
@@ -260,6 +264,7 @@ static void drm_test_connector_hdmi_init_bpc_8(struct kunit *test)
|
||||
&dummy_funcs,
|
||||
DRM_MODE_CONNECTOR_HDMIA,
|
||||
&priv->ddc,
|
||||
BIT(HDMI_COLORSPACE_RGB),
|
||||
8);
|
||||
KUNIT_EXPECT_EQ(test, ret, 0);
|
||||
|
||||
@@ -298,6 +303,7 @@ static void drm_test_connector_hdmi_init_bpc_10(struct kunit *test)
|
||||
&dummy_funcs,
|
||||
DRM_MODE_CONNECTOR_HDMIA,
|
||||
&priv->ddc,
|
||||
BIT(HDMI_COLORSPACE_RGB),
|
||||
10);
|
||||
KUNIT_EXPECT_EQ(test, ret, 0);
|
||||
|
||||
@@ -336,6 +342,7 @@ static void drm_test_connector_hdmi_init_bpc_12(struct kunit *test)
|
||||
&dummy_funcs,
|
||||
DRM_MODE_CONNECTOR_HDMIA,
|
||||
&priv->ddc,
|
||||
BIT(HDMI_COLORSPACE_RGB),
|
||||
12);
|
||||
KUNIT_EXPECT_EQ(test, ret, 0);
|
||||
|
||||
@@ -370,6 +377,7 @@ static void drm_test_connector_hdmi_init_type_valid(struct kunit *test)
|
||||
&dummy_funcs,
|
||||
connector_type,
|
||||
&priv->ddc,
|
||||
BIT(HDMI_COLORSPACE_RGB),
|
||||
8);
|
||||
KUNIT_EXPECT_EQ(test, ret, 0);
|
||||
}
|
||||
@@ -402,6 +410,7 @@ static void drm_test_connector_hdmi_init_type_invalid(struct kunit *test)
|
||||
&dummy_funcs,
|
||||
connector_type,
|
||||
&priv->ddc,
|
||||
BIT(HDMI_COLORSPACE_RGB),
|
||||
8);
|
||||
KUNIT_EXPECT_LT(test, ret, 0);
|
||||
}
|
||||
|
||||
@@ -149,6 +149,7 @@ static const struct drm_connector_funcs dummy_connector_funcs = {
|
||||
static
|
||||
struct drm_atomic_helper_connector_hdmi_priv *
|
||||
drm_atomic_helper_connector_hdmi_init(struct kunit *test,
|
||||
unsigned int formats,
|
||||
unsigned int max_bpc)
|
||||
{
|
||||
struct drm_atomic_helper_connector_hdmi_priv *priv;
|
||||
@@ -192,6 +193,7 @@ drm_atomic_helper_connector_hdmi_init(struct kunit *test,
|
||||
&dummy_connector_funcs,
|
||||
DRM_MODE_CONNECTOR_HDMIA,
|
||||
NULL,
|
||||
formats,
|
||||
max_bpc);
|
||||
KUNIT_ASSERT_EQ(test, ret, 0);
|
||||
|
||||
@@ -227,7 +229,9 @@ static void drm_test_check_output_bpc_crtc_mode_changed(struct kunit *test)
|
||||
struct drm_crtc *crtc;
|
||||
int ret;
|
||||
|
||||
priv = drm_atomic_helper_connector_hdmi_init(test, 10);
|
||||
priv = drm_atomic_helper_connector_hdmi_init(test,
|
||||
BIT(HDMI_COLORSPACE_RGB),
|
||||
10);
|
||||
KUNIT_ASSERT_NOT_NULL(test, priv);
|
||||
|
||||
ctx = drm_kunit_helper_acquire_ctx_alloc(test);
|
||||
@@ -294,7 +298,9 @@ static void drm_test_check_output_bpc_crtc_mode_not_changed(struct kunit *test)
|
||||
struct drm_crtc *crtc;
|
||||
int ret;
|
||||
|
||||
priv = drm_atomic_helper_connector_hdmi_init(test, 10);
|
||||
priv = drm_atomic_helper_connector_hdmi_init(test,
|
||||
BIT(HDMI_COLORSPACE_RGB),
|
||||
10);
|
||||
KUNIT_ASSERT_NOT_NULL(test, priv);
|
||||
|
||||
ctx = drm_kunit_helper_acquire_ctx_alloc(test);
|
||||
@@ -363,7 +369,9 @@ static void drm_test_check_bpc_8_value(struct kunit *test)
|
||||
struct drm_connector_state *conn_state;
|
||||
struct drm_connector *conn;
|
||||
|
||||
priv = drm_atomic_helper_connector_hdmi_init(test, 8);
|
||||
priv = drm_atomic_helper_connector_hdmi_init(test,
|
||||
BIT(HDMI_COLORSPACE_RGB),
|
||||
8);
|
||||
KUNIT_ASSERT_NOT_NULL(test, priv);
|
||||
|
||||
conn = &priv->connector;
|
||||
@@ -385,7 +393,9 @@ static void drm_test_check_bpc_10_value(struct kunit *test)
|
||||
struct drm_connector_state *conn_state;
|
||||
struct drm_connector *conn;
|
||||
|
||||
priv = drm_atomic_helper_connector_hdmi_init(test, 10);
|
||||
priv = drm_atomic_helper_connector_hdmi_init(test,
|
||||
BIT(HDMI_COLORSPACE_RGB),
|
||||
10);
|
||||
KUNIT_ASSERT_NOT_NULL(test, priv);
|
||||
|
||||
conn = &priv->connector;
|
||||
@@ -407,7 +417,9 @@ static void drm_test_check_bpc_12_value(struct kunit *test)
|
||||
struct drm_connector_state *conn_state;
|
||||
struct drm_connector *conn;
|
||||
|
||||
priv = drm_atomic_helper_connector_hdmi_init(test, 12);
|
||||
priv = drm_atomic_helper_connector_hdmi_init(test,
|
||||
BIT(HDMI_COLORSPACE_RGB),
|
||||
12);
|
||||
KUNIT_ASSERT_NOT_NULL(test, priv);
|
||||
|
||||
conn = &priv->connector;
|
||||
|
||||
Reference in New Issue
Block a user