From patchwork Wed Feb 8 13:42:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalyan Thota X-Patchwork-Id: 54433 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp3462921wrn; Wed, 8 Feb 2023 05:46:22 -0800 (PST) X-Google-Smtp-Source: AK7set+XVPZaNJ30Xl/AZoDP6YvHU/5PxLObiu10/M969eU7NnJ0+15W7DhdmJ/Wp/wkJX9qImn8 X-Received: by 2002:a17:903:1107:b0:196:3f5a:b4f9 with SMTP id n7-20020a170903110700b001963f5ab4f9mr7673563plh.1.1675863982341; Wed, 08 Feb 2023 05:46:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675863982; cv=none; d=google.com; s=arc-20160816; b=iTFPeiro+zKI8MlCxxgu7ue/WOnwnlwB0/PG3T3Lld1/7Tyn6q6aLG7GItOsrb7rvC OiTBXk5R8MeIRytC64SRlD3s4CDJ57ij3LDKbFLVZ3NccOGYAtznnExEiBVqwSQVx5K4 xpfF2cVTkTzQPVuLpG6dS9bZtqLd2jOEgciho200/+uwLFgYBSVEnJbdS1SMZaNaG3nG nGesMdisWvWgwBPYGocvpFTn+IT2RRGq2qbGt6uNMG74qz+S3IyywrA52d/EQ4SBC2T2 ose/OP2YtpXd+YTM97Qsr+DgWIp3PY8wZMZg4WUGv0F++AW6Dmx1pVEAc7VQWjx/YqGd T1qQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=fx8OsiGWH5yuqlL6DjcH0JCB8TcqzYoP0o7WyW2mHn0=; b=rF3/xDs4ypq4QCidMPZLeWhXE48VkNy42hpgIroyoxuY8pPcmg9hoXing7svhiWHRZ Fs3lWR84ZITx/pJLeRFNMXQGfFX7a3aK0J5MCa90Eb3DEgbt5UveXqsZK1Te8dI4rK85 1kRqaZ7ghkKPSmAPqLa0sdNOeQGkN/bAOex/qvZGDuQb4FuGrD6zhCVzR5bhm3WJDS+U kODmTmM265xM6NGheqabUMKWZ8qoTdkaQ7ZluP6Gh26DHPcqPDZQr0/ckQG7rBi7NIBP uHT9Em5ptFUe5in/WYxkfKGD+6ETN2WLUjCE7+7tyoZsuDSNX9FEBQnIktHFnrWy064j 1IxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Md11ftWd; 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=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q16-20020a170902dad000b00198e6577935si18417224plx.452.2023.02.08.05.46.09; Wed, 08 Feb 2023 05:46:22 -0800 (PST) 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=@quicinc.com header.s=qcppdkim1 header.b=Md11ftWd; 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=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231458AbjBHNmd (ORCPT + 99 others); Wed, 8 Feb 2023 08:42:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230302AbjBHNmW (ORCPT ); Wed, 8 Feb 2023 08:42:22 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F45630282; Wed, 8 Feb 2023 05:42:21 -0800 (PST) Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 318DR7rQ014278; Wed, 8 Feb 2023 13:42:15 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=qcppdkim1; bh=fx8OsiGWH5yuqlL6DjcH0JCB8TcqzYoP0o7WyW2mHn0=; b=Md11ftWdfttMffD6yWFBYmKfg+Whf0ZjSJs0wgEhCaUIu3NbalBFCIsZBwziYfmit5zK WxpG6p54fXdjVB0r/A58a7jEVFgKuxTHLwX/K6CjJByOAUQw9gTMTrjalgEjn0z92DSu DXp0M6b9wjAlYVsjThO1UupeakDzQWHTSYbBhnl8ariUf2M2qtHAQLzv5JGH8mgqRFkp +tVW5YdKSaakGULuTXWEAZHOmdnYvS2IjvWbAantlcwKIWnMmRw6jURI41PjgqU2CDlF GU/9DuDX/B/whKswjkkyL6Gz17g/ZDSOr3QOtDxtCtnGzLYj8j1reN4KbdGJ8i41ScM6 fw== Received: from apblrppmta02.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3nmb8jr7e7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Feb 2023 13:42:15 +0000 Received: from pps.filterd (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 318DgAnh025377; Wed, 8 Feb 2023 13:42:10 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 3nhgekjeqv-1; Wed, 08 Feb 2023 13:42:10 +0000 Received: from APBLRPPMTA02.qualcomm.com (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 318DgAdk025352; Wed, 8 Feb 2023 13:42:10 GMT Received: from kalyant-linux.qualcomm.com (kalyant-linux.qualcomm.com [10.204.66.210]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 318DgAq4025335; Wed, 08 Feb 2023 13:42:10 +0000 Received: by kalyant-linux.qualcomm.com (Postfix, from userid 94428) id 679D8480C; Wed, 8 Feb 2023 05:42:09 -0800 (PST) From: Kalyan Thota To: dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org Cc: Kalyan Thota , linux-kernel@vger.kernel.org, robdclark@chromium.org, dianders@chromium.org, swboyd@chromium.org, quic_vpolimer@quicinc.com, dmitry.baryshkov@linaro.org, quic_abhinavk@quicinc.com, marijn.suijten@somainline.org Subject: [PATCH v3 1/4] drm/msm/dpu: clear DSPP reservations in rm release Date: Wed, 8 Feb 2023 05:42:01 -0800 Message-Id: <1675863724-28412-2-git-send-email-quic_kalyant@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1675863724-28412-1-git-send-email-quic_kalyant@quicinc.com> References: <1675863724-28412-1-git-send-email-quic_kalyant@quicinc.com> X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: DC4NZnfSLFyC6Wui5lMhUKX-PbeD4Gfq X-Proofpoint-GUID: DC4NZnfSLFyC6Wui5lMhUKX-PbeD4Gfq X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-02-08_05,2023-02-08_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 adultscore=0 mlxscore=0 spamscore=0 suspectscore=0 malwarescore=0 lowpriorityscore=0 phishscore=0 bulkscore=0 priorityscore=1501 mlxlogscore=762 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302080120 X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757270750909963274?= X-GMAIL-MSGID: =?utf-8?q?1757270750909963274?= Clear DSPP reservations from the global state during rm release Fixes: e47616df008b ("drm/msm/dpu: add support for color processing blocks in dpu driver") Signed-off-by: Kalyan Thota Reviewed-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten --- drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c index 73b3442..718ea0a 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c @@ -572,6 +572,8 @@ void dpu_rm_release(struct dpu_global_state *global_state, ARRAY_SIZE(global_state->ctl_to_enc_id), enc->base.id); _dpu_rm_clear_mapping(global_state->dsc_to_enc_id, ARRAY_SIZE(global_state->dsc_to_enc_id), enc->base.id); + _dpu_rm_clear_mapping(global_state->dspp_to_enc_id, + ARRAY_SIZE(global_state->dspp_to_enc_id), enc->base.id); } int dpu_rm_reserve( From patchwork Wed Feb 8 13:42:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalyan Thota X-Patchwork-Id: 54434 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp3462918wrn; Wed, 8 Feb 2023 05:46:22 -0800 (PST) X-Google-Smtp-Source: AK7set/5pk4WW+UXKsSkEjJQLgM2Rm64PZdyFQ3kj37GR2UrQlC4RedCcXrxsKweJ4bWHZMSTz22 X-Received: by 2002:a17:902:d505:b0:198:e8c6:859a with SMTP id b5-20020a170902d50500b00198e8c6859amr7608227plg.0.1675863982332; Wed, 08 Feb 2023 05:46:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675863982; cv=none; d=google.com; s=arc-20160816; b=QsQzWH11aKrDzobt2240Q4fqT8VKvUicRlXxlE9Ng0Ni8MklNMLIh+ZfvwoHXGKh97 OogKk0vOoeA4WBl8gBIeConnxVpukMXVnVFADKRBCF9XOfOBv7hwSUV+wS0ELZK+ySvl Tp2MgymE56Hpoe8RpqR8J+wrQ66XgVrmbyr8XR0df2Hm8d5A3t4Zb2IGo99oM1yrrWgN N2Wi2SMirLmx8fB4KZhjFEtzk9pLsdNz5FpSaRKV1Ml5HzMavCrC+kIiRm/t8I17Iktl 9t75b/Snwe0NqA15h4iHgPKZkja9Z2A+XgqjeJalaCj4bZ3t4uSqfPnJ4RcOPVHv7JOt abVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=/41C6LTPlDbTiWcxo7yorrzxHYe7ok4515BXT+VEnI0=; b=T3/16byYC1rA4Mdu3t5O2b+M0FTJRNxGOoIL5MpaQCfbcHA0e6V+/hbyJ4nkwARjlG 1tfHEUIxB3g0i3MrH6zhIGQ8GE5TW9G8H9GBR5yXVWLBWUO/PSAMV+WfYXYLi1zIg2kD dppiQjIy+i+Vfywy5/+1SR+XxTrEKuY0o1k7zXwG9T7NCsyMNOfFLXWZ3lV9b8ijmdwt 7TlBFHmnQO3KemtS0mAWhpm/lBC5739c75I0CLglLAHCXKuB8iDEXZUjQnOvo6OXRBSB bQFH65x06MPo4gl4DUEpMlz9A91Fw3NuBY3JhPUn7vGchGj0hB7BcWQIxC1QqVq5ikhx u9pQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=ZrbcG7dv; 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=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a5-20020a170902ecc500b00194afe281e7si6647928plh.429.2023.02.08.05.46.09; Wed, 08 Feb 2023 05:46:22 -0800 (PST) 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=@quicinc.com header.s=qcppdkim1 header.b=ZrbcG7dv; 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=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231432AbjBHNmb (ORCPT + 99 others); Wed, 8 Feb 2023 08:42:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230498AbjBHNmW (ORCPT ); Wed, 8 Feb 2023 08:42:22 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8015130B18; Wed, 8 Feb 2023 05:42:21 -0800 (PST) Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 318DShe8009865; Wed, 8 Feb 2023 13:42:15 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=qcppdkim1; bh=/41C6LTPlDbTiWcxo7yorrzxHYe7ok4515BXT+VEnI0=; b=ZrbcG7dvIHVw7WZ9xsz0l7jjgJaGkD/M+TkBXLrKlYikGirOzPXlm1zM9/1bQConQoTt yQIaqg5Nly2iIKgWuQmsb3tBeGpkwVDB1S/Y/uKnJoW//Qcp5trQpHN5NLCT/TMO6y62 PYw21KZHmNj7HqIbJyK1fj3Vsx7gU9YczU7pRAhUjFKXQ5ZprP5dFaP6/7it5oAieY+J f4FXSYCBh3vJh4X9gY5hauMECWc2/xm12zl7KJ2p3C1quMuIokh3x/rgwrIuJMJmjVcw vDOQiKAL3Fm0Gn/MpOboLg+Ri/wEPa1NVds8LZc8iLFznUUHDnvRtJaOoROLIBNttRW/ 6A== Received: from apblrppmta02.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3nkga2v6yf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Feb 2023 13:42:15 +0000 Received: from pps.filterd (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 318DgA4E025380; Wed, 8 Feb 2023 13:42:10 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 3nhgekjeqw-1; Wed, 08 Feb 2023 13:42:10 +0000 Received: from APBLRPPMTA02.qualcomm.com (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 318DgASs025356; Wed, 8 Feb 2023 13:42:10 GMT Received: from kalyant-linux.qualcomm.com (kalyant-linux.qualcomm.com [10.204.66.210]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 318DgAGm025336; Wed, 08 Feb 2023 13:42:10 +0000 Received: by kalyant-linux.qualcomm.com (Postfix, from userid 94428) id 98599480D; Wed, 8 Feb 2023 05:42:09 -0800 (PST) From: Kalyan Thota To: dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org Cc: Kalyan Thota , linux-kernel@vger.kernel.org, robdclark@chromium.org, dianders@chromium.org, swboyd@chromium.org, quic_vpolimer@quicinc.com, dmitry.baryshkov@linaro.org, quic_abhinavk@quicinc.com, marijn.suijten@somainline.org Subject: [PATCH v3 2/4] drm/msm/dpu: add DSPPs into reservation upon a CTM request Date: Wed, 8 Feb 2023 05:42:02 -0800 Message-Id: <1675863724-28412-3-git-send-email-quic_kalyant@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1675863724-28412-1-git-send-email-quic_kalyant@quicinc.com> References: <1675863724-28412-1-git-send-email-quic_kalyant@quicinc.com> X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: su2h4brhImDWe89UNTC8uH-RCg3-2x8n X-Proofpoint-ORIG-GUID: su2h4brhImDWe89UNTC8uH-RCg3-2x8n X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-02-08_05,2023-02-08_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 phishscore=0 priorityscore=1501 lowpriorityscore=0 impostorscore=0 malwarescore=0 adultscore=0 mlxlogscore=696 clxscore=1015 suspectscore=0 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302080120 X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757270751216188815?= X-GMAIL-MSGID: =?utf-8?q?1757270751216188815?= Add DSPP blocks into the topology for reservation, if there is a CTM request for that composition. Signed-off-by: Kalyan Thota Reviewed-by: Dmitry Baryshkov --- Changes in v1: - Minor nits (Dmitry) Changes in v2: - Populate DSPPs into the reservation only if CTM is requested (Dmitry) --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c index 9c6817b..46d2a5c 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c @@ -545,7 +545,8 @@ bool dpu_encoder_use_dsc_merge(struct drm_encoder *drm_enc) static struct msm_display_topology dpu_encoder_get_topology( struct dpu_encoder_virt *dpu_enc, struct dpu_kms *dpu_kms, - struct drm_display_mode *mode) + struct drm_display_mode *mode, + struct drm_crtc_state *crtc_state) { struct msm_display_topology topology = {0}; int i, intf_count = 0; @@ -563,8 +564,7 @@ static struct msm_display_topology dpu_encoder_get_topology( * 1 LM, 1 INTF * 2 LM, 1 INTF (stream merge to support high resolution interfaces) * - * Adding color blocks only to primary interface if available in - * sufficient number + * Add dspps to the reservation requirements if ctm is requested */ if (intf_count == 2) topology.num_lm = 2; @@ -573,11 +573,8 @@ static struct msm_display_topology dpu_encoder_get_topology( else topology.num_lm = (mode->hdisplay > MAX_HDISPLAY_SPLIT) ? 2 : 1; - if (dpu_enc->disp_info.intf_type == DRM_MODE_ENCODER_DSI) { - if (dpu_kms->catalog->dspp && - (dpu_kms->catalog->dspp_count >= topology.num_lm)) - topology.num_dspp = topology.num_lm; - } + if (crtc_state->ctm) + topology.num_dspp = topology.num_lm; topology.num_enc = 0; topology.num_intf = intf_count; @@ -643,7 +640,7 @@ static int dpu_encoder_virt_atomic_check( } } - topology = dpu_encoder_get_topology(dpu_enc, dpu_kms, adj_mode); + topology = dpu_encoder_get_topology(dpu_enc, dpu_kms, adj_mode, crtc_state); /* Reserve dynamic resources now. */ if (!ret) { From patchwork Wed Feb 8 13:42:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalyan Thota X-Patchwork-Id: 54432 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp3462870wrn; Wed, 8 Feb 2023 05:46:17 -0800 (PST) X-Google-Smtp-Source: AK7set8IOrZi8VCvW5kbGtUugNLMvZOkGu3pr2HIwMQzMwk5+dTIjpjbJVwJJ5gVJWrM2PsteMWB X-Received: by 2002:a05:6a21:328e:b0:bf:6e8:39a7 with SMTP id yt14-20020a056a21328e00b000bf06e839a7mr9572870pzb.4.1675863977463; Wed, 08 Feb 2023 05:46:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675863977; cv=none; d=google.com; s=arc-20160816; b=O+2hF+sxFUT0esiH7yc2Rq9errBfjhQ26vNwSkaqOIaBC0RSxAK115WPNAoQ3oeQCY d2l2NtBnCStDE9rOmrAWkFlPN99CLGu5NJXXgzaAl1YSiWO8kFkrGkEONOD2KojWf3L6 BIvBQgqH4fILytreGnFGgmAAn3rQWyt5CbNNq2MZr8NaGCdzDWsLCZX7UA+nv+m6njMr MgMFH3jp+0acoAevC/vfrDGyZagoB3QPmucOKpIpmAJh0fmdRJiB4qe1WD9QWriaKx3Q N5ngObYICaSui+OQofHo5U+kAIbxD5KGTLlN1XNbmxMlmOd1/ZNoOYFDLW61CmzbI6Qm smww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=QhhDhHLPtQlrKQ/0w7Ad6DBmj1X9Ylr1RZKpwCxkEM0=; b=mcMQj/vqaCH3rIpy/YopFSiTnulZDfVrR3W1AwvqBN+9vDK6TiefDbDW1e95JeUOH2 qOeWEFgD8LyWd8X6MuSPr8BQfVWAk9SGySsTpficttg2eldf/6lNP3TRODgIJgjqALeJ cvCnODRAYTZcIC6WXIxgmGMU7whvqVJwSFtlGomJ2HEAQq34o+RaG2fd4HeVKe/FnQnS lXnvwMVN0QUkJSj8Im1ae0ghoebdu2gK2cd1P0nJEDfpi3SjwmVNyb/gwIh72gSomzkU h/jq4Jrc9d0m1FyDOqHvzxWzXS/36K/ahv5UrhVwsOnsgDAL36ozg18KgrWhiGtvGIH/ qdWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="kEQ/7x59"; 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=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g4-20020a633744000000b004da4c80b1b0si5897305pgn.401.2023.02.08.05.46.04; Wed, 08 Feb 2023 05:46:17 -0800 (PST) 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=@quicinc.com header.s=qcppdkim1 header.b="kEQ/7x59"; 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=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231182AbjBHNmZ (ORCPT + 99 others); Wed, 8 Feb 2023 08:42:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230103AbjBHNmV (ORCPT ); Wed, 8 Feb 2023 08:42:21 -0500 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9955F2F7B1; Wed, 8 Feb 2023 05:42:20 -0800 (PST) Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 318CwiOr019691; Wed, 8 Feb 2023 13:42:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=qcppdkim1; bh=QhhDhHLPtQlrKQ/0w7Ad6DBmj1X9Ylr1RZKpwCxkEM0=; b=kEQ/7x59rUDPu7hy2JVkKYppQSIP41bTYAE7LMYY4VLiOogaUUGClEpBnrloQJpsYYAS GZX/mfpCvx9iMYPjilWQ1UtUXFVn4CPmS7TWfCRGTtio5yxyRioKT0XUh3TsidWIM6Pt kMRjRI5Mnb8hd75vMkSvx0/96R/W7js4mX/f5L7YjoelpyyRfv8jBWidIsxQtNUOD/1x I837fsH8T2ih/frNJ2ZVrMwcZixt4MC1xVajatjrNY2cbIq85umn+X6rKNQI1ltUGink 9jDIOhjuIHtwRSIYQXGX2WBXuvP0tKC5wC28FQfkz+6wHK6mOthc/yOaQF9Y87jLnNa0 tw== Received: from apblrppmta02.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3nm8x1rjwh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Feb 2023 13:42:14 +0000 Received: from pps.filterd (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 318DgAru025358; Wed, 8 Feb 2023 13:42:10 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 3nhgekjer4-1; Wed, 08 Feb 2023 13:42:10 +0000 Received: from APBLRPPMTA02.qualcomm.com (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 318DgAdL025367; Wed, 8 Feb 2023 13:42:10 GMT Received: from kalyant-linux.qualcomm.com (kalyant-linux.qualcomm.com [10.204.66.210]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 318DgA0T025349; Wed, 08 Feb 2023 13:42:10 +0000 Received: by kalyant-linux.qualcomm.com (Postfix, from userid 94428) id BCFB7D97; Wed, 8 Feb 2023 05:42:09 -0800 (PST) From: Kalyan Thota To: dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org Cc: Kalyan Thota , linux-kernel@vger.kernel.org, robdclark@chromium.org, dianders@chromium.org, swboyd@chromium.org, quic_vpolimer@quicinc.com, dmitry.baryshkov@linaro.org, quic_abhinavk@quicinc.com, marijn.suijten@somainline.org Subject: [PATCH v3 3/4] drm/msm/dpu: avoid unnecessary check in DPU reservations Date: Wed, 8 Feb 2023 05:42:03 -0800 Message-Id: <1675863724-28412-4-git-send-email-quic_kalyant@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1675863724-28412-1-git-send-email-quic_kalyant@quicinc.com> References: <1675863724-28412-1-git-send-email-quic_kalyant@quicinc.com> X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: rAvMRB28RJoGc1etAsSUKAz6TAmSm5Ql X-Proofpoint-ORIG-GUID: rAvMRB28RJoGc1etAsSUKAz6TAmSm5Ql X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-02-08_05,2023-02-08_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 bulkscore=0 mlxscore=0 suspectscore=0 malwarescore=0 mlxlogscore=856 lowpriorityscore=0 spamscore=0 impostorscore=0 adultscore=0 priorityscore=1501 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302080120 X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_NONE, SPF_NONE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757270745619590102?= X-GMAIL-MSGID: =?utf-8?q?1757270745619590102?= Return immediately on failure, this will make dpu reservations part look cleaner. Signed-off-by: Kalyan Thota Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c index 46d2a5c..3920efd 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c @@ -636,25 +636,22 @@ static int dpu_encoder_virt_atomic_check( if (ret) { DPU_ERROR_ENC(dpu_enc, "mode unsupported, phys idx %d\n", i); - break; + return ret; } } topology = dpu_encoder_get_topology(dpu_enc, dpu_kms, adj_mode, crtc_state); - /* Reserve dynamic resources now. */ - if (!ret) { - /* - * Release and Allocate resources on every modeset - * Dont allocate when active is false. - */ - if (drm_atomic_crtc_needs_modeset(crtc_state)) { - dpu_rm_release(global_state, drm_enc); + /* + * Release and Allocate resources on every modeset + * Dont allocate when active is false. + */ + if (drm_atomic_crtc_needs_modeset(crtc_state)) { + dpu_rm_release(global_state, drm_enc); - if (!crtc_state->active_changed || crtc_state->active) - ret = dpu_rm_reserve(&dpu_kms->rm, global_state, - drm_enc, crtc_state, topology); - } + if (!crtc_state->active_changed || crtc_state->active) + ret = dpu_rm_reserve(&dpu_kms->rm, global_state, + drm_enc, crtc_state, topology); } trace_dpu_enc_atomic_check_flags(DRMID(drm_enc), adj_mode->flags); From patchwork Wed Feb 8 13:42:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalyan Thota X-Patchwork-Id: 54435 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp3463144wrn; Wed, 8 Feb 2023 05:46:50 -0800 (PST) X-Google-Smtp-Source: AK7set/5uqlUy5QnQH04CCVw16ctLGeJ0t1flfTkvqpnCAe3DQCwTuyikcg4Qr5WPELTzzEtuO50 X-Received: by 2002:a05:6a20:7d83:b0:be:adc8:96c8 with SMTP id v3-20020a056a207d8300b000beadc896c8mr9288493pzj.3.1675864010443; Wed, 08 Feb 2023 05:46:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675864010; cv=none; d=google.com; s=arc-20160816; b=Obgr/Cn5vCwzMUmHsfEkAiLncaJFIUul1nC/DckGOJJGlqlCrzujMpHgS+17ZE8nYz HTVF+2UM9OSlxDmofkUrqVdn6/NvcA0sKM/ab624BDHWVsNdZXW6uq/XKb1GxthB7IbU KAEcZ3gG645b1MBD2ac9aj/CHiVRVLsaXLy4LJ2a3yPuj6HVIunOw/1gJMn7nMv2T8h6 ncGkvsxli9XZZuuhlkXTCY1YSeLBYjEARNcn8k3/0F28qmKsoTUdhs4iHEqpw62di+2h lp0dSVc0D7uvD5fkGSHP25KyN9xSlWoquJoVGzqjXwySH0F4SabAGT+l6fFTe1woO0T5 9wdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=bazFhze46inAQct00eKWJ0u0iAV7QURaooeXwJixmjg=; b=R9iAMrzAZXeJcNH+KuN5ivxJs5f+6occIlMOc06WITFGlyfn98NihcmQp0WSSn6Ipj eGXt11l284sWrD2g/w6xldhBEXJb8s4GUmwy1tzwNGVDxPR9evy+SpC1npeShWp3z01V 6xeNepQZsaAyTNMNk/yMkkZJ833i9YNl9OkCwh8j7z8CKpyMs02oidhsOehLMVbJjahG YyDGIHA+Vcudi4HEKMu/C8NycvLao4FiT470rLmbYFEeGTVB1CvP39tzFtSdXaPPY842 e4KJbO5FytXEcd04A5gzBbFAHPwOSzqZF+e1eFdb3qYvyFLXKA/1V8D5bt8f1WoZU9L/ 7X3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=J6i5w7Is; 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=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w8-20020a63a748000000b004fb3c6b3a43si686880pgo.185.2023.02.08.05.46.37; Wed, 08 Feb 2023 05:46:50 -0800 (PST) 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=@quicinc.com header.s=qcppdkim1 header.b=J6i5w7Is; 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=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231396AbjBHNm3 (ORCPT + 99 others); Wed, 8 Feb 2023 08:42:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230246AbjBHNmV (ORCPT ); Wed, 8 Feb 2023 08:42:21 -0500 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0546301BD; Wed, 8 Feb 2023 05:42:20 -0800 (PST) Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 318ArmJV026311; Wed, 8 Feb 2023 13:42:15 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=qcppdkim1; bh=bazFhze46inAQct00eKWJ0u0iAV7QURaooeXwJixmjg=; b=J6i5w7IsxDe5Hz7vIxmVLfTEg2zqSA60gMxtj2W8WQOiOzqsv/GYDiRjIofrmbeIm3Vj SS/8ZV1ID1G90/kAAl92NEqzTHf/XwXPe7WcDZaprhggViF3wdnR2ZlTKAepGZurM1EV GZ5v1FpXTIxkp1fIb0tYiYquCZbSYkyqKy9BtwmLOM0uv7iW4pNYHwB3srOJVw+cfr8x wJbEThVYHtK55o4x2EBfLPUufmpYHiZOb/ifuC4ijRO7izNgZD6d5z4vfiXuyRQHAsfV a6S/wnXyW2euAjmf9gw3tcObHvDcLXFWyfne86L0QkLR/B2KoFpAP60CWa15vN0k7dT9 rg== Received: from apblrppmta02.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3nkgafm82e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Feb 2023 13:42:14 +0000 Received: from pps.filterd (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 318DgBRb025409; Wed, 8 Feb 2023 13:42:11 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 3nhgekjera-1; Wed, 08 Feb 2023 13:42:11 +0000 Received: from APBLRPPMTA02.qualcomm.com (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 318DgBCS025404; Wed, 8 Feb 2023 13:42:11 GMT Received: from kalyant-linux.qualcomm.com (kalyant-linux.qualcomm.com [10.204.66.210]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 318DgAG0025357; Wed, 08 Feb 2023 13:42:11 +0000 Received: by kalyant-linux.qualcomm.com (Postfix, from userid 94428) id E97D54BE6; Wed, 8 Feb 2023 05:42:09 -0800 (PST) From: Kalyan Thota To: dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org Cc: Kalyan Thota , linux-kernel@vger.kernel.org, robdclark@chromium.org, dianders@chromium.org, swboyd@chromium.org, quic_vpolimer@quicinc.com, dmitry.baryshkov@linaro.org, quic_abhinavk@quicinc.com, marijn.suijten@somainline.org Subject: [PATCH v3 4/4] drm/msm/dpu: reserve the resources on topology change Date: Wed, 8 Feb 2023 05:42:04 -0800 Message-Id: <1675863724-28412-5-git-send-email-quic_kalyant@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1675863724-28412-1-git-send-email-quic_kalyant@quicinc.com> References: <1675863724-28412-1-git-send-email-quic_kalyant@quicinc.com> X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: S8I0oNbYEoGEVE2Tdnd01IgG576FCIC1 X-Proofpoint-ORIG-GUID: S8I0oNbYEoGEVE2Tdnd01IgG576FCIC1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-02-08_05,2023-02-08_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 malwarescore=0 adultscore=0 clxscore=1015 bulkscore=0 spamscore=0 mlxlogscore=999 mlxscore=0 priorityscore=1501 suspectscore=0 impostorscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302080120 X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_NONE, SPF_NONE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757270780769543397?= X-GMAIL-MSGID: =?utf-8?q?1757270780769543397?= Some features like CTM can be enabled dynamically. Release and reserve the DPU resources whenever a topology change occurs such that required hw blocks are allocated appropriately. Signed-off-by: Kalyan Thota Reviewed-by: Dmitry Baryshkov --- Changes in v1: - Avoid mode_set call directly (Dmitry) Changes in v2: - Minor nits (Dmitry) Changes in v3: - avoid unnecessary modeset check call (Dmitry) --- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h | 2 ++ drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 24 +++++++++++++++++++----- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h index 539b68b..85bd5645 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h @@ -204,6 +204,7 @@ struct dpu_crtc { * @hw_ctls : List of active ctl paths * @crc_source : CRC source * @crc_frame_skip_count: Number of frames skipped before getting CRC + * @ctm_enabled : Cached color management enablement state */ struct dpu_crtc_state { struct drm_crtc_state base; @@ -225,6 +226,7 @@ struct dpu_crtc_state { enum dpu_crtc_crc_source crc_source; int crc_frame_skip_count; + bool ctm_enabled; }; #define to_dpu_crtc_state(x) \ diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c index 3920efd..038e077 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c @@ -217,6 +217,19 @@ static u32 dither_matrix[DITHER_MATRIX_SZ] = { 15, 7, 13, 5, 3, 11, 1, 9, 12, 4, 14, 6, 0, 8, 2, 10 }; +static bool _dpu_enc_is_dspp_changed(struct drm_crtc_state *crtc_state, + struct msm_display_topology topology) +{ + struct dpu_crtc_state *cstate = to_dpu_crtc_state(crtc_state); + + if ((cstate->ctm_enabled && !topology.num_dspp) || + (!cstate->ctm_enabled && topology.num_dspp)) { + crtc_state->mode_changed = true; + return true; + } + + return false; +} bool dpu_encoder_is_widebus_enabled(const struct drm_encoder *drm_enc) { @@ -642,14 +655,15 @@ static int dpu_encoder_virt_atomic_check( topology = dpu_encoder_get_topology(dpu_enc, dpu_kms, adj_mode, crtc_state); + _dpu_enc_is_dspp_changed(crtc_state, topology); + /* * Release and Allocate resources on every modeset - * Dont allocate when active is false. */ if (drm_atomic_crtc_needs_modeset(crtc_state)) { dpu_rm_release(global_state, drm_enc); - if (!crtc_state->active_changed || crtc_state->active) + if (crtc_state->enable) ret = dpu_rm_reserve(&dpu_kms->rm, global_state, drm_enc, crtc_state, topology); } @@ -1022,7 +1036,7 @@ static void dpu_encoder_virt_atomic_mode_set(struct drm_encoder *drm_enc, struct dpu_hw_blk *hw_lm[MAX_CHANNELS_PER_ENC]; struct dpu_hw_blk *hw_dspp[MAX_CHANNELS_PER_ENC] = { NULL }; struct dpu_hw_blk *hw_dsc[MAX_CHANNELS_PER_ENC]; - int num_lm, num_ctl, num_pp, num_dsc; + int num_lm, num_ctl, num_pp, num_dsc, num_dspp; unsigned int dsc_mask = 0; int i; @@ -1053,7 +1067,7 @@ static void dpu_encoder_virt_atomic_mode_set(struct drm_encoder *drm_enc, drm_enc->base.id, DPU_HW_BLK_CTL, hw_ctl, ARRAY_SIZE(hw_ctl)); num_lm = dpu_rm_get_assigned_resources(&dpu_kms->rm, global_state, drm_enc->base.id, DPU_HW_BLK_LM, hw_lm, ARRAY_SIZE(hw_lm)); - dpu_rm_get_assigned_resources(&dpu_kms->rm, global_state, + num_dspp = dpu_rm_get_assigned_resources(&dpu_kms->rm, global_state, drm_enc->base.id, DPU_HW_BLK_DSPP, hw_dspp, ARRAY_SIZE(hw_dspp)); @@ -1084,7 +1098,7 @@ static void dpu_encoder_virt_atomic_mode_set(struct drm_encoder *drm_enc, } cstate->num_mixers = num_lm; - + cstate->ctm_enabled = !!num_dspp; dpu_enc->connector = conn_state->connector; for (i = 0; i < dpu_enc->num_phys_encs; i++) {