Check that connector initialized by drmm_connector_hdmi_init() supports
AVI InfoFrames and warn if it doesn't support Vendor-Specific
InfofRames (HDMI InfoFrames are more or less required).
Suggested-by: Maxime Ripard <mripard@kernel.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/gpu/drm/drm_connector.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
index f031e8f8df57da15bb0f8fe21fd62f02a1576ebe..12ee06bad364183ad56a20b2bf9860491913a295 100644
--- a/drivers/gpu/drm/drm_connector.c
+++ b/drivers/gpu/drm/drm_connector.c
@@ -582,6 +582,7 @@ int drmm_connector_hdmi_init(struct drm_device *dev,
unsigned long autogenerated_infoframes,
unsigned int max_bpc)
{
+ unsigned long supported_infoframes;
int ret;
if (!vendor || !product)
@@ -604,6 +605,15 @@ int drmm_connector_hdmi_init(struct drm_device *dev,
if (!(max_bpc == 8 || max_bpc == 10 || max_bpc == 12))
return -EINVAL;
+ supported_infoframes = software_infoframes | autogenerated_infoframes;
+
+ /* AVI is required */
+ if (!(supported_infoframes & DRM_CONNECTOR_INFOFRAME_AVI))
+ return -EINVAL;
+
+ if (!(supported_infoframes & DRM_CONNECTOR_INFOFRAME_VENDOR))
+ drm_info(dev, "HDMI conneector with no support for Vendor-Specific InfoFrame\n");
+
ret = drmm_connector_init(dev, connector, funcs, connector_type, ddc);
if (ret)
return ret;
--
2.47.2