[PATCH] drm/ast: Fix default resolution on BMC when DP is not connected

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

 



The physical_status of ast_dp is not reliable, as it reports as
connected even when no monitor is connected. This makes the default
BMC resolution to be 640x480 for remote access.
So consider that if there is no edid, no monitor is connected, and
add the BMC 1024x768 default resolution.
I've debugged this regression on ast_dp, but as dp501 is similar, I
fixed both in this patch.

This regression was likely introduced by commit 2281475168d2
("drm/ast: astdp: Perform link training during atomic_enable")
But I fixed it in the BMC get_modes handling.

Signed-off-by: Jocelyn Falempe <jfalempe@xxxxxxxxxx>
Fixes: bbad0090b9f4 ("drm/ast: astdp: Transparently handle BMC support")
---
 drivers/gpu/drm/ast/ast_dp.c    | 14 +++++++-------
 drivers/gpu/drm/ast/ast_dp501.c | 14 +++++++-------
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/ast/ast_dp.c b/drivers/gpu/drm/ast/ast_dp.c
index 0e282b7b167c..6c8ea95a2230 100644
--- a/drivers/gpu/drm/ast/ast_dp.c
+++ b/drivers/gpu/drm/ast/ast_dp.c
@@ -361,19 +361,19 @@ static const struct drm_encoder_helper_funcs ast_astdp_encoder_helper_funcs = {
 static int ast_astdp_connector_helper_get_modes(struct drm_connector *connector)
 {
 	struct ast_connector *ast_connector = to_ast_connector(connector);
+	struct ast_device *ast = to_ast_device(connector->dev);
+	const struct drm_edid *drm_edid = NULL;
 	int count;
 
-	if (ast_connector->physical_status == connector_status_connected) {
-		struct ast_device *ast = to_ast_device(connector->dev);
-		const struct drm_edid *drm_edid;
-
+	if (ast_connector->physical_status == connector_status_connected)
 		drm_edid = drm_edid_read_custom(connector, ast_astdp_read_edid_block, ast);
-		drm_edid_connector_update(connector, drm_edid);
+
+	drm_edid_connector_update(connector, drm_edid);
+
+	if (drm_edid) {
 		count = drm_edid_connector_add_modes(connector);
 		drm_edid_free(drm_edid);
 	} else {
-		drm_edid_connector_update(connector, NULL);
-
 		/*
 		 * There's no EDID data without a connected monitor. Set BMC-
 		 * compatible modes in this case. The XGA default resolution
diff --git a/drivers/gpu/drm/ast/ast_dp501.c b/drivers/gpu/drm/ast/ast_dp501.c
index 9e19d8c17730..c92db65e3f20 100644
--- a/drivers/gpu/drm/ast/ast_dp501.c
+++ b/drivers/gpu/drm/ast/ast_dp501.c
@@ -504,19 +504,19 @@ static const struct drm_encoder_helper_funcs ast_dp501_encoder_helper_funcs = {
 static int ast_dp501_connector_helper_get_modes(struct drm_connector *connector)
 {
 	struct ast_connector *ast_connector = to_ast_connector(connector);
+	struct ast_device *ast = to_ast_device(connector->dev);
+	const struct drm_edid *drm_edid = NULL;
 	int count;
 
-	if (ast_connector->physical_status == connector_status_connected) {
-		struct ast_device *ast = to_ast_device(connector->dev);
-		const struct drm_edid *drm_edid;
-
+	if (ast_connector->physical_status == connector_status_connected)
 		drm_edid = drm_edid_read_custom(connector, ast_dp512_read_edid_block, ast);
-		drm_edid_connector_update(connector, drm_edid);
+
+	drm_edid_connector_update(connector, drm_edid);
+
+	if (drm_edid) {
 		count = drm_edid_connector_add_modes(connector);
 		drm_edid_free(drm_edid);
 	} else {
-		drm_edid_connector_update(connector, NULL);
-
 		/*
 		 * There's no EDID data without a connected monitor. Set BMC-
 		 * compatible modes in this case. The XGA default resolution

base-commit: 798047e63ac970f105c49c22e6d44df901c486b2
-- 
2.47.1




[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