From patchwork Mon Jul 15 09:38:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13733178 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B8CD7C3DA59 for ; Mon, 15 Jul 2024 09:39:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E70DC10E1EF; Mon, 15 Jul 2024 09:39:55 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.b="qPoNWcA6"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="iUXnRE0L"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="qPoNWcA6"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="iUXnRE0L"; dkim-atps=neutral Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9A0CD10E1EF for ; Mon, 15 Jul 2024 09:39:48 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 618EB21B4F; Mon, 15 Jul 2024 09:39:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1721036386; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mUJYt0YFpnzi6c/1zXmO1ITb+dAIghKzV6hQxSwURQU=; b=qPoNWcA6UhxkGZXRW+SEBVVb6Qt2Lxi52OEBaWvLrUc3eXRWW9wv76REVKds5q16Emzy7S cDwtqmFR875UCSyUVI8+iJ+HCTDPYf0zbOOxd1+y0TwbMMFRhcIvUW7bVKECpjW3uk+Wjf XUbMm4lLSeMxhfKmvIaTWGZG9ax++zk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1721036386; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mUJYt0YFpnzi6c/1zXmO1ITb+dAIghKzV6hQxSwURQU=; b=iUXnRE0LIeVgClj9iZXFyaPMk9WrDr7iYRJowcwp6dYNJ7gKeAVg2vk16JskbV3C3dXvtg dFFC6SASrjZ6FDAA== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=qPoNWcA6; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=iUXnRE0L DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1721036386; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mUJYt0YFpnzi6c/1zXmO1ITb+dAIghKzV6hQxSwURQU=; b=qPoNWcA6UhxkGZXRW+SEBVVb6Qt2Lxi52OEBaWvLrUc3eXRWW9wv76REVKds5q16Emzy7S cDwtqmFR875UCSyUVI8+iJ+HCTDPYf0zbOOxd1+y0TwbMMFRhcIvUW7bVKECpjW3uk+Wjf XUbMm4lLSeMxhfKmvIaTWGZG9ax++zk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1721036386; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mUJYt0YFpnzi6c/1zXmO1ITb+dAIghKzV6hQxSwURQU=; b=iUXnRE0LIeVgClj9iZXFyaPMk9WrDr7iYRJowcwp6dYNJ7gKeAVg2vk16JskbV3C3dXvtg dFFC6SASrjZ6FDAA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 27B3C1395F; Mon, 15 Jul 2024 09:39:46 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id QKB2CGLulGbTEgAAD6G6ig (envelope-from ); Mon, 15 Jul 2024 09:39:46 +0000 From: Thomas Zimmermann To: jfalempe@redhat.com, airlied@redhat.com, daniel@ffwll.ch, airlied@gmail.com, mripard@kernel.org, maarten.lankhorst@linux.intel.com Cc: dri-devel@lists.freedesktop.org, Thomas Zimmermann Subject: [PATCH 1/7] drm/probe-helper: Call connector detect functions in single helper Date: Mon, 15 Jul 2024 11:38:57 +0200 Message-ID: <20240715093936.793552-2-tzimmermann@suse.de> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240715093936.793552-1-tzimmermann@suse.de> References: <20240715093936.793552-1-tzimmermann@suse.de> MIME-Version: 1.0 X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; MIME_TRACE(0.00)[0:+]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; TO_DN_SOME(0.00)[]; FREEMAIL_TO(0.00)[redhat.com,ffwll.ch,gmail.com,kernel.org,linux.intel.com]; RCVD_TLS_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:email,suse.de:dkim]; RCPT_COUNT_SEVEN(0.00)[8]; DWL_DNSWL_BLOCKED(0.00)[suse.de:dkim]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; FREEMAIL_ENVRCPT(0.00)[gmail.com] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Rspamd-Action: no action X-Rspamd-Queue-Id: 618EB21B4F X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Move the logic to call the connector's detect helper into a single internal function. Reduces code dupliction. Signed-off-by: Thomas Zimmermann Acked-by: Maxime Ripard --- drivers/gpu/drm/drm_probe_helper.c | 33 +++++++++++++++--------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c index bb49d552e671..f14301abf53f 100644 --- a/drivers/gpu/drm/drm_probe_helper.c +++ b/drivers/gpu/drm/drm_probe_helper.c @@ -338,10 +338,23 @@ void drm_kms_helper_poll_reschedule(struct drm_device *dev) } EXPORT_SYMBOL(drm_kms_helper_poll_reschedule); +static int detect_connector_status(struct drm_connector *connector, + struct drm_modeset_acquire_ctx *ctx, + bool force) +{ + const struct drm_connector_helper_funcs *funcs = connector->helper_private; + + if (funcs->detect_ctx) + return funcs->detect_ctx(connector, ctx, force); + else if (connector->funcs->detect) + return connector->funcs->detect(connector, force); + + return connector_status_connected; +} + static enum drm_connector_status drm_helper_probe_detect_ctx(struct drm_connector *connector, bool force) { - const struct drm_connector_helper_funcs *funcs = connector->helper_private; struct drm_modeset_acquire_ctx ctx; int ret; @@ -349,14 +362,8 @@ drm_helper_probe_detect_ctx(struct drm_connector *connector, bool force) retry: ret = drm_modeset_lock(&connector->dev->mode_config.connection_mutex, &ctx); - if (!ret) { - if (funcs->detect_ctx) - ret = funcs->detect_ctx(connector, &ctx, force); - else if (connector->funcs->detect) - ret = connector->funcs->detect(connector, force); - else - ret = connector_status_connected; - } + if (!ret) + ret = detect_connector_status(connector, &ctx, force); if (ret == -EDEADLK) { drm_modeset_backoff(&ctx); @@ -390,7 +397,6 @@ drm_helper_probe_detect(struct drm_connector *connector, struct drm_modeset_acquire_ctx *ctx, bool force) { - const struct drm_connector_helper_funcs *funcs = connector->helper_private; struct drm_device *dev = connector->dev; int ret; @@ -401,12 +407,7 @@ drm_helper_probe_detect(struct drm_connector *connector, if (ret) return ret; - if (funcs->detect_ctx) - ret = funcs->detect_ctx(connector, ctx, force); - else if (connector->funcs->detect) - ret = connector->funcs->detect(connector, force); - else - ret = connector_status_connected; + ret = detect_connector_status(connector, ctx, force); if (ret != connector->status) connector->epoch_counter += 1; From patchwork Mon Jul 15 09:38:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13733177 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B432AC3DA59 for ; Mon, 15 Jul 2024 09:39:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AA24E10E1A5; Mon, 15 Jul 2024 09:39:49 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.b="JTX5+jib"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="tq3KT+t1"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="JTX5+jib"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="tq3KT+t1"; dkim-atps=neutral Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by gabe.freedesktop.org (Postfix) with ESMTPS id DDB1510E1A5 for ; Mon, 15 Jul 2024 09:39:47 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id A37511F7E2; Mon, 15 Jul 2024 09:39:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1721036386; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7vjwHdMmGPViBh2c9N/zcRkOZ62oEkG/Ou8gjaW1Q/Y=; b=JTX5+jibFGgCxjgOPIT2JDTKbg0bxI1ViY/W5EebeDEezSSdC5anwiHTKqCnSrmTwl/X5e 97Xuxmow+YtUeCCrYPxAmVKWAcgFv4sEM7EnxjFAVs6PzjYXv5Nw85TxVzvk2ABTVn+lyn H/eqsPyc75uty2pKF4byQoXOS8p1KJA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1721036386; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7vjwHdMmGPViBh2c9N/zcRkOZ62oEkG/Ou8gjaW1Q/Y=; b=tq3KT+t1+ZUCqYjdsrYMgDlECmGBOGXKcvhPEGx8ooYvIL3yWJMXcmd1pRwEb4MM7jfmLz c/tdLxmWVjV1IcDA== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=JTX5+jib; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=tq3KT+t1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1721036386; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7vjwHdMmGPViBh2c9N/zcRkOZ62oEkG/Ou8gjaW1Q/Y=; b=JTX5+jibFGgCxjgOPIT2JDTKbg0bxI1ViY/W5EebeDEezSSdC5anwiHTKqCnSrmTwl/X5e 97Xuxmow+YtUeCCrYPxAmVKWAcgFv4sEM7EnxjFAVs6PzjYXv5Nw85TxVzvk2ABTVn+lyn H/eqsPyc75uty2pKF4byQoXOS8p1KJA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1721036386; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7vjwHdMmGPViBh2c9N/zcRkOZ62oEkG/Ou8gjaW1Q/Y=; b=tq3KT+t1+ZUCqYjdsrYMgDlECmGBOGXKcvhPEGx8ooYvIL3yWJMXcmd1pRwEb4MM7jfmLz c/tdLxmWVjV1IcDA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 67F81134AB; Mon, 15 Jul 2024 09:39:46 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id ABUoGGLulGbTEgAAD6G6ig (envelope-from ); Mon, 15 Jul 2024 09:39:46 +0000 From: Thomas Zimmermann To: jfalempe@redhat.com, airlied@redhat.com, daniel@ffwll.ch, airlied@gmail.com, mripard@kernel.org, maarten.lankhorst@linux.intel.com Cc: dri-devel@lists.freedesktop.org, Thomas Zimmermann Subject: [PATCH 2/7] drm/probe-helper: Optionally report single connected output per CRTC Date: Mon, 15 Jul 2024 11:38:58 +0200 Message-ID: <20240715093936.793552-3-tzimmermann@suse.de> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240715093936.793552-1-tzimmermann@suse.de> References: <20240715093936.793552-1-tzimmermann@suse.de> MIME-Version: 1.0 X-Rspamd-Queue-Id: A37511F7E2 X-Rspamd-Action: no action X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [0.99 / 50.00]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; RCPT_COUNT_SEVEN(0.00)[8]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; FREEMAIL_TO(0.00)[redhat.com,ffwll.ch,gmail.com,kernel.org,linux.intel.com]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:dkim,suse.de:email]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+] X-Spamd-Bar: / X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" For CRTCs with multiple outputs (i.e., encoders plus connectors), only report at most a single connected output to userspace. Make this configurable via CONFIG_DRM_REPORT_SINGLE_CONNECTED_CRTC_OUTPUT. Having multiple connected outputs on the same CRTC complicates display-mode and format selection, so most userspace does not support this. This is mostly not a problem in practice, as modern display hardware provides a separate CRTC for each output. On old hardware or hardware with BMCs, a single CRTC often drives multiple displays. Only reporting one of them as connected makes the hardware compatible with common userspace. Add the field prioritized_connectors to struct drm_connector. The bitmask signals which other connectors have priority. Also provide the helper drm_probe_helper_prioritize_connectors() that sets default priorities for a given set of connectors. Calling the helper should be enough to set up the functionality for most drivers. With the prioritization bits in place, update connector-status detection to test against prioritized conenctors. So when the probe helpers detect a connector as connected, test against the prioritized connectors. If any is also connected, set the connector status to disconnected. Please note that this functionality is a workaround for limitations in userspace. If your compositor supports multiple outputs per CRTC, CONFIG_DRM_REPORT_SINGLE_CONNECTED_CRTC_OUTPUT should be disabled. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/Kconfig | 15 +++++ drivers/gpu/drm/drm_probe_helper.c | 104 +++++++++++++++++++++++++++++ include/drm/drm_connector.h | 2 + include/drm/drm_probe_helper.h | 2 + 4 files changed, 123 insertions(+) diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index fd0749c0c630..d1afdbd2d93b 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig @@ -105,6 +105,21 @@ config DRM_KMS_HELPER help CRTC helpers for KMS drivers. +config DRM_REPORT_SINGLE_CONNECTED_CRTC_OUTPUT + bool "Report only a single connected output per CRTC" + depends on DRM + default n + help + CRTCs can support multiple encoders and connectors for output. + More than one pair can be connected to a display at a time. Most + userspace only supports at most one connected output per CRTC at a + time. Enable this option to let DRM report at most one connected + output per CRTC. This is mostly relevant for low-end and old + hardware. Most modern graphics hardware supports a separate CRTC + per output and won't be affected by this setting. + + If in doubt, say "Y". + config DRM_PANIC bool "Display a user-friendly message when a kernel panic occurs" depends on DRM && !(FRAMEBUFFER_CONSOLE && VT_CONSOLE) diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c index f14301abf53f..fc0652635148 100644 --- a/drivers/gpu/drm/drm_probe_helper.c +++ b/drivers/gpu/drm/drm_probe_helper.c @@ -352,6 +352,74 @@ static int detect_connector_status(struct drm_connector *connector, return connector_status_connected; } +static int reported_connector_status(struct drm_connector *connector, int detected_status, + struct drm_modeset_acquire_ctx *ctx, bool force) +{ +#if defined(CONFIG_DRM_REPORT_SINGLE_CONNECTED_CRTC_OUTPUT) + struct drm_connector *prio_connector = connector; + struct drm_device *dev = connector->dev; + struct drm_connector_list_iter iter; + struct drm_connector *pos; + u32 connector_mask; + int ret = 0; + + if (!connector->prioritized_connectors) + return detected_status; + + if (detected_status != connector_status_connected) + return detected_status; + + connector_mask = drm_connector_mask(connector); + + /* + * Find the connector with status 'connected' and a higher + * priority. + */ + drm_connector_list_iter_begin(dev, &iter); + drm_for_each_connector_iter(pos, &iter) { + if (!(drm_connector_mask(pos) & connector->prioritized_connectors)) + continue; + + /* + * Warn if connector has priority over itself. + */ + if (drm_WARN_ON_ONCE(dev, pos == connector)) + continue; + + /* + * Warn if both connectors have priority over each other. Pick the + * one with the lower index. + */ + if (drm_WARN_ON_ONCE(dev, pos->prioritized_connectors & connector_mask)) { + if (pos->index > connector->index) + continue; + } + + ret = detect_connector_status(pos, ctx, force); + if (ret < 0) + break; + if (ret == connector_status_disconnected) + continue; + + prio_connector = pos; + break; + } + drm_connector_list_iter_end(&iter); + + if (ret < 0) + return ret; + + /* + * We've found another connected connector. Report our connector + * as 'disconnected'. + */ + if (prio_connector != connector) + detected_status = connector_status_disconnected; +#endif + + return detected_status; +} + static enum drm_connector_status drm_helper_probe_detect_ctx(struct drm_connector *connector, bool force) { @@ -373,6 +441,12 @@ drm_helper_probe_detect_ctx(struct drm_connector *connector, bool force) if (WARN_ON(ret < 0)) ret = connector_status_unknown; + ret = reported_connector_status(connector, ret, &ctx, force); + if (ret == -EDEADLK) { + drm_modeset_backoff(&ctx); + goto retry; + } + if (ret != connector->status) connector->epoch_counter += 1; @@ -408,6 +482,7 @@ drm_helper_probe_detect(struct drm_connector *connector, return ret; ret = detect_connector_status(connector, ctx, force); + ret = reported_connector_status(connector, ret, ctx, force); if (ret != connector->status) connector->epoch_counter += 1; @@ -416,6 +491,35 @@ drm_helper_probe_detect(struct drm_connector *connector, } EXPORT_SYMBOL(drm_helper_probe_detect); +/** + * drm_probe_helper_prioritize_connectors - Set connector priorities + * @dev: the DRM device with connectors + * @connector_mask: Bitmask connector indices + * + * drm_probe_helper_prioritize_connectors() prioritizes all connectors + * specified in @connector_mask. All given connectors are assumed to + * interfere with each other. Connectors with a lower index have priority + * over connectors with a higher index. + */ +void drm_probe_helper_prioritize_connectors(struct drm_device *dev, u32 connector_mask) +{ + struct drm_connector_list_iter iter; + struct drm_connector *connector; + u32 prioritized_connectors = 0; + + drm_connector_list_iter_begin(dev, &iter); + drm_for_each_connector_iter(connector, &iter) { + u32 mask = drm_connector_mask(connector); + + if (!(mask & connector_mask)) + continue; + connector->prioritized_connectors = prioritized_connectors; + prioritized_connectors |= mask; + } + drm_connector_list_iter_end(&iter); +} +EXPORT_SYMBOL(drm_probe_helper_prioritize_connectors); + static int drm_helper_probe_get_modes(struct drm_connector *connector) { const struct drm_connector_helper_funcs *connector_funcs = diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index 5ad735253413..e3039478e928 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -1985,6 +1985,8 @@ struct drm_connector { /** @epoch_counter: used to detect any other changes in connector, besides status */ u64 epoch_counter; + u32 prioritized_connectors; + /** * @possible_encoders: Bit mask of encoders that can drive this * connector, drm_encoder_index() determines the index into the bitfield diff --git a/include/drm/drm_probe_helper.h b/include/drm/drm_probe_helper.h index d6ce7b218b77..05e23485550d 100644 --- a/include/drm/drm_probe_helper.h +++ b/include/drm/drm_probe_helper.h @@ -17,6 +17,8 @@ int drm_helper_probe_detect(struct drm_connector *connector, struct drm_modeset_acquire_ctx *ctx, bool force); +void drm_probe_helper_prioritize_connectors(struct drm_device *dev, u32 connector_mask); + int drmm_kms_helper_poll_init(struct drm_device *dev); void drm_kms_helper_poll_init(struct drm_device *dev); void drm_kms_helper_poll_fini(struct drm_device *dev); From patchwork Mon Jul 15 09:38:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13733179 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3BD46C3DA5E for ; Mon, 15 Jul 2024 09:39:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4920D10E24F; Mon, 15 Jul 2024 09:39:56 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.b="cvnlohfP"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="Cq9lcSoQ"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="cvnlohfP"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="Cq9lcSoQ"; dkim-atps=neutral Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8738410E1A5 for ; Mon, 15 Jul 2024 09:39:48 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 05BC621B50; Mon, 15 Jul 2024 09:39:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1721036387; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5c7+u4uXG459eRwlJagF6Q6qpQOqS7yvnHiftj/fG3A=; b=cvnlohfPgJzrNt/Xbc+bLKYth+8vTvgSm1zFZZtD/4+ii8vhPj5PkBhjPlpTrlQy+d6QwY NMj+DyzHdZvtxeAgDimM5BYuAVYYJ09WShXxx8XB065vAYDib5wQCw0cyG97rgX6u5Vsq7 f7YqQDals2MUAReGn9UsHIwH5kdThsY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1721036387; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5c7+u4uXG459eRwlJagF6Q6qpQOqS7yvnHiftj/fG3A=; b=Cq9lcSoQhzawD/UrWiW2MKxjwl/BsaNAZuYvn3yRp7b6niCjlubS3uhjPFqNv0ZY9f8KBZ kyvWqbFRY6a24VDw== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=cvnlohfP; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=Cq9lcSoQ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1721036387; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5c7+u4uXG459eRwlJagF6Q6qpQOqS7yvnHiftj/fG3A=; b=cvnlohfPgJzrNt/Xbc+bLKYth+8vTvgSm1zFZZtD/4+ii8vhPj5PkBhjPlpTrlQy+d6QwY NMj+DyzHdZvtxeAgDimM5BYuAVYYJ09WShXxx8XB065vAYDib5wQCw0cyG97rgX6u5Vsq7 f7YqQDals2MUAReGn9UsHIwH5kdThsY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1721036387; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5c7+u4uXG459eRwlJagF6Q6qpQOqS7yvnHiftj/fG3A=; b=Cq9lcSoQhzawD/UrWiW2MKxjwl/BsaNAZuYvn3yRp7b6niCjlubS3uhjPFqNv0ZY9f8KBZ kyvWqbFRY6a24VDw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id A94361396E; Mon, 15 Jul 2024 09:39:46 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id GAEeKGLulGbTEgAAD6G6ig (envelope-from ); Mon, 15 Jul 2024 09:39:46 +0000 From: Thomas Zimmermann To: jfalempe@redhat.com, airlied@redhat.com, daniel@ffwll.ch, airlied@gmail.com, mripard@kernel.org, maarten.lankhorst@linux.intel.com Cc: dri-devel@lists.freedesktop.org, Thomas Zimmermann Subject: [PATCH 3/7] drm/ast: Set connector priorities Date: Mon, 15 Jul 2024 11:38:59 +0200 Message-ID: <20240715093936.793552-4-tzimmermann@suse.de> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240715093936.793552-1-tzimmermann@suse.de> References: <20240715093936.793552-1-tzimmermann@suse.de> MIME-Version: 1.0 X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; MIME_TRACE(0.00)[0:+]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; TO_DN_SOME(0.00)[]; FREEMAIL_TO(0.00)[redhat.com,ffwll.ch,gmail.com,kernel.org,linux.intel.com]; RCVD_TLS_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:email,suse.de:dkim]; RCPT_COUNT_SEVEN(0.00)[8]; DWL_DNSWL_BLOCKED(0.00)[suse.de:dkim]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; FREEMAIL_ENVRCPT(0.00)[gmail.com] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Rspamd-Action: no action X-Rspamd-Queue-Id: 05BC621B50 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Call drm_probe_helper_prioritize_connectors() to set connector priorities. Guarantees that only a single output is connected at a time. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/ast/ast_mode.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c index dc8f639e82fd..ac8a3c6b8bf8 100644 --- a/drivers/gpu/drm/ast/ast_mode.c +++ b/drivers/gpu/drm/ast/ast_mode.c @@ -1970,6 +1970,9 @@ int ast_mode_config_init(struct ast_device *ast) if (ret) return ret; + /* All connectors interfere with each other. */ + drm_probe_helper_prioritize_connectors(dev, GENMASK(dev->mode_config.num_connector, 0)); + drm_mode_config_reset(dev); ret = drmm_kms_helper_poll_init(dev); From patchwork Mon Jul 15 09:39:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13733183 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0EE54C3DA59 for ; Mon, 15 Jul 2024 09:40:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6289D10E0EA; Mon, 15 Jul 2024 09:40:34 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.b="qC4L1E2W"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="npQrFcD2"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="qC4L1E2W"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="npQrFcD2"; dkim-atps=neutral Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9D73B10E24F for ; Mon, 15 Jul 2024 09:39:48 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 38E711F7FA; Mon, 15 Jul 2024 09:39:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1721036387; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=l0m+YbXd8M4EOX4UqRttnuAb3AT6tMM7aAZL58pthF0=; b=qC4L1E2WWSvykF+WvEyjl7EejFoJIbIRu8O+WoxS8Ium6zaqnELMa4MKwgPtxpaCWkfBXG T0Y3xqKis1ZLNPG10X/NdgS9mFGxUkIb/mfBGlBVAHj4oPaObejrmjwv75dUPjH1Wy5P7o qIegJlhhBeC0O4DtON2F2PyijN2+j9g= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1721036387; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=l0m+YbXd8M4EOX4UqRttnuAb3AT6tMM7aAZL58pthF0=; b=npQrFcD2pETrm+F0zyBr7MfiqrBrKPd9EeZHn4izEsWjFAV4c8gpjEgUasixVPFkNRHUrG 2Y01UJioD3mWGgAA== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=qC4L1E2W; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=npQrFcD2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1721036387; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=l0m+YbXd8M4EOX4UqRttnuAb3AT6tMM7aAZL58pthF0=; b=qC4L1E2WWSvykF+WvEyjl7EejFoJIbIRu8O+WoxS8Ium6zaqnELMa4MKwgPtxpaCWkfBXG T0Y3xqKis1ZLNPG10X/NdgS9mFGxUkIb/mfBGlBVAHj4oPaObejrmjwv75dUPjH1Wy5P7o qIegJlhhBeC0O4DtON2F2PyijN2+j9g= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1721036387; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=l0m+YbXd8M4EOX4UqRttnuAb3AT6tMM7aAZL58pthF0=; b=npQrFcD2pETrm+F0zyBr7MfiqrBrKPd9EeZHn4izEsWjFAV4c8gpjEgUasixVPFkNRHUrG 2Y01UJioD3mWGgAA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id F3B67134AB; Mon, 15 Jul 2024 09:39:46 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 2J85OmLulGbTEgAAD6G6ig (envelope-from ); Mon, 15 Jul 2024 09:39:46 +0000 From: Thomas Zimmermann To: jfalempe@redhat.com, airlied@redhat.com, daniel@ffwll.ch, airlied@gmail.com, mripard@kernel.org, maarten.lankhorst@linux.intel.com Cc: dri-devel@lists.freedesktop.org, Thomas Zimmermann Subject: [PATCH 4/7] drm/ast: Remove struct ast_bmc_connector Date: Mon, 15 Jul 2024 11:39:00 +0200 Message-ID: <20240715093936.793552-5-tzimmermann@suse.de> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240715093936.793552-1-tzimmermann@suse.de> References: <20240715093936.793552-1-tzimmermann@suse.de> MIME-Version: 1.0 X-Rspamd-Queue-Id: 38E711F7FA X-Rspamd-Action: no action X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [0.99 / 50.00]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; RCPT_COUNT_SEVEN(0.00)[8]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; FREEMAIL_TO(0.00)[redhat.com,ffwll.ch,gmail.com,kernel.org,linux.intel.com]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:dkim,suse.de:email]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+] X-Spamd-Bar: / X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Ast's BMC connector tracks the status of an underlying physical connector and set BMC status accordingly. This functionality has been moved into probe helpers. The BMC is always connected and the helpers compute the correct status. Hence, remove the driver's dedicated code. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/ast/ast_drv.h | 17 +------------ drivers/gpu/drm/ast/ast_mode.c | 46 ++++------------------------------ 2 files changed, 6 insertions(+), 57 deletions(-) diff --git a/drivers/gpu/drm/ast/ast_drv.h b/drivers/gpu/drm/ast/ast_drv.h index ba3d86973995..faafb696dc74 100644 --- a/drivers/gpu/drm/ast/ast_drv.h +++ b/drivers/gpu/drm/ast/ast_drv.h @@ -146,21 +146,6 @@ static inline struct ast_plane *to_ast_plane(struct drm_plane *plane) return container_of(plane, struct ast_plane, base); } -/* - * BMC - */ - -struct ast_bmc_connector { - struct drm_connector base; - struct drm_connector *physical_connector; -}; - -static inline struct ast_bmc_connector * -to_ast_bmc_connector(struct drm_connector *connector) -{ - return container_of(connector, struct ast_bmc_connector, base); -} - /* * Device */ @@ -208,7 +193,7 @@ struct ast_device { } astdp; struct { struct drm_encoder encoder; - struct ast_bmc_connector bmc_connector; + struct drm_connector connector; } bmc; } output; diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c index ac8a3c6b8bf8..f59cb0f8fbb2 100644 --- a/drivers/gpu/drm/ast/ast_mode.c +++ b/drivers/gpu/drm/ast/ast_mode.c @@ -1761,30 +1761,6 @@ static const struct drm_encoder_funcs ast_bmc_encoder_funcs = { .destroy = drm_encoder_cleanup, }; -static int ast_bmc_connector_helper_detect_ctx(struct drm_connector *connector, - struct drm_modeset_acquire_ctx *ctx, - bool force) -{ - struct ast_bmc_connector *bmc_connector = to_ast_bmc_connector(connector); - struct drm_connector *physical_connector = bmc_connector->physical_connector; - - /* - * Most user-space compositors cannot handle more than one connected - * connector per CRTC. Hence, we only mark the BMC as connected if the - * physical connector is disconnected. If the physical connector's status - * is connected or unknown, the BMC remains disconnected. This has no - * effect on the output of the BMC. - * - * FIXME: Remove this logic once user-space compositors can handle more - * than one connector per CRTC. The BMC should always be connected. - */ - - if (physical_connector && physical_connector->status == connector_status_disconnected) - return connector_status_connected; - - return connector_status_disconnected; -} - static int ast_bmc_connector_helper_get_modes(struct drm_connector *connector) { return drm_add_modes_noedid(connector, 4096, 4096); @@ -1792,7 +1768,6 @@ static int ast_bmc_connector_helper_get_modes(struct drm_connector *connector) static const struct drm_connector_helper_funcs ast_bmc_connector_helper_funcs = { .get_modes = ast_bmc_connector_helper_get_modes, - .detect_ctx = ast_bmc_connector_helper_detect_ctx, }; static const struct drm_connector_funcs ast_bmc_connector_funcs = { @@ -1804,10 +1779,8 @@ static const struct drm_connector_funcs ast_bmc_connector_funcs = { }; static int ast_bmc_connector_init(struct drm_device *dev, - struct ast_bmc_connector *bmc_connector, - struct drm_connector *physical_connector) + struct drm_connector *connector) { - struct drm_connector *connector = &bmc_connector->base; int ret; ret = drm_connector_init(dev, connector, &ast_bmc_connector_funcs, @@ -1817,19 +1790,15 @@ static int ast_bmc_connector_init(struct drm_device *dev, drm_connector_helper_add(connector, &ast_bmc_connector_helper_funcs); - bmc_connector->physical_connector = physical_connector; - return 0; } -static int ast_bmc_output_init(struct ast_device *ast, - struct drm_connector *physical_connector) +static int ast_bmc_output_init(struct ast_device *ast) { struct drm_device *dev = &ast->base; struct drm_crtc *crtc = &ast->crtc; struct drm_encoder *encoder = &ast->output.bmc.encoder; - struct ast_bmc_connector *bmc_connector = &ast->output.bmc.bmc_connector; - struct drm_connector *connector = &bmc_connector->base; + struct drm_connector *connector = &ast->output.bmc.connector; int ret; ret = drm_encoder_init(dev, encoder, @@ -1839,7 +1808,7 @@ static int ast_bmc_output_init(struct ast_device *ast, return ret; encoder->possible_crtcs = drm_crtc_mask(crtc); - ret = ast_bmc_connector_init(dev, bmc_connector, physical_connector); + ret = ast_bmc_connector_init(dev, connector); if (ret) return ret; @@ -1901,7 +1870,6 @@ static const struct drm_mode_config_funcs ast_mode_config_funcs = { int ast_mode_config_init(struct ast_device *ast) { struct drm_device *dev = &ast->base; - struct drm_connector *physical_connector = NULL; int ret; ret = drmm_mutex_init(dev, &ast->modeset_lock); @@ -1946,27 +1914,23 @@ int ast_mode_config_init(struct ast_device *ast) ret = ast_vga_output_init(ast); if (ret) return ret; - physical_connector = &ast->output.vga.connector; } if (ast->tx_chip_types & AST_TX_SIL164_BIT) { ret = ast_sil164_output_init(ast); if (ret) return ret; - physical_connector = &ast->output.sil164.connector; } if (ast->tx_chip_types & AST_TX_DP501_BIT) { ret = ast_dp501_output_init(ast); if (ret) return ret; - physical_connector = &ast->output.dp501.connector; } if (ast->tx_chip_types & AST_TX_ASTDP_BIT) { ret = ast_astdp_output_init(ast); if (ret) return ret; - physical_connector = &ast->output.astdp.connector; } - ret = ast_bmc_output_init(ast, physical_connector); + ret = ast_bmc_output_init(ast); if (ret) return ret; From patchwork Mon Jul 15 09:39:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13733180 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C890DC3DA59 for ; Mon, 15 Jul 2024 09:40:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1D25210E195; Mon, 15 Jul 2024 09:40:01 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.b="JNyJMPs+"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="g+AbzTjJ"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="JNyJMPs+"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="g+AbzTjJ"; dkim-atps=neutral Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by gabe.freedesktop.org (Postfix) with ESMTPS id D3AC610E2D4 for ; Mon, 15 Jul 2024 09:39:48 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 7C4701F80C; Mon, 15 Jul 2024 09:39:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1721036387; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gQWH3akW/p+bwPIMYtB6o3sDDvT0LIVIIN458IDjY9E=; b=JNyJMPs+wUNp4GawNKkfB7kHIp0Bi/ntxE3JfVrIeqM50Y33lXW+BGQFHWoZw6mV2RmzEd wJt+6ZXcIFXgyoaWkgM/RLMaS+XjDOKck2HW/YJsd3duZJbnJF5agA+NwmoLDBfh48CR7I qNjlY0GMoHouv5E+2uSWXEX/rlzRJEk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1721036387; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gQWH3akW/p+bwPIMYtB6o3sDDvT0LIVIIN458IDjY9E=; b=g+AbzTjJ6XTFWZ1hHpOeonSgOTv6k0bRcO3NTE3pcDDbn3N3SFgVzVeqUbTLihJGs62X/6 ReyF43nKUWPXUcCg== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=JNyJMPs+; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=g+AbzTjJ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1721036387; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gQWH3akW/p+bwPIMYtB6o3sDDvT0LIVIIN458IDjY9E=; b=JNyJMPs+wUNp4GawNKkfB7kHIp0Bi/ntxE3JfVrIeqM50Y33lXW+BGQFHWoZw6mV2RmzEd wJt+6ZXcIFXgyoaWkgM/RLMaS+XjDOKck2HW/YJsd3duZJbnJF5agA+NwmoLDBfh48CR7I qNjlY0GMoHouv5E+2uSWXEX/rlzRJEk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1721036387; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gQWH3akW/p+bwPIMYtB6o3sDDvT0LIVIIN458IDjY9E=; b=g+AbzTjJ6XTFWZ1hHpOeonSgOTv6k0bRcO3NTE3pcDDbn3N3SFgVzVeqUbTLihJGs62X/6 ReyF43nKUWPXUcCg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 3F1AD1396E; Mon, 15 Jul 2024 09:39:47 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 6IYoDmPulGbTEgAAD6G6ig (envelope-from ); Mon, 15 Jul 2024 09:39:47 +0000 From: Thomas Zimmermann To: jfalempe@redhat.com, airlied@redhat.com, daniel@ffwll.ch, airlied@gmail.com, mripard@kernel.org, maarten.lankhorst@linux.intel.com Cc: dri-devel@lists.freedesktop.org, Thomas Zimmermann , Shixiong Ou Subject: [PATCH 5/7] drm/ast: Support ASTDP and VGA at the same time Date: Mon, 15 Jul 2024 11:39:01 +0200 Message-ID: <20240715093936.793552-6-tzimmermann@suse.de> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240715093936.793552-1-tzimmermann@suse.de> References: <20240715093936.793552-1-tzimmermann@suse.de> MIME-Version: 1.0 X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; MIME_TRACE(0.00)[0:+]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; TO_DN_SOME(0.00)[]; FREEMAIL_TO(0.00)[redhat.com,ffwll.ch,gmail.com,kernel.org,linux.intel.com]; RCVD_TLS_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; DBL_BLOCKED_OPENRESOLVER(0.00)[kylinos.cn:email,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:email,suse.de:dkim]; RCPT_COUNT_SEVEN(0.00)[9]; DWL_DNSWL_BLOCKED(0.00)[suse.de:dkim]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; FREEMAIL_ENVRCPT(0.00)[gmail.com] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Rspamd-Action: no action X-Rspamd-Queue-Id: 7C4701F80C X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" AST2600 can host VGA and DisplayPort outputs. Support both on the same device. As userspace can often only support a single output per CRTC, connectors are prioritized against each other by the probe helpers. Reported-by: Shixiong Ou Closes: https://lore.kernel.org/dri-devel/20240711090102.352213-1-oushixiong1025@163.com/ Signed-off-by: Thomas Zimmermann Tested-by: Shixiong Ou --- drivers/gpu/drm/ast/ast_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/ast/ast_main.c b/drivers/gpu/drm/ast/ast_main.c index 0637abb70361..d43aedaa8dd0 100644 --- a/drivers/gpu/drm/ast/ast_main.c +++ b/drivers/gpu/drm/ast/ast_main.c @@ -115,7 +115,7 @@ static void ast_detect_tx_chip(struct ast_device *ast, bool need_post) } else if (IS_AST_GEN7(ast)) { if (ast_get_index_reg_mask(ast, AST_IO_VGACRI, 0xD1, TX_TYPE_MASK) == ASTDP_DPMCU_TX) { - ast->tx_chip_types = AST_TX_ASTDP_BIT; + ast->tx_chip_types |= AST_TX_ASTDP_BIT; ast_dp_launch(&ast->base); } } From patchwork Mon Jul 15 09:39:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13733182 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 37D81C3DA59 for ; Mon, 15 Jul 2024 09:40:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 31E3389135; Mon, 15 Jul 2024 09:40:25 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.b="mvKgSRVs"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="x7mE5QqL"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="mvKgSRVs"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="x7mE5QqL"; dkim-atps=neutral Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by gabe.freedesktop.org (Postfix) with ESMTPS id 07A5F10E312 for ; Mon, 15 Jul 2024 09:39:49 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id BC4AC1F80D; Mon, 15 Jul 2024 09:39:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1721036387; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Am5Ekga1bImPkPKvN3YcdNbk5KeYbZq2OdSo4xPYPXE=; b=mvKgSRVsu4QuTGfRObO6/tqovN+cFI6A4FzQgmvmrOsgoQ2lOEsUuyEOZgefw+OY/T1vTK sLIFi2kssuDNxPDxGLuyy2O7gSh1Q9dqR9UNR0hNlalcn8ckxNYEQfecI8ELOuLtQWhdvq IS/GC6SXGuoMWOptq07UPRgpdN29SEg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1721036387; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Am5Ekga1bImPkPKvN3YcdNbk5KeYbZq2OdSo4xPYPXE=; b=x7mE5QqL7pKshF0zsgC+rgwpLLB6QDO8BvtoSRrVgCSD6yNOFu6J5ldSjbqqPVTwUoCFce xMLwtuSzCGeuINAA== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=mvKgSRVs; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=x7mE5QqL DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1721036387; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Am5Ekga1bImPkPKvN3YcdNbk5KeYbZq2OdSo4xPYPXE=; b=mvKgSRVsu4QuTGfRObO6/tqovN+cFI6A4FzQgmvmrOsgoQ2lOEsUuyEOZgefw+OY/T1vTK sLIFi2kssuDNxPDxGLuyy2O7gSh1Q9dqR9UNR0hNlalcn8ckxNYEQfecI8ELOuLtQWhdvq IS/GC6SXGuoMWOptq07UPRgpdN29SEg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1721036387; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Am5Ekga1bImPkPKvN3YcdNbk5KeYbZq2OdSo4xPYPXE=; b=x7mE5QqL7pKshF0zsgC+rgwpLLB6QDO8BvtoSRrVgCSD6yNOFu6J5ldSjbqqPVTwUoCFce xMLwtuSzCGeuINAA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 82A8C134AB; Mon, 15 Jul 2024 09:39:47 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id eAWqHmPulGbTEgAAD6G6ig (envelope-from ); Mon, 15 Jul 2024 09:39:47 +0000 From: Thomas Zimmermann To: jfalempe@redhat.com, airlied@redhat.com, daniel@ffwll.ch, airlied@gmail.com, mripard@kernel.org, maarten.lankhorst@linux.intel.com Cc: dri-devel@lists.freedesktop.org, Thomas Zimmermann Subject: [PATCH 6/7] drm/mgag200: Set connector priorities Date: Mon, 15 Jul 2024 11:39:02 +0200 Message-ID: <20240715093936.793552-7-tzimmermann@suse.de> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240715093936.793552-1-tzimmermann@suse.de> References: <20240715093936.793552-1-tzimmermann@suse.de> MIME-Version: 1.0 X-Rspamd-Queue-Id: BC4AC1F80D X-Rspamd-Action: no action X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [0.99 / 50.00]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; RCPT_COUNT_SEVEN(0.00)[8]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; FREEMAIL_TO(0.00)[redhat.com,ffwll.ch,gmail.com,kernel.org,linux.intel.com]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:email,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+] X-Spamd-Bar: / X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Call drm_probe_helper_prioritize_connectors() to set connector priorities. Guarantees that only a single output is connected at a time. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/mgag200/mgag200_g200eh.c | 2 ++ drivers/gpu/drm/mgag200/mgag200_g200eh3.c | 2 ++ drivers/gpu/drm/mgag200/mgag200_g200er.c | 2 ++ drivers/gpu/drm/mgag200/mgag200_g200ev.c | 2 ++ drivers/gpu/drm/mgag200/mgag200_g200ew3.c | 2 ++ drivers/gpu/drm/mgag200/mgag200_g200se.c | 2 ++ drivers/gpu/drm/mgag200/mgag200_g200wb.c | 2 ++ 7 files changed, 14 insertions(+) diff --git a/drivers/gpu/drm/mgag200/mgag200_g200eh.c b/drivers/gpu/drm/mgag200/mgag200_g200eh.c index 52bf49ead5c5..c8204e8a1daf 100644 --- a/drivers/gpu/drm/mgag200/mgag200_g200eh.c +++ b/drivers/gpu/drm/mgag200/mgag200_g200eh.c @@ -222,6 +222,8 @@ static int mgag200_g200eh_pipeline_init(struct mga_device *mdev) if (ret) return ret; + drm_probe_helper_prioritize_connectors(dev, GENMASK(dev->mode_config.num_connector, 0)); + return 0; } diff --git a/drivers/gpu/drm/mgag200/mgag200_g200eh3.c b/drivers/gpu/drm/mgag200/mgag200_g200eh3.c index e7f89b2a59fd..749baefb0a7e 100644 --- a/drivers/gpu/drm/mgag200/mgag200_g200eh3.c +++ b/drivers/gpu/drm/mgag200/mgag200_g200eh3.c @@ -126,6 +126,8 @@ static int mgag200_g200eh3_pipeline_init(struct mga_device *mdev) if (ret) return ret; + drm_probe_helper_prioritize_connectors(dev, GENMASK(dev->mode_config.num_connector, 0)); + return 0; } diff --git a/drivers/gpu/drm/mgag200/mgag200_g200er.c b/drivers/gpu/drm/mgag200/mgag200_g200er.c index 737a48aa9160..e8c84d3258aa 100644 --- a/drivers/gpu/drm/mgag200/mgag200_g200er.c +++ b/drivers/gpu/drm/mgag200/mgag200_g200er.c @@ -262,6 +262,8 @@ static int mgag200_g200er_pipeline_init(struct mga_device *mdev) if (ret) return ret; + drm_probe_helper_prioritize_connectors(dev, GENMASK(dev->mode_config.num_connector, 0)); + return 0; } diff --git a/drivers/gpu/drm/mgag200/mgag200_g200ev.c b/drivers/gpu/drm/mgag200/mgag200_g200ev.c index 8d1ccc2ad94a..e2b13a90b405 100644 --- a/drivers/gpu/drm/mgag200/mgag200_g200ev.c +++ b/drivers/gpu/drm/mgag200/mgag200_g200ev.c @@ -263,6 +263,8 @@ static int mgag200_g200ev_pipeline_init(struct mga_device *mdev) if (ret) return ret; + drm_probe_helper_prioritize_connectors(dev, GENMASK(dev->mode_config.num_connector, 0)); + return 0; } diff --git a/drivers/gpu/drm/mgag200/mgag200_g200ew3.c b/drivers/gpu/drm/mgag200/mgag200_g200ew3.c index 265f3e95830a..384041e7b839 100644 --- a/drivers/gpu/drm/mgag200/mgag200_g200ew3.c +++ b/drivers/gpu/drm/mgag200/mgag200_g200ew3.c @@ -135,6 +135,8 @@ static int mgag200_g200ew3_pipeline_init(struct mga_device *mdev) if (ret) return ret; + drm_probe_helper_prioritize_connectors(dev, GENMASK(dev->mode_config.num_connector, 0)); + return 0; } diff --git a/drivers/gpu/drm/mgag200/mgag200_g200se.c b/drivers/gpu/drm/mgag200/mgag200_g200se.c index cf7f6897838f..95514dcb8c53 100644 --- a/drivers/gpu/drm/mgag200/mgag200_g200se.c +++ b/drivers/gpu/drm/mgag200/mgag200_g200se.c @@ -394,6 +394,8 @@ static int mgag200_g200se_pipeline_init(struct mga_device *mdev) if (ret) return ret; + drm_probe_helper_prioritize_connectors(dev, GENMASK(dev->mode_config.num_connector, 0)); + return 0; } diff --git a/drivers/gpu/drm/mgag200/mgag200_g200wb.c b/drivers/gpu/drm/mgag200/mgag200_g200wb.c index e25477347c3e..0100b4d03b89 100644 --- a/drivers/gpu/drm/mgag200/mgag200_g200wb.c +++ b/drivers/gpu/drm/mgag200/mgag200_g200wb.c @@ -269,6 +269,8 @@ static int mgag200_g200wb_pipeline_init(struct mga_device *mdev) if (ret) return ret; + drm_probe_helper_prioritize_connectors(dev, GENMASK(dev->mode_config.num_connector, 0)); + return 0; } From patchwork Mon Jul 15 09:39:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13733181 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2101FC3DA5D for ; Mon, 15 Jul 2024 09:40:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8CCA010E2D4; Mon, 15 Jul 2024 09:40:01 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.b="gsrl6zX9"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="ab/GbUR1"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="gsrl6zX9"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="ab/GbUR1"; dkim-atps=neutral Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4C16510E319 for ; Mon, 15 Jul 2024 09:39:49 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 056EF1F80F; Mon, 15 Jul 2024 09:39:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1721036388; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zDLNzHaROvJiDjWphRUP69Fyd52ng3MfabQkcumg978=; b=gsrl6zX9lU8+QinQVUoppFMmyAa7zMo+urgqkyp70DHTTn8nanBtGc+8nIrsISS+po3z4z emnp7OMuaw9ukZajRKL+9hCAdSAhDzdqOiSIX/CAJD4UJr81O5tRkPtJNxNyj9FIZtQhp3 m0DA4BZk6mzxWfqzydRGKgicCc6uFBM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1721036388; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zDLNzHaROvJiDjWphRUP69Fyd52ng3MfabQkcumg978=; b=ab/GbUR1qHMsM7w7I/PYIb/ePCIFC10oxvI9mM8o54a8TvbpcvMjcm6LiuZoj58k3hvahy iUM8ifj8pQc25NAA== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=gsrl6zX9; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="ab/GbUR1" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1721036388; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zDLNzHaROvJiDjWphRUP69Fyd52ng3MfabQkcumg978=; b=gsrl6zX9lU8+QinQVUoppFMmyAa7zMo+urgqkyp70DHTTn8nanBtGc+8nIrsISS+po3z4z emnp7OMuaw9ukZajRKL+9hCAdSAhDzdqOiSIX/CAJD4UJr81O5tRkPtJNxNyj9FIZtQhp3 m0DA4BZk6mzxWfqzydRGKgicCc6uFBM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1721036388; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zDLNzHaROvJiDjWphRUP69Fyd52ng3MfabQkcumg978=; b=ab/GbUR1qHMsM7w7I/PYIb/ePCIFC10oxvI9mM8o54a8TvbpcvMjcm6LiuZoj58k3hvahy iUM8ifj8pQc25NAA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id C1C0A1395F; Mon, 15 Jul 2024 09:39:47 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id EFocLmPulGbTEgAAD6G6ig (envelope-from ); Mon, 15 Jul 2024 09:39:47 +0000 From: Thomas Zimmermann To: jfalempe@redhat.com, airlied@redhat.com, daniel@ffwll.ch, airlied@gmail.com, mripard@kernel.org, maarten.lankhorst@linux.intel.com Cc: dri-devel@lists.freedesktop.org, Thomas Zimmermann Subject: [PATCH 7/7] drm/mgag200: Remove struct mgag200_bmc_connector Date: Mon, 15 Jul 2024 11:39:03 +0200 Message-ID: <20240715093936.793552-8-tzimmermann@suse.de> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240715093936.793552-1-tzimmermann@suse.de> References: <20240715093936.793552-1-tzimmermann@suse.de> MIME-Version: 1.0 X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; MIME_TRACE(0.00)[0:+]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; TO_DN_SOME(0.00)[]; FREEMAIL_TO(0.00)[redhat.com,ffwll.ch,gmail.com,kernel.org,linux.intel.com]; RCVD_TLS_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:email,suse.de:dkim]; RCPT_COUNT_SEVEN(0.00)[8]; DWL_DNSWL_BLOCKED(0.00)[suse.de:dkim]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; FREEMAIL_ENVRCPT(0.00)[gmail.com] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Rspamd-Action: no action X-Rspamd-Queue-Id: 056EF1F80F X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Mgag200's BMC connector tracks the status of an underlying physical connector and set BMC status accordingly. This functionality has been moved into probe helpers. The BMC is always connected and the helpers compute the correct status. Hence, remove the driver's dedicated code. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/mgag200/mgag200_bmc.c | 44 +++-------------------- drivers/gpu/drm/mgag200/mgag200_drv.h | 9 ++--- drivers/gpu/drm/mgag200/mgag200_g200eh.c | 2 +- drivers/gpu/drm/mgag200/mgag200_g200eh3.c | 2 +- drivers/gpu/drm/mgag200/mgag200_g200er.c | 2 +- drivers/gpu/drm/mgag200/mgag200_g200ev.c | 2 +- drivers/gpu/drm/mgag200/mgag200_g200ew3.c | 2 +- drivers/gpu/drm/mgag200/mgag200_g200se.c | 2 +- drivers/gpu/drm/mgag200/mgag200_g200wb.c | 2 +- 9 files changed, 13 insertions(+), 54 deletions(-) diff --git a/drivers/gpu/drm/mgag200/mgag200_bmc.c b/drivers/gpu/drm/mgag200/mgag200_bmc.c index 45e35dffb3ea..1e0537f9cbea 100644 --- a/drivers/gpu/drm/mgag200/mgag200_bmc.c +++ b/drivers/gpu/drm/mgag200/mgag200_bmc.c @@ -9,11 +9,6 @@ #include "mgag200_drv.h" -static struct mgag200_bmc_connector *to_mgag200_bmc_connector(struct drm_connector *connector) -{ - return container_of(connector, struct mgag200_bmc_connector, base); -} - void mgag200_bmc_stop_scanout(struct mga_device *mdev) { u8 tmp; @@ -107,30 +102,6 @@ static const struct drm_encoder_funcs mgag200_bmc_encoder_funcs = { .destroy = drm_encoder_cleanup, }; -static int mgag200_bmc_connector_helper_detect_ctx(struct drm_connector *connector, - struct drm_modeset_acquire_ctx *ctx, - bool force) -{ - struct mgag200_bmc_connector *bmc_connector = to_mgag200_bmc_connector(connector); - struct drm_connector *physical_connector = bmc_connector->physical_connector; - - /* - * Most user-space compositors cannot handle more than one connected - * connector per CRTC. Hence, we only mark the BMC as connected if the - * physical connector is disconnected. If the physical connector's status - * is connected or unknown, the BMC remains disconnected. This has no - * effect on the output of the BMC. - * - * FIXME: Remove this logic once user-space compositors can handle more - * than one connector per CRTC. The BMC should always be connected. - */ - - if (physical_connector && physical_connector->status == connector_status_disconnected) - return connector_status_connected; - - return connector_status_disconnected; -} - static int mgag200_bmc_connector_helper_get_modes(struct drm_connector *connector) { struct drm_device *dev = connector->dev; @@ -142,7 +113,6 @@ static int mgag200_bmc_connector_helper_get_modes(struct drm_connector *connecto static const struct drm_connector_helper_funcs mgag200_bmc_connector_helper_funcs = { .get_modes = mgag200_bmc_connector_helper_get_modes, - .detect_ctx = mgag200_bmc_connector_helper_detect_ctx, }; static const struct drm_connector_funcs mgag200_bmc_connector_funcs = { @@ -154,10 +124,8 @@ static const struct drm_connector_funcs mgag200_bmc_connector_funcs = { }; static int mgag200_bmc_connector_init(struct drm_device *dev, - struct mgag200_bmc_connector *bmc_connector, - struct drm_connector *physical_connector) + struct drm_connector *connector) { - struct drm_connector *connector = &bmc_connector->base; int ret; ret = drm_connector_init(dev, connector, &mgag200_bmc_connector_funcs, @@ -166,17 +134,14 @@ static int mgag200_bmc_connector_init(struct drm_device *dev, return ret; drm_connector_helper_add(connector, &mgag200_bmc_connector_helper_funcs); - bmc_connector->physical_connector = physical_connector; - return 0; } -int mgag200_bmc_output_init(struct mga_device *mdev, struct drm_connector *physical_connector) +int mgag200_bmc_output_init(struct mga_device *mdev) { struct drm_device *dev = &mdev->base; struct drm_crtc *crtc = &mdev->crtc; struct drm_encoder *encoder; - struct mgag200_bmc_connector *bmc_connector; struct drm_connector *connector; int ret; @@ -187,11 +152,10 @@ int mgag200_bmc_output_init(struct mga_device *mdev, struct drm_connector *physi return ret; encoder->possible_crtcs = drm_crtc_mask(crtc); - bmc_connector = &mdev->output.bmc.bmc_connector; - ret = mgag200_bmc_connector_init(dev, bmc_connector, physical_connector); + connector = &mdev->output.bmc.connector; + ret = mgag200_bmc_connector_init(dev, connector); if (ret) return ret; - connector = &bmc_connector->base; ret = drm_connector_attach_encoder(connector, encoder); if (ret) diff --git a/drivers/gpu/drm/mgag200/mgag200_drv.h b/drivers/gpu/drm/mgag200/mgag200_drv.h index f97eaa49b089..abc7a58ed762 100644 --- a/drivers/gpu/drm/mgag200/mgag200_drv.h +++ b/drivers/gpu/drm/mgag200/mgag200_drv.h @@ -188,11 +188,6 @@ static inline struct mgag200_crtc_state *to_mgag200_crtc_state(struct drm_crtc_s return container_of(base, struct mgag200_crtc_state, base); } -struct mgag200_bmc_connector { - struct drm_connector base; - struct drm_connector *physical_connector; -}; - enum mga_type { G200_PCI, G200_AGP, @@ -285,7 +280,7 @@ struct mga_device { } vga; struct { struct drm_encoder encoder; - struct mgag200_bmc_connector bmc_connector; + struct drm_connector connector; } bmc; } output; }; @@ -433,6 +428,6 @@ int mgag200_vga_output_init(struct mga_device *mdev); /* mgag200_bmc.c */ void mgag200_bmc_stop_scanout(struct mga_device *mdev); void mgag200_bmc_start_scanout(struct mga_device *mdev); -int mgag200_bmc_output_init(struct mga_device *mdev, struct drm_connector *physical_connector); +int mgag200_bmc_output_init(struct mga_device *mdev); #endif /* __MGAG200_DRV_H__ */ diff --git a/drivers/gpu/drm/mgag200/mgag200_g200eh.c b/drivers/gpu/drm/mgag200/mgag200_g200eh.c index c8204e8a1daf..a0f860c394b3 100644 --- a/drivers/gpu/drm/mgag200/mgag200_g200eh.c +++ b/drivers/gpu/drm/mgag200/mgag200_g200eh.c @@ -218,7 +218,7 @@ static int mgag200_g200eh_pipeline_init(struct mga_device *mdev) if (ret) return ret; - ret = mgag200_bmc_output_init(mdev, &mdev->output.vga.connector); + ret = mgag200_bmc_output_init(mdev); if (ret) return ret; diff --git a/drivers/gpu/drm/mgag200/mgag200_g200eh3.c b/drivers/gpu/drm/mgag200/mgag200_g200eh3.c index 749baefb0a7e..a7373d6572e7 100644 --- a/drivers/gpu/drm/mgag200/mgag200_g200eh3.c +++ b/drivers/gpu/drm/mgag200/mgag200_g200eh3.c @@ -122,7 +122,7 @@ static int mgag200_g200eh3_pipeline_init(struct mga_device *mdev) if (ret) return ret; - ret = mgag200_bmc_output_init(mdev, &mdev->output.vga.connector); + ret = mgag200_bmc_output_init(mdev); if (ret) return ret; diff --git a/drivers/gpu/drm/mgag200/mgag200_g200er.c b/drivers/gpu/drm/mgag200/mgag200_g200er.c index e8c84d3258aa..0407ee540b20 100644 --- a/drivers/gpu/drm/mgag200/mgag200_g200er.c +++ b/drivers/gpu/drm/mgag200/mgag200_g200er.c @@ -258,7 +258,7 @@ static int mgag200_g200er_pipeline_init(struct mga_device *mdev) if (ret) return ret; - ret = mgag200_bmc_output_init(mdev, &mdev->output.vga.connector); + ret = mgag200_bmc_output_init(mdev); if (ret) return ret; diff --git a/drivers/gpu/drm/mgag200/mgag200_g200ev.c b/drivers/gpu/drm/mgag200/mgag200_g200ev.c index e2b13a90b405..51530831d5f0 100644 --- a/drivers/gpu/drm/mgag200/mgag200_g200ev.c +++ b/drivers/gpu/drm/mgag200/mgag200_g200ev.c @@ -259,7 +259,7 @@ static int mgag200_g200ev_pipeline_init(struct mga_device *mdev) if (ret) return ret; - ret = mgag200_bmc_output_init(mdev, &mdev->output.vga.connector); + ret = mgag200_bmc_output_init(mdev); if (ret) return ret; diff --git a/drivers/gpu/drm/mgag200/mgag200_g200ew3.c b/drivers/gpu/drm/mgag200/mgag200_g200ew3.c index 384041e7b839..f18122230ffb 100644 --- a/drivers/gpu/drm/mgag200/mgag200_g200ew3.c +++ b/drivers/gpu/drm/mgag200/mgag200_g200ew3.c @@ -131,7 +131,7 @@ static int mgag200_g200ew3_pipeline_init(struct mga_device *mdev) if (ret) return ret; - ret = mgag200_bmc_output_init(mdev, &mdev->output.vga.connector); + ret = mgag200_bmc_output_init(mdev); if (ret) return ret; diff --git a/drivers/gpu/drm/mgag200/mgag200_g200se.c b/drivers/gpu/drm/mgag200/mgag200_g200se.c index 95514dcb8c53..847f0859cf62 100644 --- a/drivers/gpu/drm/mgag200/mgag200_g200se.c +++ b/drivers/gpu/drm/mgag200/mgag200_g200se.c @@ -390,7 +390,7 @@ static int mgag200_g200se_pipeline_init(struct mga_device *mdev) if (ret) return ret; - ret = mgag200_bmc_output_init(mdev, &mdev->output.vga.connector); + ret = mgag200_bmc_output_init(mdev); if (ret) return ret; diff --git a/drivers/gpu/drm/mgag200/mgag200_g200wb.c b/drivers/gpu/drm/mgag200/mgag200_g200wb.c index 0100b4d03b89..be60237680ca 100644 --- a/drivers/gpu/drm/mgag200/mgag200_g200wb.c +++ b/drivers/gpu/drm/mgag200/mgag200_g200wb.c @@ -265,7 +265,7 @@ static int mgag200_g200wb_pipeline_init(struct mga_device *mdev) if (ret) return ret; - ret = mgag200_bmc_output_init(mdev, &mdev->output.vga.connector); + ret = mgag200_bmc_output_init(mdev); if (ret) return ret;