Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1970826rwe; Fri, 2 Sep 2022 06:47:41 -0700 (PDT) X-Google-Smtp-Source: AA6agR6/JxNZ/HTwpIfbjhGKBj6wp6oYYffkjMMO2H7X1HFNRJwww0UPJ86LnYPJrCedxzC5YeZY X-Received: by 2002:a17:90b:3e8b:b0:1f5:8706:18a1 with SMTP id rj11-20020a17090b3e8b00b001f5870618a1mr5131056pjb.112.1662126461234; Fri, 02 Sep 2022 06:47:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662126461; cv=none; d=google.com; s=arc-20160816; b=kkGglzpEX4fDJbXqUjzYjX0JVpZDfwbSeV0OTjSQbmtFXC+oU9+dsclz033cYCjEH9 oBT0qQWdEitWrsNY72U7pZV7g8ODMpWLdvRP3MbxIMRh4kABZ80y9jxTShbWb4F/xpd/ EkFpF+foO0VuuJFEl6kQ074lm/NGQE7fCMQGAvF+IxpRACjEVgrIL7+4shXOWpMTUtil ZUiShzHW2UtPuwqaUPO1pHP3HJm8yQX+7rt1O7+bymL7SMP0yGEuS7nNvitxwmAl6AIr tjIh8tYde3EIgTdyUVz9C2jxUv7JrVqqpI5UV3a6wOa6utRplsNtXxlzkLVubYiP4UiT i+HQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=lzpsM4tw01OHu4CPusoNY2zqFC1MIkOSxaXGk5bUlFg=; b=Pz/LhJPb/w3RNZKqQcxro91pMRY1EsgEdeAeWCPzVUGapSOXrhDH+10MbpNrnKRPD1 asrk6mliKR8UwQkWZvE4GQD5HqPd834Dgp5SdVIGcUcpE1eaM5wJeu+UYFdO2f0412+x 7L4+I8hroBB8z8B85/PKl5hvAifZQzMZUuGmyaxw+epxGtcLem8zY5Q0PtGy6tu/Fki0 OlzcgBmu1RkgwoMsHMlv5mxSpDIK0sydeRMjm19jvHYXPm3jsCMcD3B7O7PkZspAic2+ aoCHImin6kBJV7dPPU9pp6aF3jcMh+lXJ+M1SuVwg7xdrLWKG11+d9/HF96M8p8NmNdW TeRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gmjAY9cH; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x10-20020a656aaa000000b0042b1e17d98csi2179947pgu.438.2022.09.02.06.47.25; Fri, 02 Sep 2022 06:47:41 -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=@linuxfoundation.org header.s=korg header.b=gmjAY9cH; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238067AbiIBM4J (ORCPT + 99 others); Fri, 2 Sep 2022 08:56:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238162AbiIBMx7 (ORCPT ); Fri, 2 Sep 2022 08:53:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2611BFAC7C; Fri, 2 Sep 2022 05:38:41 -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 10F806220F; Fri, 2 Sep 2022 12:38:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7D2C8C433C1; Fri, 2 Sep 2022 12:38:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1662122290; bh=nhUr/88MHNCkeqrs9I8L0gz/xSyEscGNpdglzYedMMM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gmjAY9cH3KYPCXV0GRUclDxNHfSsjvJ3uW7FRVpzWV7klRvRioO5q9M6YccL7FDPY MHQRyoLmfM84tViGY0+cKyEShu/b4Hni57fwfRVMKcUF+jz3JVRNE+JxjsKF2Cat3x gq1UTP/GemjBH0aQ11EMGqO3R8zfu2WT7yJ65xgw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sun peng Li , Brian Chang , Tom Chung , Daniel Wheeler , Alex Deucher , Sasha Levin Subject: [PATCH 5.19 57/72] drm/amd/display: Fix plug/unplug external monitor will hang while playback MPO video Date: Fri, 2 Sep 2022 14:19:33 +0200 Message-Id: <20220902121406.640002900@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220902121404.772492078@linuxfoundation.org> References: <20220902121404.772492078@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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,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 From: Tom Chung [ Upstream commit e98459c06e3d45c2229b097f7b8cdd412357fa2f ] [Why] Pipes for MPO primary and overlay will be power down and power up during plug/unplug external monitor while MPO video playback. But the pipes were the same after plug/unplug and should not need to be power down and power up or it will make page flip interrupt disabled and cause hang issue. [How] Add pipe split change condition that not only check the top pipe pointer but also check the index of top pipe if both top pipes are available. Reviewed-by: Sun peng Li Acked-by: Brian Chang Signed-off-by: Tom Chung Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/dc/core/dc.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c index 7d69341acca02..9dbd965d8afb3 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c @@ -1067,8 +1067,15 @@ static void disable_dangling_plane(struct dc *dc, struct dc_state *context) struct dc_stream_state *old_stream = dc->current_state->res_ctx.pipe_ctx[i].stream; bool should_disable = true; - bool pipe_split_change = - context->res_ctx.pipe_ctx[i].top_pipe != dc->current_state->res_ctx.pipe_ctx[i].top_pipe; + bool pipe_split_change = false; + + if ((context->res_ctx.pipe_ctx[i].top_pipe) && + (dc->current_state->res_ctx.pipe_ctx[i].top_pipe)) + pipe_split_change = context->res_ctx.pipe_ctx[i].top_pipe->pipe_idx != + dc->current_state->res_ctx.pipe_ctx[i].top_pipe->pipe_idx; + else + pipe_split_change = context->res_ctx.pipe_ctx[i].top_pipe != + dc->current_state->res_ctx.pipe_ctx[i].top_pipe; for (j = 0; j < context->stream_count; j++) { if (old_stream == context->streams[j]) { -- 2.35.1