Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp154720iob; Mon, 2 May 2022 15:45:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+P1TlRqk3IO6wxBIv+QiKpnjENME6bpEoK6O7vd+ynG8fEcTD26N4LEJj76t2vxg6qvMj X-Received: by 2002:ac2:4f03:0:b0:443:5d9d:819d with SMTP id k3-20020ac24f03000000b004435d9d819dmr9876886lfr.165.1651531511354; Mon, 02 May 2022 15:45:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651531511; cv=none; d=google.com; s=arc-20160816; b=WluHKL7bDKrA9BwzLuFLZOQO4Dfd2BHglCkGFTRa3lvUnmV1dByfBf9cBzddiC8b6d 3fKnb61huEGsHoL+M5s+64SWUPnj72niNwqYLeTmNld2bHx1U7wNZJcd641TiZGbNKGG hfqa9JWHgotNdG3OB/xj93gDAWIgT9FKT4JBjPwDleq+wDz788FNvm9yRG9UkNQ2zLzJ uNminXiFIkiigO5H2gj9kyHnKNi73O+bgDswl5KO+T9729RVsz7S3p3tan4VgteqiZv5 9i2+ZfnLwLflrruo1YAXr63R1PUZ78h8d63y4X/IKH/v9g5y43V5GGYtWSyIbeHo41dS AADQ== 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:from:in-reply-to :references:mime-version:dkim-signature; bh=74bxgGuHU9jSk3+QuQXZKRvlg8V04rNVxn+TIhl3ghI=; b=bHsRgMIw+yD9u3pMNYyVBxzkValrYPECuXh/srgLFxbxoHc+nHOUOLhC+x2JnJl7HE iefYkjGQKhmFxUYSE0T6wOu985W5DhkcjN8QbP/C/AIJTDvIS/sB9KrkZmHfOjIKAmnn 4hbXWASeKoOm/8nMnOJtiSaQFNM1/cPTWa+Cq/PLr/zw7v5xBjm5QqmVECSSaP42s6jb +MNe3xgtFvYfO2EfHikwi8RwsGhxvLucGeH607qc7f+rWepqmB3Mc0vXBmOxhPmtBmBE M2UmtBwIjunYi5mS51Z1VEgcowR4RpmriQwndlSnVqChm6YiORKQoyJn7+YNsNN/5+9s JuMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=US2i16G1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c30-20020a19655e000000b00471a1b9f5e8si13695181lfj.40.2022.05.02.15.44.44; Mon, 02 May 2022 15:45:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=US2i16G1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237872AbiEBOlb (ORCPT + 99 others); Mon, 2 May 2022 10:41:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237747AbiEBOl2 (ORCPT ); Mon, 2 May 2022 10:41:28 -0400 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64AD510BD for ; Mon, 2 May 2022 07:37:59 -0700 (PDT) Received: by mail-pg1-x536.google.com with SMTP id i62so11841423pgd.6 for ; Mon, 02 May 2022 07:37:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=74bxgGuHU9jSk3+QuQXZKRvlg8V04rNVxn+TIhl3ghI=; b=US2i16G1FslRkGzUxXxBxn5PpAczH/bRPVsvbNYjBDpAbIud3dKvEm6qAcX8D/oZ5Z Tk9hvG3m4vnc71cxDEuZQRK/OOh4iXy1/kZVMLznQYGfhpbxBzLaTpJr7xzbcITYCPoR d+Qx9Lsf6E7YpfDfJwEzuvPwbx3SMTstl+zX30Yzd5dIFyfrgjAqTESfzPSnxoKc66Pw HYpEOptx+COAhLTNA1avuz+BaGoEm9EBzevRp4pdPJWXXZn1dLx6adODGE0pH46ilwUT k2Ush7C83FevsksKSoImxQFzDDSLTI0oI+vQAzXUD4dl+j++RxPC9LjzqYDQy2FMVMrR uAdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=74bxgGuHU9jSk3+QuQXZKRvlg8V04rNVxn+TIhl3ghI=; b=xQ2HUtFXiWQC3AN2piT/XUGtvXPesmFLgBRq/gvknj8566rZ+TYgqs9S/OqHMsTfcb K+8jKpY3X3MKE4SzgSS/K8h7ZfH3blGOcRBMfhODRlkrdlL5qsATA7fcvbleVPHISNIk nAYiyvI8OeXJKteSozOcsQRRLyWQby0brM0eJMpJl8pnjLR+aPnGxPudgR92yvlODztf PlXI0KQtCvgpcm8MNaU3X+pkJ2+5Ea+YCpWUJwnPuLCT3VyTaVv4HENNcKLSIltXfo+x GaaYKFTfkd+DNUbXRTsy9fFgHYjQzlbbqGH/p8pNgtLXkzO3JPbVq8dPpLGYayo19OE2 QFCA== X-Gm-Message-State: AOAM5311CLzn2hb3Qke4QM9WWLRSrScCXU6d+ev+zeg++mWZ/Du4uK1C hA5VIKGs1/GgPWDA7vHEKTtjzMogO4xxCGdYIBjxsQ== X-Received: by 2002:a62:6d47:0:b0:4fe:15fa:301d with SMTP id i68-20020a626d47000000b004fe15fa301dmr11688627pfc.29.1651502278898; Mon, 02 May 2022 07:37:58 -0700 (PDT) MIME-Version: 1.0 References: <20220425134424.1150965-1-treapking@chromium.org> In-Reply-To: <20220425134424.1150965-1-treapking@chromium.org> From: Robert Foss Date: Mon, 2 May 2022 16:37:48 +0200 Message-ID: Subject: Re: [PATCH] drm/bridge: it6505: Send DPCD SET_POWER to downstream To: Pin-Yen Lin Cc: Andrzej Hajda , Neil Armstrong , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , Hsin-Yi Wang , Allen Chen , AngeloGioacchino Del Regno , Hermes Wu , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 25 Apr 2022 at 15:44, Pin-Yen Lin wrote: > > Send DPCD SET_POWER command to downstream in .atomic_disable to make the > downstream monitor enter the power down mode, so the device suspend won't > be affected. > > Fixes: b5c84a9edcd418 ("drm/bridge: add it6505 driver") > Signed-off-by: Pin-Yen Lin > --- > > drivers/gpu/drm/bridge/ite-it6505.c | 29 ++++++++++++++++++----------- > 1 file changed, 18 insertions(+), 11 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/ite-it6505.c > index 8fed30df08b0..4b673c4792d7 100644 > --- a/drivers/gpu/drm/bridge/ite-it6505.c > +++ b/drivers/gpu/drm/bridge/ite-it6505.c > @@ -737,8 +737,9 @@ static int it6505_drm_dp_link_probe(struct drm_dp_aux *aux, > return 0; > } > > -static int it6505_drm_dp_link_power_up(struct drm_dp_aux *aux, > - struct it6505_drm_dp_link *link) > +static int it6505_drm_dp_link_set_power(struct drm_dp_aux *aux, > + struct it6505_drm_dp_link *link, > + u8 mode) > { > u8 value; > int err; > @@ -752,18 +753,20 @@ static int it6505_drm_dp_link_power_up(struct drm_dp_aux *aux, > return err; > > value &= ~DP_SET_POWER_MASK; > - value |= DP_SET_POWER_D0; > + value |= mode; > > err = drm_dp_dpcd_writeb(aux, DP_SET_POWER, value); > if (err < 0) > return err; > > - /* > - * According to the DP 1.1 specification, a "Sink Device must exit the > - * power saving state within 1 ms" (Section 2.5.3.1, Table 5-52, "Sink > - * Control Field" (register 0x600). > - */ > - usleep_range(1000, 2000); > + if (mode == DP_SET_POWER_D0) { > + /* > + * According to the DP 1.1 specification, a "Sink Device must > + * exit the power saving state within 1 ms" (Section 2.5.3.1, > + * Table 5-52, "Sink Control Field" (register 0x600). > + */ > + usleep_range(1000, 2000); > + } > > return 0; > } > @@ -2624,7 +2627,8 @@ static enum drm_connector_status it6505_detect(struct it6505 *it6505) > if (it6505_get_sink_hpd_status(it6505)) { > it6505_aux_on(it6505); > it6505_drm_dp_link_probe(&it6505->aux, &it6505->link); > - it6505_drm_dp_link_power_up(&it6505->aux, &it6505->link); > + it6505_drm_dp_link_set_power(&it6505->aux, &it6505->link, > + DP_SET_POWER_D0); > it6505->auto_train_retry = AUTO_TRAIN_RETRY; > > if (it6505->dpcd[0] == 0) { > @@ -2960,8 +2964,11 @@ static void it6505_bridge_atomic_disable(struct drm_bridge *bridge, > > DRM_DEV_DEBUG_DRIVER(dev, "start"); > > - if (it6505->powered) > + if (it6505->powered) { > it6505_video_disable(it6505); > + it6505_drm_dp_link_set_power(&it6505->aux, &it6505->link, > + DP_SET_POWER_D3); > + } > } > > static enum drm_connector_status > -- > 2.36.0.rc2.479.g8af0fa9b8e-goog > Reviewed-by: Robert Foss Applied to drm-misc-next.