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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 774F0C433EF for ; Mon, 27 Sep 2021 16:11:06 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 3DC8260F24 for ; Mon, 27 Sep 2021 16:11:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3DC8260F24 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cerno.tech Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7E3D589DBD; Mon, 27 Sep 2021 16:11:04 +0000 (UTC) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by gabe.freedesktop.org (Postfix) with ESMTPS id 63D1289DBD for ; Mon, 27 Sep 2021 16:11:03 +0000 (UTC) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id E552B3201C6E; Mon, 27 Sep 2021 12:10:59 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 27 Sep 2021 12:11:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=fm3; bh=OtsVThTQiVGXdpFZSDZtAk8j24 rGRsiJqNTfaB433c0=; b=Ju7UG7C4J6vhrcdKRCGwLKSssbKGbM+HCG668r0EE8 FjNAI6kI0UZxfoBsSJodRJVKu9OXuzn1cL6icTfBzd389qgCiGrQA0T6C/IEA6Z3 JqA54dpX1nYkhJg/6kinPHrIkMeHUFCphnwg8kATzI/gIWo+5xe/c1WCARwuaxnb gGzv0kW3czjtuS4gn1pr+GkJKQjAUsDWaHwDiFuI63ViyjyrBSlsHqZKixIH/DjA jbd3sItt0zSdcdN5fzPhO8EQHKy4grF6d43LSFbApanJkQnX5T1fY1f2qLVgUKCH gSmBfnSNMcZsWEYq5LMeJ6Gu4tbTwpVrXEEFFZkoljjw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=OtsVThTQiVGXdpFZS DZtAk8j24rGRsiJqNTfaB433c0=; b=iCFqD5eTwbx0LJgAk/IFz14My6bBDaz2w K7fs/Ryp8votpWutHpaP1mv/BAwuNYy7H9fPY2cN9gDjWw03W9XqTf4+saKUTpPw IdfKceW1Ok8Miw20x3Qfw7TZ8IQmK7b/2bHi6u8DG2d6Qc1LyJIK+IEt0r97A4Yh pNRMZJywhS0Nni/0XAErTK62ZbU38c7F+Yo0kJPYjy5GP7wbcSkc57e0cL6Gug+V rZFdNfJAb8dRhKdnGDIU/Ureu/yRO5AyFETeGOX8S5SsSlH0+uyxiBEk4fNbNyfH ux132/ZWOpvBxl3tsI5FeFoXwxwIksvdoPJI4n6wNYZixdlAy/yXQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudejkedgleeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffoggfgsedtkeertdertddtnecuhfhrohhmpeforgigihhmvgcu tfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrthhtvg hrnhepjeffheduvddvvdelhfegleelfffgieejvdehgfeijedtieeuteejteefueekjeeg necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhgrgi himhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 27 Sep 2021 12:10:58 -0400 (EDT) From: Maxime Ripard To: Daniel Vetter , David Airlie , Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard Cc: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/scdc: Document hotplug gotchas Date: Mon, 27 Sep 2021 18:10:55 +0200 Message-Id: <20210927161055.529050-1-maxime@cerno.tech> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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" There's some interactions between the SCDC setup and the disconnection / reconnection of displays. Let's document it and a solution. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/drm_scdc_helper.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/gpu/drm/drm_scdc_helper.c b/drivers/gpu/drm/drm_scdc_helper.c index 48a382464d54..12e09fe8c8df 100644 --- a/drivers/gpu/drm/drm_scdc_helper.c +++ b/drivers/gpu/drm/drm_scdc_helper.c @@ -34,6 +34,19 @@ * HDMI 2.0 specification. It is a point-to-point protocol that allows the * HDMI source and HDMI sink to exchange data. The same I2C interface that * is used to access EDID serves as the transport mechanism for SCDC. + * + * Note: The SCDC status is going to be lost when the display is + * disconnected. This can happen physically when the user disconnects + * the cable, but also when a display is switched on (such as waking up + * a TV). + * + * This is further complicated by the fact that, upon a disconnection / + * reconnection, KMS won't change the mode on its own. This means that + * one can't just rely on setting the SCDC status on enable, but also + * has to track the connector status changes using interrupts and + * restore the SCDC status. The typical place to restore that state is + * in drm_encoder_helper_funcs.detect() or + * drm_connector_helper_funcs.detect_ctx(). */ #define SCDC_I2C_SLAVE_ADDRESS 0x54 -- 2.31.1