From patchwork Tue Nov 7 10:25:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip Cox X-Patchwork-Id: 1860927 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SPkt55mfyz1yQg for ; Tue, 7 Nov 2023 21:27:09 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1r0JIX-0005wz-8n; Tue, 07 Nov 2023 10:27:05 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1r0JIR-0005ut-3Q for kernel-team@lists.ubuntu.com; Tue, 07 Nov 2023 10:26:59 +0000 Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id DAA453F193 for ; Tue, 7 Nov 2023 10:26:58 +0000 (UTC) Received: by mail-lj1-f197.google.com with SMTP id 38308e7fff4ca-2c503804667so59961851fa.0 for ; Tue, 07 Nov 2023 02:26:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699352818; x=1699957618; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FQAdMHOruni6iK4mOY5jp9JJ4XEr/CiUSpjOtFOHczY=; b=SOO2eV35Irn9h6TWA5PryHHCaUqeMzLQqdqOfbC/qyhqv3+CCWiTiAF3bc/ydcvcsT z+JERuvpNTHKLtkeBN97MTld3+ydpqlssvxmYTkzqb2Xba9T1AavWSqvQ9gO++6awO0o KCnR7+ze4Y0qcobq3NVAmoxF/E4NBGis9DObvjKxBssCOnw/HNXsgTa3LsTRMOyeKaXY Giw/l21c2hIOFggIqyhTNnncvVxPGUEjComzRep88IwtFSgFK+CI2u+Tk938yxDWPKq/ FSADuJHd0okENs0c9VhsuKWubuc5U+A+v1Q2QrHOei3R+O7TH4snajxtqKzXpSK0TOmv G2Sg== X-Gm-Message-State: AOJu0YzdjQWQZemuIxGstLe+YfQxtx3JUpBE4h7dY1pOlVDiS2AJ//2Q aXdUx4MqT1d2k3RAykPUUBR8Don4AJD33hbo61M82o8IPy6Yc/sObLxRbX4+nVnxMJs+oHpWrdt WIc7RjKCfG4qxr24IM2daG0zPrS0arraf2kIIlHV2CMAT0w8P6wwM X-Received: by 2002:a2e:a7d2:0:b0:2b9:4b2e:5420 with SMTP id x18-20020a2ea7d2000000b002b94b2e5420mr32029811ljp.52.1699352817779; Tue, 07 Nov 2023 02:26:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IHIrXL2TvKiN3n7zynY/+65HjMQ1vFChc1kkmu3PHSFiZ9mJh9CdzeWld/O1r9UDpanGJdUxQ== X-Received: by 2002:a2e:a7d2:0:b0:2b9:4b2e:5420 with SMTP id x18-20020a2ea7d2000000b002b94b2e5420mr32029794ljp.52.1699352817388; Tue, 07 Nov 2023 02:26:57 -0800 (PST) Received: from cox.conference ([195.13.248.78]) by smtp.gmail.com with ESMTPSA id s16-20020a2e83d0000000b002b9e0d19644sm1395369ljh.106.2023.11.07.02.26.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Nov 2023 02:26:54 -0800 (PST) From: Philip Cox To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/1] UBUNTU: SAUCE: (no-up) Revert "drm/ast: report connection status on Display Port." Date: Tue, 7 Nov 2023 12:25:46 +0200 Message-Id: <20231107102546.39000-2-philip.cox@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231107102546.39000-1-philip.cox@canonical.com> References: <20231107102546.39000-1-philip.cox@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: http://bugs.launchpad.net/bugs/2042850 On Aspeed 2600 rev52 GPU systems, the display fails to work without "nomodeset" due to the commit 916ae609a033cbb55661905d310ba2358b7621ea. This needs to be reverted until this is fixed upstream. This reverts commit 916ae609a033cbb55661905d310ba2358b7621ea. commit 916ae609a033cbb55661905d310ba2358b7621ea Author: Jocelyn Falempe Date: Thu Jul 13 15:41:31 2023 +0200 drm/ast: report connection status on Display Port. BugLink: https://bugs.launchpad.net/bugs/2035588 [ Upstream commit f81bb0ac7872893241319ea82504956676ef02fd ] Aspeed always report the display port as "connected", because it doesn't set a .detect_ctx callback. Fix this by providing the proper detect callback for astdp and dp501. This also fixes the following regression: Since commit fae7d186403e ("drm/probe-helper: Default to 640x480 if no EDID on DP") The default resolution is now 640x480 when no monitor is connected. But Aspeed graphics is mostly used in servers, where no monitor is attached. This also affects the remote BMC resolution to 640x480, which is inconvenient, and breaks the anaconda installer. v2: Add .detect callback to the dp/dp501 connector (Jani Nikula) v3: Use .detect_ctx callback, and refactors (Thomas Zimmermann) Add a BMC virtual connector v4: Better indent detect_ctx() functions (Thomas Zimmermann) v5: Enable polling of the dp and dp501 connector status (Thomas Zimmermann) v6: Change check order in ast_astdp_is_connected (Jammy Huang) Fixes: fae7d186403e ("drm/probe-helper: Default to 640x480 if no EDID on DP") Signed-off-by: Jocelyn Falempe Reviewed-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20230713134316.332502-2-jfalempe@redhat.com Signed-off-by: Sasha Levin Signed-off-by: Andrea Righi Signed-off-by: Philip Cox --- drivers/gpu/drm/ast/ast_dp.c | 11 ---------- drivers/gpu/drm/ast/ast_dp501.c | 37 +++++++++++---------------------- drivers/gpu/drm/ast/ast_drv.h | 2 -- drivers/gpu/drm/ast/ast_mode.c | 30 ++------------------------ 4 files changed, 14 insertions(+), 66 deletions(-) diff --git a/drivers/gpu/drm/ast/ast_dp.c b/drivers/gpu/drm/ast/ast_dp.c index fdd9a493aa9c..6dc1a09504e1 100644 --- a/drivers/gpu/drm/ast/ast_dp.c +++ b/drivers/gpu/drm/ast/ast_dp.c @@ -7,17 +7,6 @@ #include #include "ast_drv.h" -bool ast_astdp_is_connected(struct ast_device *ast) -{ - if (!ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xD1, ASTDP_MCU_FW_EXECUTING)) - return false; - if (!ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xDF, ASTDP_HPD)) - return false; - if (!ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xDC, ASTDP_LINK_SUCCESS)) - return false; - return true; -} - int ast_astdp_read_edid(struct drm_device *dev, u8 *ediddata) { struct ast_device *ast = to_ast_device(dev); diff --git a/drivers/gpu/drm/ast/ast_dp501.c b/drivers/gpu/drm/ast/ast_dp501.c index fa7442b0c261..1bc35a992369 100644 --- a/drivers/gpu/drm/ast/ast_dp501.c +++ b/drivers/gpu/drm/ast/ast_dp501.c @@ -272,9 +272,11 @@ static bool ast_launch_m68k(struct drm_device *dev) return true; } -bool ast_dp501_is_connected(struct ast_device *ast) +bool ast_dp501_read_edid(struct drm_device *dev, u8 *ediddata) { - u32 boot_address, offset, data; + struct ast_device *ast = to_ast_device(dev); + u32 i, boot_address, offset, data; + u32 *pEDIDidx; if (ast->config_mode == ast_use_p2a) { boot_address = get_fw_base(ast); @@ -290,6 +292,14 @@ bool ast_dp501_is_connected(struct ast_device *ast) data = ast_mindwm(ast, boot_address + offset); if (!(data & AST_DP501_PNP_CONNECTED)) return false; + + /* Read EDID */ + offset = AST_DP501_EDID_DATA; + for (i = 0; i < 128; i += 4) { + data = ast_mindwm(ast, boot_address + offset + i); + pEDIDidx = (u32 *)(ediddata + i); + *pEDIDidx = data; + } } else { if (!ast->dp501_fw_buf) return false; @@ -309,30 +319,7 @@ bool ast_dp501_is_connected(struct ast_device *ast) data = readl(ast->dp501_fw_buf + offset); if (!(data & AST_DP501_PNP_CONNECTED)) return false; - } - return true; -} - -bool ast_dp501_read_edid(struct drm_device *dev, u8 *ediddata) -{ - struct ast_device *ast = to_ast_device(dev); - u32 i, boot_address, offset, data; - u32 *pEDIDidx; - - if (!ast_dp501_is_connected(ast)) - return false; - - if (ast->config_mode == ast_use_p2a) { - boot_address = get_fw_base(ast); - /* Read EDID */ - offset = AST_DP501_EDID_DATA; - for (i = 0; i < 128; i += 4) { - data = ast_mindwm(ast, boot_address + offset + i); - pEDIDidx = (u32 *)(ediddata + i); - *pEDIDidx = data; - } - } else { /* Read EDID */ offset = AST_DP501_EDID_DATA; for (i = 0; i < 128; i += 4) { diff --git a/drivers/gpu/drm/ast/ast_drv.h b/drivers/gpu/drm/ast/ast_drv.h index 8a0ffa8b5939..5498a6676f2e 100644 --- a/drivers/gpu/drm/ast/ast_drv.h +++ b/drivers/gpu/drm/ast/ast_drv.h @@ -468,7 +468,6 @@ void ast_patch_ahb_2500(struct ast_device *ast); /* ast dp501 */ void ast_set_dp501_video_output(struct drm_device *dev, u8 mode); bool ast_backup_fw(struct drm_device *dev, u8 *addr, u32 size); -bool ast_dp501_is_connected(struct ast_device *ast); bool ast_dp501_read_edid(struct drm_device *dev, u8 *ediddata); u8 ast_get_dp501_max_clk(struct drm_device *dev); void ast_init_3rdtx(struct drm_device *dev); @@ -477,7 +476,6 @@ void ast_init_3rdtx(struct drm_device *dev); struct ast_i2c_chan *ast_i2c_create(struct drm_device *dev); /* aspeed DP */ -bool ast_astdp_is_connected(struct ast_device *ast); int ast_astdp_read_edid(struct drm_device *dev, u8 *ediddata); void ast_dp_launch(struct drm_device *dev); void ast_dp_power_on_off(struct drm_device *dev, bool no); diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c index 0724516f2973..b3c670af6ef2 100644 --- a/drivers/gpu/drm/ast/ast_mode.c +++ b/drivers/gpu/drm/ast/ast_mode.c @@ -1585,20 +1585,8 @@ static int ast_dp501_connector_helper_get_modes(struct drm_connector *connector) return 0; } -static int ast_dp501_connector_helper_detect_ctx(struct drm_connector *connector, - struct drm_modeset_acquire_ctx *ctx, - bool force) -{ - struct ast_device *ast = to_ast_device(connector->dev); - - if (ast_dp501_is_connected(ast)) - return connector_status_connected; - return connector_status_disconnected; -} - static const struct drm_connector_helper_funcs ast_dp501_connector_helper_funcs = { .get_modes = ast_dp501_connector_helper_get_modes, - .detect_ctx = ast_dp501_connector_helper_detect_ctx, }; static const struct drm_connector_funcs ast_dp501_connector_funcs = { @@ -1623,7 +1611,7 @@ static int ast_dp501_connector_init(struct drm_device *dev, struct drm_connector connector->interlace_allowed = 0; connector->doublescan_allowed = 0; - connector->polled = DRM_CONNECTOR_POLL_CONNECT | DRM_CONNECTOR_POLL_DISCONNECT; + connector->polled = DRM_CONNECTOR_POLL_CONNECT; return 0; } @@ -1695,20 +1683,8 @@ static int ast_astdp_connector_helper_get_modes(struct drm_connector *connector) return 0; } -static int ast_astdp_connector_helper_detect_ctx(struct drm_connector *connector, - struct drm_modeset_acquire_ctx *ctx, - bool force) -{ - struct ast_device *ast = to_ast_device(connector->dev); - - if (ast_astdp_is_connected(ast)) - return connector_status_connected; - return connector_status_disconnected; -} - static const struct drm_connector_helper_funcs ast_astdp_connector_helper_funcs = { .get_modes = ast_astdp_connector_helper_get_modes, - .detect_ctx = ast_astdp_connector_helper_detect_ctx, }; static const struct drm_connector_funcs ast_astdp_connector_funcs = { @@ -1733,7 +1709,7 @@ static int ast_astdp_connector_init(struct drm_device *dev, struct drm_connector connector->interlace_allowed = 0; connector->doublescan_allowed = 0; - connector->polled = DRM_CONNECTOR_POLL_CONNECT | DRM_CONNECTOR_POLL_DISCONNECT; + connector->polled = DRM_CONNECTOR_POLL_CONNECT; return 0; } @@ -1872,7 +1848,5 @@ int ast_mode_config_init(struct ast_device *ast) drm_mode_config_reset(dev); - drm_kms_helper_poll_init(dev); - return 0; }