Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp910049pxb; Wed, 6 Apr 2022 04:02:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzC8LtJDsSqIM25ChRBIvOV2WOOQD0dXCGeQu6YP6kDa3BvUdLWyozECW9HuN2sFhYE3YU7 X-Received: by 2002:a17:90b:4b4f:b0:1c7:d415:5b79 with SMTP id mi15-20020a17090b4b4f00b001c7d4155b79mr9336645pjb.96.1649242933373; Wed, 06 Apr 2022 04:02:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649242933; cv=none; d=google.com; s=arc-20160816; b=xDE+bkNpYonZCZYtAqUQjIsbrAv/bXRXQaD1LmHmy7gXHvOkwqcOmmtrieCHPqsDQr xDhQKjv5zrXoQicaHCEBV0ImZrNJrM0Id/h4fqJE+h20oW5w8BfAd86MDBjvsZPEURAi 0U97wDcjOOl68T+hw9iooDjtEQzCsCa7q3dNolsP7SQq06r8cavSPr6ZzRPcjd1vaCn0 NLstbH2upbOV4jUOsbceHyDjkyFzUflZE8RE1cjnzvUveO8l0RHuT5JM62vOMWo9oOt0 DvYyLtac9gu2ssH3dm5a7Qp2zxFl05cEHS6GW82sCEZWHlQ0hKgo/iz7g6/przt0Mcwf 7CLQ== 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=qI05uv0t5joz+kUAD9xrKp8DLee51HZ5y1M0eVdN5PQ=; b=Q2Y86QdGKfWZ7NDVygOkyTRLvd2Rbmj1DFYL9FcOhSornk3wmg9Hgt9a8qtwF9zfnv 1KVIYUrpemEapiBYF2ZxHeIhJ9ZHa+nJYrQHOnr/xx5gS2oq9vUbE/3YBKyliBHFa8uc 4nrQdd9PWvXbQYTtRoZSkkud1MAU18ctD02cxms1YpIY3GjT3XIj5dGJ7KGpZB4rLYmo C58ZDY/o81mCkG7MpXuyDyfxRHlAsSRncvo4kCEYVrGlqJofZ7eIvfKaM9Yy4ySqco/k llfA6j/m6ZGnwODQwaVk/gaCH3u1jFZupmKTJhfwKVYAsp/2bB3ebC/k6Q8yv1t/1v65 EXLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iIDUQE4l; 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 e16-20020a056a001a9000b004fa3a8dffb5si15417775pfv.108.2022.04.06.04.02.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 04:02:13 -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=iIDUQE4l; 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 63E1C5B5E7D; Wed, 6 Apr 2022 02:25:15 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1453319AbiDEWcu (ORCPT + 99 others); Tue, 5 Apr 2022 18:32:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349106AbiDEJtI (ORCPT ); Tue, 5 Apr 2022 05:49:08 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14E16AA024; Tue, 5 Apr 2022 02:41:00 -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 E62A8615E5; Tue, 5 Apr 2022 09:40:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2F6FC385A4; Tue, 5 Apr 2022 09:40:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151659; bh=S0tN8CdSkaCy2ANkjHijuGJLhnaB2fvJt27wInlegNs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iIDUQE4lkKFMDmDG4Oeja+DPRhBU1w6S3OKgcBOJqtPgy9wzFmkMMXqIYIR8t2E3/ ExAXhRZrDVKJJvpWU3l68RTLsBYSY/0wPQIakVEuc3c7p/c0mvVqLR/SPzMLYIWG8M aagVzCroYmzuQXxXIxMCW3trDQphfI5BbiYkpEs8= 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.15 457/913] drm/amd/display: Add affected crtcs to atomic state for dsc mst unplug Date: Tue, 5 Apr 2022 09:25:19 +0200 Message-Id: <20220405070353.547555261@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@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 7983c01c007d..b9859e52ad92 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -10226,10 +10226,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