Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3AA88C433F5 for ; Tue, 14 Sep 2021 15:20:41 +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 F0D6261159 for ; Tue, 14 Sep 2021 15:20:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org F0D6261159 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org 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 57F206E4FB; Tue, 14 Sep 2021 15:20:40 +0000 (UTC) Received: from mx2.smtp.larsendata.com (mx2.smtp.larsendata.com [91.221.196.228]) by gabe.freedesktop.org (Postfix) with ESMTPS id 04B036E4FB for ; Tue, 14 Sep 2021 15:20:37 +0000 (UTC) Received: from mail01.mxhotel.dk (mail01.mxhotel.dk [91.221.196.236]) by mx2.smtp.larsendata.com (Halon) with ESMTPS id 490fdabe-156f-11ec-9416-0050568cd888; Tue, 14 Sep 2021 15:20:25 +0000 (UTC) Received: from ravnborg.org (80-162-45-141-cable.dk.customer.tdc.net [80.162.45.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: sam@ravnborg.org) by mail01.mxhotel.dk (Postfix) with ESMTPSA id 23306194C00; Tue, 14 Sep 2021 17:20:28 +0200 (CEST) Date: Tue, 14 Sep 2021 17:20:34 +0200 X-Report-Abuse-To: abuse@mxhotel.dk From: Sam Ravnborg To: Maxime Ripard Cc: dri-devel@lists.freedesktop.org, Daniel Vetter , David Airlie , Maarten Lankhorst , Thomas Zimmermann , Emma Anholt , linux-rpi-kernel@lists.infradead.org, Dave Stevenson , Phil Elwell , Tim Gover , Dom Cobley , Nicolas Saenz Julienne , bcm-kernel-feedback-list@broadcom.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 3/3] drm/vc4: hdmi: Actually check for the connector status in hotplug Message-ID: References: <20210914101724.266570-1-maxime@cerno.tech> <20210914101724.266570-3-maxime@cerno.tech> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210914101724.266570-3-maxime@cerno.tech> 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" Hi Maxime, On Tue, Sep 14, 2021 at 12:17:24PM +0200, Maxime Ripard wrote: > The drm_helper_hpd_irq_event() documentation states that this function > is "useful for drivers which can't or don't track hotplug interrupts for > each connector." and that "Drivers which support hotplug interrupts for > each connector individually and which have a more fine-grained detect > logic should bypass this code and directly call > drm_kms_helper_hotplug_event()". This is thus what we ended-up doing. > > However, what this actually means, and is further explained in the > drm_kms_helper_hotplug_event() documentation, is that > drm_kms_helper_hotplug_event() should be called by drivers that can > track the connection status change, and if it has changed we should call > that function. > > This underlying expectation we failed to provide is that the caller of > drm_kms_helper_hotplug_event() should call drm_helper_probe_detect() to > probe the new status of the connector. > > Since we didn't do it, it meant that even though we were sending the > notification to user-space and the DRM clients that something changed we > never probed or updated our internal connector status ourselves. > > This went mostly unnoticed since the detect callback usually doesn't > have any side-effect. Also, if we were using the DRM fbdev emulation > (which is a DRM client), or any user-space application that can deal > with hotplug events, chances are they would react to the hotplug event > by probing the connector status eventually. > > However, now that we have to enable the scrambler in detect() if it was > enabled it has a side effect, and an application such as Kodi or > modetest doesn't deal with hotplug events. This resulted with a black > screen when Kodi or modetest was running when a screen was disconnected > and then reconnected, or switched off and on. > > Signed-off-by: Maxime Ripard I leave it to you and Daniel to sort out this patch. Sam