From patchwork Tue Sep 24 22:59:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jessica Zhang X-Patchwork-Id: 13811358 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B8D7D84037; Tue, 24 Sep 2024 23:00:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727218814; cv=none; b=LdzSRilcN/t7J+7a8/tFc7R7+iP8DvLwuN6PELQ7mtTuwnmFP/igIiD0/CAgKwBtw8bXGviidj02HFnMqMfbpKgTAFFHAlZLsVtz+hbVUCLWNCEx7Bx8bD941cup9/u00Kz0nu6xzGJHYFRcFJi0Jx6R/ejl69sRKGuKAv3AZS8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727218814; c=relaxed/simple; bh=YMQpa44UItJRP6DzHe0len7QXuyrOHfHzIkfZmNv/j4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=RsT8JyDHihQRONSMVMNfF4If8/zEo7oVBcXydh2hmNtJO85Y/+QhfYJRMZGApLbSCTLc6ASznPaq6XqN7Q02/p3jqkeVH4GOYFcvoahukqmPAop/qMfZD+TAof9uFKkYhYe+7JV8W+HtF6HnauNIaAqHGxLEo1MTXjU8/8Lh2Xs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=K7WLjXy/; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="K7WLjXy/" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48OJ5hkr020750; Tue, 24 Sep 2024 22:59:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= OSzOkGpW/ItjmNQPNWXQvdyb2bvW77iARFKrHcY+HGg=; b=K7WLjXy/dp+354KX RYX989VDB1pK486tcEQPJ55GXFJfcMK1kDqExtE4OmPBIsva4no8mZWrSgxhRQ9e Ou58HJUGmCbrs2A1XMtCcieMZyg2ZsTBUD/N5MUpxlaEQzupVO75mgEPrtxYq0WM klFGB6kVikG4QYrv53ybyOCs6G5LY9JIOxhB7ujNkrvdWbsthO91nwKd+EitF+8U QxEcMzfKp2dcCpGDog/X/Uqf4togsXkDEwXHABPR7unXR8xTDjMecQOMhGzb0DVl mK1kT9E7sLWSDgdUxhHcIAAYKF7sCB5G+DUzsoM6tNe19G/3ttVg5LcmrbLAvJ6e h3SUFA== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 41sn3sa391-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 24 Sep 2024 22:59:58 +0000 (GMT) Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA02.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 48OMxvTk027329 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 24 Sep 2024 22:59:57 GMT Received: from jesszhan-linux.qualcomm.com (10.80.80.8) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Tue, 24 Sep 2024 15:59:57 -0700 From: Jessica Zhang Date: Tue, 24 Sep 2024 15:59:30 -0700 Subject: [PATCH v2 14/22] drm/msm/dpu: Require modeset if clone mode status changes Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20240924-concurrent-wb-v2-14-7849f900e863@quicinc.com> References: <20240924-concurrent-wb-v2-0-7849f900e863@quicinc.com> In-Reply-To: <20240924-concurrent-wb-v2-0-7849f900e863@quicinc.com> To: Rob Clark , Dmitry Baryshkov , , Sean Paul , Marijn Suijten , "David Airlie" , Daniel Vetter , "Maarten Lankhorst" , Maxime Ripard , Thomas Zimmermann CC: , , , , , Rob Clark , =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= , "Jessica Zhang" X-Mailer: b4 0.15-dev-99b12 X-Developer-Signature: v=1; a=ed25519-sha256; t=1727218793; l=1758; i=quic_jesszhan@quicinc.com; s=20230329; h=from:subject:message-id; bh=YMQpa44UItJRP6DzHe0len7QXuyrOHfHzIkfZmNv/j4=; b=WiJEl3HMp5h8qB4jejGPIGPCT09Lt84lV1yWFUJW2RYwz0ffax47859g49Q9HbjaQ9XLqplPE KRpY7kGhJoBBzdogLpkZ5nYhDPQTDUBHmes0MAUSssTRlycpgsnWWWx X-Developer-Key: i=quic_jesszhan@quicinc.com; a=ed25519; pk=gAUCgHZ6wTJOzQa3U0GfeCDH7iZLlqIEPo4rrjfDpWE= X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: nQKVgFtCNNiSH3QCX6wi-S218fmkG38D X-Proofpoint-ORIG-GUID: nQKVgFtCNNiSH3QCX6wi-S218fmkG38D X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 phishscore=0 mlxscore=0 impostorscore=0 spamscore=0 malwarescore=0 suspectscore=0 priorityscore=1501 lowpriorityscore=0 mlxlogscore=999 clxscore=1015 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2408220000 definitions=main-2409240160 If the clone mode enabled status is changing, a modeset needs to happen so that the resources can be reassigned Signed-off-by: Jessica Zhang --- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c index a7850bf844db..f20e44e9fc05 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c @@ -1268,6 +1268,8 @@ static int dpu_crtc_atomic_check(struct drm_crtc *crtc, { struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc); + struct drm_crtc_state *old_crtc_state = drm_atomic_get_old_crtc_state(state, + crtc); struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc); struct dpu_crtc_state *cstate = to_dpu_crtc_state(crtc_state); @@ -1279,6 +1281,8 @@ static int dpu_crtc_atomic_check(struct drm_crtc *crtc, int rc = 0; bool needs_dirtyfb = dpu_crtc_needs_dirtyfb(crtc_state); + bool clone_mode_requested = drm_crtc_in_clone_mode(old_crtc_state); + bool clone_mode_enabled = drm_crtc_in_clone_mode(crtc_state); /* there might be cases where encoder needs a modeset too */ drm_for_each_encoder_mask(drm_enc, crtc->dev, crtc_state->encoder_mask) { @@ -1286,6 +1290,10 @@ static int dpu_crtc_atomic_check(struct drm_crtc *crtc, crtc_state->mode_changed = true; } + if ((clone_mode_requested && !clone_mode_enabled) || + (!clone_mode_requested && clone_mode_enabled)) + crtc_state->mode_changed = true; + if (drm_atomic_crtc_needs_modeset(crtc_state)) { rc = dpu_crtc_assign_resources(crtc, crtc_state); if (rc < 0)