Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1008613rwb; Sat, 17 Sep 2022 21:36:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5dTwwkeEOLZsiuR4p1tyuvfyH/cyeEsmkgIwzy92QrQiCOAhW8inZD7j9nSfTysUYlqSu1 X-Received: by 2002:a17:90a:6405:b0:203:6eaa:4999 with SMTP id g5-20020a17090a640500b002036eaa4999mr6066206pjj.8.1663475794470; Sat, 17 Sep 2022 21:36:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663475794; cv=none; d=google.com; s=arc-20160816; b=GRWpgT7D1bUnoWAZ+MOwKgYX8xHnH9SzghIZibMVaxGOaKb1wyuRSvgoxN7SxFrXSb 0m49JmF1rEmyqAtwORrlkGAiAUzmijkeCt2fipd96Pig87mtwnCB7gpnL+uVz5MUAUf9 90sR/idgzrSPFGmtIe2CKn8dREdeuC4voBniZoH1/rExOnI+5cxhoMok//43qb9iyNEK AWbZ1dI6rtxjvg9G6yJDya7Y9iCjFgoyDwxw89H0ghAFxEFtdIms0JQO2uGwlM55TnIY bBAU0mOHrsx+doZQArEwejtdD+DwK5XxfjAZ52VSoST+7Gkb6+TubF/Yn1HD6bM5GqB2 kSjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=+joaMY7hqrcCPOaz1s4O/2dULBa1V2QHlCVuiQ9Hdm4=; b=GN+K7lHEiATnIgD0xJ6tijSuBrW6JjrAx2uDiSzy4WtMctyh99CUq1K/vv1ymO3OW8 N5F1iY3hdI3MtMWhgKSsQ9TMe3N0T0Rwt0HwqqTB3gc8qEo941Xypmzxj7p/u4l1OiSJ +n74XbN6ZgkOGkhBo9Kh4GkUO916Gn8TESy61xWRngTP7Ki4/AIwsWDtnsK2YcHEoVHW 6K5iIjCNbk1TQsq6nwpeEGM+86UAuTcw9FjOtWL8wzuCbffW/B4KsaJXRmgqd9Wpp8Tw oPpBWZDW/FLx7PYNxoIf9K4RlJNxqc1RPu8cuLNtuX8+9YIRrPpdKCM6EHoH02mF1XQV VfZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SZKRRMjt; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lk13-20020a17090b33cd00b002000fca8d77si8177788pjb.138.2022.09.17.21.36.22; Sat, 17 Sep 2022 21:36:34 -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=@kernel.org header.s=k20201202 header.b=SZKRRMjt; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229539AbiIREcl (ORCPT + 99 others); Sun, 18 Sep 2022 00:32:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbiIREci (ORCPT ); Sun, 18 Sep 2022 00:32:38 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 938FF2717F for ; Sat, 17 Sep 2022 21:32:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D5EF661228 for ; Sun, 18 Sep 2022 04:32:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B1E4C433D7 for ; Sun, 18 Sep 2022 04:32:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663475554; bh=eM/QQQyukAm+XDVeiBT7gGoM5l7VFfdhk5Bm7ROWEdQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=SZKRRMjt8D0ds+0o4jQfDeDLuNMEVbYhWGfQduOMBba6Tyxen36J+XRRDS1jQCUsG oyk6AEwWBlh875ulYgRpDVgmWBjMj47DMPA2g9VCdVunWKNdQJ+/KfBfukrMr/E2Vj WiG2AMp4e+QUeQUPRWx2V4av/Okw4Ya39Rx4nOgecASpDa+SPKtPOg/bWjth7cZpqG 7P7A8rkjm364pE8xNYwFjIUkuUJCV030DV2Pmi/2sUk2x9IgvQH6W+JBYeSirrUrMx 1wDIwVRBC5VhI9qzTojR9srZq5gzs/4hJR4iR0gSaJA6zpVXiuF/8PBFdxTKhqU6YH 3gyxqSI1hkyZQ== Received: by mail-ot1-f49.google.com with SMTP id w22-20020a056830061600b006546deda3f9so17666916oti.4 for ; Sat, 17 Sep 2022 21:32:34 -0700 (PDT) X-Gm-Message-State: ACrzQf33fKxYquZrCpQRtKOkd9c+YiJ7bQ7yLFNfUvvzwuu8nbHyGzIh cWlWjXA1EMLGk5lZvJje/tDpOAO53Qaq5WIjPA== X-Received: by 2002:a05:6830:6999:b0:61d:26f8:94c1 with SMTP id cy25-20020a056830699900b0061d26f894c1mr5511290otb.278.1663475553315; Sat, 17 Sep 2022 21:32:33 -0700 (PDT) MIME-Version: 1.0 References: <20220914140031.18578-1-allen-kh.cheng@mediatek.com> In-Reply-To: <20220914140031.18578-1-allen-kh.cheng@mediatek.com> From: Chun-Kuang Hu Date: Sun, 18 Sep 2022 12:32:22 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] drm: mediatek: Fix display vblank timeout when disable dsi To: Allen-KH Cheng Cc: Chun-Kuang Hu , Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger , AngeloGioacchino Del Regno , Project_Global_Chrome_Upstream_Group , DRI Development , Linux ARM , linux-kernel , "moderated list:ARM/Mediatek SoC support" , Xinlei Lee Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 Hi, Allen: Allen-KH Cheng =E6=96=BC 2022=E5=B9=B49=E6=9C= =8814=E6=97=A5 =E9=80=B1=E4=B8=89 =E6=99=9A=E4=B8=8A10:00=E5=AF=AB=E9=81=93= =EF=BC=9A > > From: Xinlei Lee > > Dsi is turned off at bridge.disable, causing crtc to wait for vblank > timeout. It is necessary to add count protection to turn off dsi and > turn off at post_disable. If turn off dsi in post_disable(), you should turn on dsi in pre_enable(). There is another patch fix this problem [1], do you have any comment on that patch? [1] http://lists.infradead.org/pipermail/linux-mediatek/2022-August/046713.= html Regards, Chun-Kuang. > > Fixes: cde7e2e35c28 ("drm/mediatek: Separate poweron/poweroff from enable= /disable and define new funcs") > Signed-off-by: Xinlei Lee > Co-developed-by: Allen-KH Cheng > Signed-off-by: Allen-KH Cheng > --- > Change in v1: > * Rebase to kernel/git/chunkuang.hu/linux.git, mediatek-drm-fixes > [Allen-KH Cheng ] > --- > --- > drivers/gpu/drm/mediatek/mtk_dsi.c | 15 ++++++--------- > 1 file changed, 6 insertions(+), 9 deletions(-) > > diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediate= k/mtk_dsi.c > index 5b624e0f5b0a..e30f4244c001 100644 > --- a/drivers/gpu/drm/mediatek/mtk_dsi.c > +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c > @@ -768,14 +768,6 @@ static void mtk_dsi_bridge_mode_set(struct drm_bridg= e *bridge, > drm_display_mode_to_videomode(adjusted, &dsi->vm); > } > > -static void mtk_dsi_bridge_atomic_disable(struct drm_bridge *bridge, > - struct drm_bridge_state *old_br= idge_state) > -{ > - struct mtk_dsi *dsi =3D bridge_to_dsi(bridge); > - > - mtk_output_dsi_disable(dsi); > -} > - > static void mtk_dsi_bridge_atomic_enable(struct drm_bridge *bridge, > struct drm_bridge_state *old_bri= dge_state) > { > @@ -803,13 +795,15 @@ static void mtk_dsi_bridge_atomic_post_disable(stru= ct drm_bridge *bridge, > { > struct mtk_dsi *dsi =3D bridge_to_dsi(bridge); > > + if (dsi->refcount =3D=3D 1) > + mtk_output_dsi_disable(dsi); > + > mtk_dsi_poweroff(dsi); > } > > static const struct drm_bridge_funcs mtk_dsi_bridge_funcs =3D { > .attach =3D mtk_dsi_bridge_attach, > .atomic_destroy_state =3D drm_atomic_helper_bridge_destroy_state, > - .atomic_disable =3D mtk_dsi_bridge_atomic_disable, > .atomic_duplicate_state =3D drm_atomic_helper_bridge_duplicate_st= ate, > .atomic_enable =3D mtk_dsi_bridge_atomic_enable, > .atomic_pre_enable =3D mtk_dsi_bridge_atomic_pre_enable, > @@ -829,6 +823,9 @@ void mtk_dsi_ddp_stop(struct device *dev) > { > struct mtk_dsi *dsi =3D dev_get_drvdata(dev); > > + if (dsi->refcount =3D=3D 1) > + mtk_output_dsi_disable(dsi); > + > mtk_dsi_poweroff(dsi); > } > > -- > 2.18.0 >