Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp996911pxb; Wed, 6 Apr 2022 06:19:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvUwedxyeRlfNhkrowWBqXg6WZIn4uBb6kdUYaHIfdeTp+0ZThgVjMtwb1v1wPShCMn6Ro X-Received: by 2002:a17:902:e74f:b0:154:6052:55b2 with SMTP id p15-20020a170902e74f00b00154605255b2mr8534862plf.106.1649251183844; Wed, 06 Apr 2022 06:19:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649251183; cv=none; d=google.com; s=arc-20160816; b=075xxZgxRfxNXesGWuTv82zHKFebC8MENxxbmIzd3ZcaPl4G5QyfS9aCoNMJqeuHNs 8i7fU+oaiyqGWeOde+nXMS9iZU7OzEROMuYmcsF6yGnnxCAIbGC/GGfueybRKOQVKI3U AuLOg6weTtM+lQ3kFSONRu2re/XbXyjvKWvKHtBFgaK2qfbLBPvAuxWsgh7X1DoKO5Hi OZX/VYy0eY1BRr9B0Gp5RR+OArzroX+t8TZCKLLyU2qpeg/qU6ZOJLz72J7DCzzs4mPi JqXD8RlfOoZuVM9kzWhxNjk1yivNSHlp47RJLrPVRcXWhUM5vV6Ko9PP0C0+kfvO50yE hG/Q== 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=xJyBiYe4itRLg1Rl5A2dyCSKDgxIw5EvkNN/TzYn6qY=; b=eH8C6+PlwmghxWeYFqMg9cYMcdYwR4yjELVeIp0D2MbebMJT66EjbJlRTO6f1qp7T1 AjnVV+f4U3XEb4S1LQd4odnkwTo4PXL1qbs7MP7Ryjl7Ecky3/f6ATN5g5Lcs8z639tn rU7z8eMcpObY9rOheQuK1yDRhxC1q1V/O7nJeEGjyr7Mfw6SUliTBLhllc435ivqitfY ZoTBGtMC9iAqiMb+2nnJmdXQeAUMzvyQkun+G+cdzvCoLa0yATeN8JOn7iYJn5qL39Cb ItYWXE0d7Ih25mLcz+0gNdo7VFyqK9RUVyKnJa7ceJsbmV17rDdW0I/sbUmJt0ubqlRv 6d5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XewtgC7T; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id v10-20020aa799ca000000b004fe53a5a52dsi1547182pfi.159.2022.04.06.06.19.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 06:19:43 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XewtgC7T; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 45A235A1C85; Wed, 6 Apr 2022 03:56:46 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235381AbiDEMdt (ORCPT + 99 others); Tue, 5 Apr 2022 08:33:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235605AbiDEJCY (ORCPT ); Tue, 5 Apr 2022 05:02:24 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B57E4BF40; Tue, 5 Apr 2022 01:54:11 -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 ams.source.kernel.org (Postfix) with ESMTPS id 68DDFB81A0C; Tue, 5 Apr 2022 08:54:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5C69C385A0; Tue, 5 Apr 2022 08:54:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649148849; bh=Gh6dRGFWFQmf8B5m9q8iVsCS75Ilgj6gFgKCUtVsgWU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XewtgC7TrAFQxtaJFjGT8gAwDmu042+wb0oFSk0DvIjBJMvmaXx4RHrA/gbwDUQq4 tHdBC7VGO/nYUZnUmY6sV07Gjbkqzf/Dc4yPOLfaXc+Jw7Dck2/istCLQQZol1l4Cw iy7czptLziIcBWHH+FotcLuxpmLZmHBBbfOPIbTo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hersen Wu , Jasdeep Dhillon , Roman Li , Daniel Wheeler , Alex Deucher , Sasha Levin Subject: [PATCH 5.16 0502/1017] drm/amd/display: Add affected crtcs to atomic state for dsc mst unplug Date: Tue, 5 Apr 2022 09:23:35 +0200 Message-Id: <20220405070409.200254124@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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: Roman Li [ Upstream commit 128f8ed5902a287a6bb4afe0ffdae8a80b2a64ec ] [Why] When display topology changed on DSC hub we add all crtcs with dsc support to atomic state. Refer to patch:"drm/amd/display: Trigger modesets on MST DSC connectors" However the original implementation may skip crtc if the topology change caused by unplug. That potentially could lead to no-lightup or corruption on DSC hub after unplug event on one of the connectors. [How] Update add_affected_mst_dsc_crtcs() to use old connector state if new connector state has no crtc (undergoes modeset due to unplug) Fixes: 44be939ff7ac58 ("drm/amd/display: Trigger modesets on MST DSC connectors") Reviewed-by: Hersen Wu Acked-by: Jasdeep Dhillon Signed-off-by: Roman Li Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 0ec8051cdfb4..7cadb9e81d9d 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -10752,10 +10752,13 @@ static int dm_check_crtc_cursor(struct drm_atomic_state *state, static int add_affected_mst_dsc_crtcs(struct drm_atomic_state *state, struct drm_crtc *crtc) { struct drm_connector *connector; - struct drm_connector_state *conn_state; + struct drm_connector_state *conn_state, *old_conn_state; struct amdgpu_dm_connector *aconnector = NULL; int i; - for_each_new_connector_in_state(state, connector, conn_state, i) { + for_each_oldnew_connector_in_state(state, connector, old_conn_state, conn_state, i) { + if (!conn_state->crtc) + conn_state = old_conn_state; + if (conn_state->crtc != crtc) continue; -- 2.34.1