@@ -784,8 +784,8 @@ static int hdmi_generate_spd_infoframe(const struct drm_connector *connector,
return 0;
ret = hdmi_spd_infoframe_init(frame,
- connector->hdmi.vendor,
- connector->hdmi.product);
+ connector->hdmi.funcs->vendor,
+ connector->hdmi.funcs->product);
if (ret)
return ret;
@@ -656,10 +656,6 @@ int drmm_connector_hdmi_init(struct drm_device *dev,
connector->hdmi.max_tmds_char_rate = hdmi_funcs->supported_tmds_char_rate;
}
- /* TODO: remove after conversion to new drmm_connector_hdmi_init() */
- strtomem_pad(connector->hdmi.vendor, hdmi_funcs->vendor, 0);
- strtomem_pad(connector->hdmi.product, hdmi_funcs->product, 0);
-
/*
* drm_connector_attach_max_bpc_property() requires the
* connector to have a state.
@@ -769,14 +769,11 @@ static void drm_test_connector_hdmi_init_null_product(struct kunit *test)
/*
* Test that the registration of a connector with a valid, shorter than
- * the max length, product name succeeds, and is stored padded with 0.
+ * the max length, product name succeeds.
*/
static void drm_test_connector_hdmi_init_product_valid(struct kunit *test)
{
struct drm_connector_init_priv *priv = test->priv;
- const unsigned char expected_product[DRM_CONNECTOR_HDMI_PRODUCT_LEN] = {
- 'P', 'r', 'o', 'd',
- };
struct drm_connector_hdmi_funcs hdmi_funcs = dummy_hdmi_funcs;
int ret;
@@ -790,25 +787,15 @@ static void drm_test_connector_hdmi_init_product_valid(struct kunit *test)
DRM_MODE_CONNECTOR_HDMIA,
&priv->ddc);
KUNIT_EXPECT_EQ(test, ret, 0);
- KUNIT_EXPECT_MEMEQ(test,
- priv->connector.hdmi.product,
- expected_product,
- sizeof(priv->connector.hdmi.product));
}
/*
* Test that the registration of a connector with a valid, at max
- * length, product name succeeds, and is stored padded without any
- * trailing \0.
+ * length, product name succeeds.
*/
static void drm_test_connector_hdmi_init_product_length_exact(struct kunit *test)
{
struct drm_connector_init_priv *priv = test->priv;
- const unsigned char expected_product[DRM_CONNECTOR_HDMI_PRODUCT_LEN] = {
- 'P', 'r', 'o', 'd', 'u', 'c', 't',
- 'P', 'r', 'o', 'd', 'u', 'c', 't',
- 'P', 'r',
- };
struct drm_connector_hdmi_funcs hdmi_funcs = dummy_hdmi_funcs;
int ret;
@@ -822,10 +809,6 @@ static void drm_test_connector_hdmi_init_product_length_exact(struct kunit *test
DRM_MODE_CONNECTOR_HDMIA,
&priv->ddc);
KUNIT_EXPECT_EQ(test, ret, 0);
- KUNIT_EXPECT_MEMEQ(test,
- priv->connector.hdmi.product,
- expected_product,
- sizeof(priv->connector.hdmi.product));
}
/*
@@ -852,14 +835,11 @@ static void drm_test_connector_hdmi_init_product_length_too_long(struct kunit *t
/*
* Test that the registration of a connector with a vendor name smaller
- * than the maximum length succeeds, and is stored padded with zeros.
+ * than the maximum length succeeds.
*/
static void drm_test_connector_hdmi_init_vendor_valid(struct kunit *test)
{
struct drm_connector_init_priv *priv = test->priv;
- const char expected_vendor[DRM_CONNECTOR_HDMI_VENDOR_LEN] = {
- 'V', 'e', 'n', 'd',
- };
struct drm_connector_hdmi_funcs hdmi_funcs = dummy_hdmi_funcs;
int ret;
@@ -873,24 +853,15 @@ static void drm_test_connector_hdmi_init_vendor_valid(struct kunit *test)
DRM_MODE_CONNECTOR_HDMIA,
&priv->ddc);
KUNIT_EXPECT_EQ(test, ret, 0);
- KUNIT_EXPECT_MEMEQ(test,
- priv->connector.hdmi.vendor,
- expected_vendor,
- sizeof(priv->connector.hdmi.vendor));
}
/*
* Test that the registration of a connector with a vendor name at the
- * maximum length succeeds, and is stored padded without the trailing
- * zero.
+ * maximum length succeeds.
*/
static void drm_test_connector_hdmi_init_vendor_length_exact(struct kunit *test)
{
struct drm_connector_init_priv *priv = test->priv;
- const char expected_vendor[DRM_CONNECTOR_HDMI_VENDOR_LEN] = {
- 'V', 'e', 'n', 'd', 'o', 'r',
- 'V', 'e',
- };
struct drm_connector_hdmi_funcs hdmi_funcs = dummy_hdmi_funcs;
int ret;
@@ -904,10 +875,6 @@ static void drm_test_connector_hdmi_init_vendor_length_exact(struct kunit *test)
DRM_MODE_CONNECTOR_HDMIA,
&priv->ddc);
KUNIT_EXPECT_EQ(test, ret, 0);
- KUNIT_EXPECT_MEMEQ(test,
- priv->connector.hdmi.vendor,
- expected_vendor,
- sizeof(priv->connector.hdmi.vendor));
}
/*
@@ -1418,11 +1418,13 @@ struct drm_connector_infoframe_funcs {
* and controller capabilities
*/
struct drm_connector_hdmi_funcs {
+#define DRM_CONNECTOR_HDMI_VENDOR_LEN 8
/**
* @vendor: HDMI Controller Vendor name.
*/
const char *vendor;
+#define DRM_CONNECTOR_HDMI_PRODUCT_LEN 16
/**
* @product: HDMI Controller Product name
*/
@@ -2117,18 +2119,6 @@ struct drm_connector_hdmi_audio {
* struct drm_connector_hdmi - DRM Connector HDMI-related structure
*/
struct drm_connector_hdmi {
-#define DRM_CONNECTOR_HDMI_VENDOR_LEN 8
- /**
- * @vendor: HDMI Controller Vendor Name
- */
- unsigned char vendor[DRM_CONNECTOR_HDMI_VENDOR_LEN] __nonstring;
-
-#define DRM_CONNECTOR_HDMI_PRODUCT_LEN 16
- /**
- * @product: HDMI Controller Product Name
- */
- unsigned char product[DRM_CONNECTOR_HDMI_PRODUCT_LEN] __nonstring;
-
/**
* @supported_formats: Bitmask of @drm_output_color_format
* supported by the controller.