Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3802299rdh; Fri, 29 Sep 2023 02:48:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGhg06nCJNfDi0kAuzWZgJedUljsUvUWiL77b2F4OgKThEKMMR0AKfxcHkwufOwOr/7Dnp0 X-Received: by 2002:a05:6870:8908:b0:1bf:7b3:5116 with SMTP id i8-20020a056870890800b001bf07b35116mr3846257oao.47.1695980910590; Fri, 29 Sep 2023 02:48:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695980910; cv=none; d=google.com; s=arc-20160816; b=ohOyMytr/+B5PNburSAW4kfgOPMBQPwHNyoPOaKsmfHAAtyS3UcHqx2DL8tHG+qNFN xQAsrc2AiyYMHIIdG+Pu4ekKy4jmeJl8Yh+IhiYF4rvu21SwqnQ9druMoOETmO7JY7Q4 iLXVOQZoqJUfPApOe51NQBQy4/rcV6MBzr0ydydi16bDU43EWtauskbhRYP5hS/mSoP4 vjEWx01H0WGvOGpjgXav3Lsm7PZLbF5wwb/tzEwaCYUBrmL27VZ1ug3xNzdLCtPuANdO CFvaz4zZasdpJntx3MnJys6XkyE+wnWtrIuKY69XpLY0p/GZA06jOT980Zwbieieh3Hh ceVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:user-agent:from :references:in-reply-to:mime-version:dkim-signature; bh=3ZPhCbxws0N6c+RxZtsL4OLtzT2jJtD2gNaLRXE6jZk=; fh=A8fdtc9EjgioAHRQ7J8YYhyd5rnob49R55gB/unpZMY=; b=jf1pvJKnZimQYsQoUkzR1om5YVt3PvQ39uxPVp/iGLAwClszRa+CDbwngJf9DJKcfm O13M+7TC19EGX2X5K83cbdyxtkfc2v7/0MIza2s5AJMBEe3BqM4R3hpHHPpnMoOlkisj SPe8/RzGLkdFDr+4S7o+/hZpR4R4MRCYGdB5KtYrYaguwstVWYY3LjrZiSfjWE8NtWfh 7zyhZO9ww9PExbu+fGSPtnAM4MvrzerXt+cexelKJCCBKrh55UbpwvmCKwFquLkvHTHt nNQ87ExavXh8p9X8QbcgMlUjeADXYJrGeVtjbypL1qvThCQz51C5tElPeZLBg469mGIa pr+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=X4E8ZJIn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id k68-20020a633d47000000b0055e48c43ab7si1102198pga.470.2023.09.29.02.48.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 02:48:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=X4E8ZJIn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 389158041316; Wed, 27 Sep 2023 14:41:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230030AbjI0Vlg (ORCPT + 99 others); Wed, 27 Sep 2023 17:41:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230007AbjI0Vlf (ORCPT ); Wed, 27 Sep 2023 17:41:35 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2AE4511F for ; Wed, 27 Sep 2023 14:41:32 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-5041cc983f9so19665857e87.3 for ; Wed, 27 Sep 2023 14:41:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1695850890; x=1696455690; darn=vger.kernel.org; h=cc:to:subject:message-id:date:user-agent:from:references :in-reply-to:mime-version:from:to:cc:subject:date:message-id :reply-to; bh=3ZPhCbxws0N6c+RxZtsL4OLtzT2jJtD2gNaLRXE6jZk=; b=X4E8ZJInMKf9xiOm1BpuKjvUzoEO4cmna+W9GWPVwEIibguhsjIicw3jk5dPz2WAo3 FIokgD+M89zjfMrdHRkHLWs2zOc0kHXZuygKR3FgocXnmeKFnhb1gsyEfu0bh4MIXKas E++kcGOn4pAQLXKHf/ZFIOfsmHmcmjmL4SAts= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695850890; x=1696455690; h=cc:to:subject:message-id:date:user-agent:from:references :in-reply-to:mime-version:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=3ZPhCbxws0N6c+RxZtsL4OLtzT2jJtD2gNaLRXE6jZk=; b=mX9nOKfKu3SXF9woiTIFwOG4kqjt55kIDlLmz8XU9wTyuF88B5LDLFjaT40ha+LIaY 5UaPFbycMod4ADrjsrrViP3DIm/HQQOpElA74f3RV7Xa1mcBMsccUAlIEJt1X2LIOOCN 6RdtQ4KqLfH9P5z7ZzyGpcmUTCOFrxKN/uHERc7UtLO3of93SSZ2Nn2PCgb2kp8AoD4t w87z4kJRHgKAfucm9a9ml0BcINVuvYEwWgci8+2zcq6oFQZSW9NWmL2LffvDEiFa82hq DBf1PsEQbNQfKV2CXHGWERclYZrCpnw2R1TOqMLSDX26jrmrvDVVUirjUjxI8Oy8Ii1p pgpw== X-Gm-Message-State: AOJu0YxHwfT+7VBzzKcJ6mL5ok9rg7RcyantmOtg1msKh77QR8mjBZbr TyIm1S+1+pvM585fccWKMexura3TxO21EfrQtNUYFg== X-Received: by 2002:a05:6512:3089:b0:504:31a0:f9e2 with SMTP id z9-20020a056512308900b0050431a0f9e2mr3398152lfd.58.1695850890154; Wed, 27 Sep 2023 14:41:30 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 27 Sep 2023 16:41:29 -0500 MIME-Version: 1.0 In-Reply-To: <65566a68-3510-2e5f-7d57-e4dba08c008c@quicinc.com> References: <1694813901-26952-1-git-send-email-quic_khsieh@quicinc.com> <1694813901-26952-7-git-send-email-quic_khsieh@quicinc.com> <2f98d5f1-57c1-d9fe-cb1c-b975db057287@quicinc.com> <65566a68-3510-2e5f-7d57-e4dba08c008c@quicinc.com> From: Stephen Boyd User-Agent: alot/0.10 Date: Wed, 27 Sep 2023 16:41:29 -0500 Message-ID: Subject: Re: [PATCH v3 6/7] drm/msm/dp: add pm_runtime_force_suspend()/resume() To: Abhinav Kumar , Dmitry Baryshkov , Kuogee Hsieh Cc: dri-devel@lists.freedesktop.org, robdclark@gmail.com, sean@poorly.run, dianders@chromium.org, vkoul@kernel.org, daniel@ffwll.ch, airlied@gmail.com, agross@kernel.org, andersson@kernel.org, quic_jesszhan@quicinc.com, quic_sbillaka@quicinc.com, marijn.suijten@somainline.org, freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 27 Sep 2023 14:41:49 -0700 (PDT) Quoting Abhinav Kumar (2023-09-22 18:35:27) > On 9/22/2023 2:54 PM, Stephen Boyd wrote: > > Quoting Dmitry Baryshkov (2023-09-19 02:50:12) > >> > >> This should be hpd_notify, who starts link training, not some event. > > > > I think this driver should train the link during atomic_enable(), not > > hpd_notify() (or directly from the irq handler). The drm_bridge_funcs > > talk a bit about when the clocks and timing signals are supposed to be > > enabled. For example, struct drm_bridge_funcs::atomic_pre_enable() says > > the "display pipe (i.e. clocks and timing signals) feeding this bridge > > will not yet be running when this callback is called". And struct > > drm_bridge_funcs::atomic_enable() says "this callback must enable the > > display link feeding the next bridge in the chain if there is one." > > > > That looks to me like link training, i.e. the display link, should > > happen in the enable path and not hpd_notify. It looks like link > > training could fail, but when that happens I believe the driver should > > call drm_connector_set_link_status_property() with > > DRM_MODE_LINK_STATUS_BAD. The two callers of that which exist in the > > tree also call drm_kms_helper_hotplug_event() or > > drm_kms_helper_connector_hotplug_event() after updating the link so that > > userspace knows to try again. > > > > It would be nice if there was some drm_bridge_set_link_status_bad() API > > that bridge drivers could use to signal that the link status is bad and > > call the hotplug helper. Maybe it could also record some diagnostics > > about which bridge failed to setup the link and stop the atomic_enable() > > chain for that connector. > > Doing link training when we get hpd instead of atomic_enable() is a > design choice we have been following for a while because for the case > when link training fails in atomic_enable() and setting the link status > property as you mentioned, the compositor needs to be able to handle > that and also needs to try with a different resolution or take some > other corrective action. We have seen many compositors not able to > handle this complexity. The chrome compositor handles this case[1]. If the link status is set to bad and there are non-zero number of modes on a connected connector it resets the status to good to try again. > So the design sends the hotplug to usermode only > after link training succeeds. I suspect this is why my trogdor device turns off after rebooting when I apply a ChromeOS update with the lid closed and DP connected. Userspace wants to know that a display is connected, but this driver is still link training by the time userspace boots up so we don't see any drm connector indicating status is connected. No drm connectors connected means the OS should shutdown. > > I do not think we should change this design unless prototyped with an > existing compositor such as chrome or android at this point. Is this driver used with android? [1] https://source.chromium.org/chromium/chromium/src/+/main:ui/ozone/platform/drm/gpu/hardware_display_plane_manager_atomic.cc;l=114;drc=67520ac99db89395b10f2ab728b540eef0da8292