[PATCH] drm/bridge: sii902x: Fall back to standard modes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The following happens when connection a DVI output driven
from the SiI9022 using a DVI-to-VGA adapter plug:

i2c i2c-0: sendbytes: NAK bailout.
i2c i2c-0: sendbytes: NAK bailout.

Then no picture. Apparently the I2C engine inside the SiI9022
is not smart enough to try to fall back to DDC I2C. Or the
vendor have not integrated the electronics properly. I don't
know which one it is.

By using standard modes as fallback, the bridge probes nicely
with a minor warning and we get picture.

This code is inspired by similar code in the dumb VGA bridge.

Signed-off-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
---
 drivers/gpu/drm/bridge/sii902x.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c
index b1ab4ab09532..4483095c4013 100644
--- a/drivers/gpu/drm/bridge/sii902x.c
+++ b/drivers/gpu/drm/bridge/sii902x.c
@@ -168,8 +168,19 @@ static int sii902x_get_modes(struct drm_connector *connector)
 		return ret;
 
 	edid = drm_get_edid(connector, sii902x->i2c->adapter);
-	drm_mode_connector_update_edid_property(connector, edid);
-	if (edid) {
+	if (!edid) {
+		/*
+		 * This happens when using a simple DVI-to-VGA converter
+		 * dongle for example: the I2C lines are not bridged over
+		 * to VGA DDC.
+		 */
+		DRM_INFO("EDID readout failed, falling back to standard modes\n");
+		ret = drm_add_modes_noedid(connector, 1920, 1080);
+		/* Set some standard resolution most monitors can handle */
+		drm_set_preferred_mode(connector, 1024, 768);
+	} else {
+		/* Data from EDID readout */
+		drm_mode_connector_update_edid_property(connector, edid);
 		num = drm_add_edid_modes(connector, edid);
 		kfree(edid);
 	}
-- 
2.14.3

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux