From patchwork Mon Feb 13 11:11:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalyan Thota X-Patchwork-Id: 56216 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2285693wrn; Mon, 13 Feb 2023 03:14:33 -0800 (PST) X-Google-Smtp-Source: AK7set92vOZ+tQT4HxjCN/LlLGkbR0PyHDu4Dg4PNbj8dT2tckdjjfxhZwI+OIb6hWq0558Hc6LH X-Received: by 2002:a17:906:d793:b0:885:6d0f:4660 with SMTP id pj19-20020a170906d79300b008856d0f4660mr25243941ejb.22.1676286873164; Mon, 13 Feb 2023 03:14:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676286873; cv=none; d=google.com; s=arc-20160816; b=mt/wIyA0a0ep4f8FnonMqHsnXvsd5SjHeKSRrqRSibEtM2WE1bArwkWNm1odIsICsH g0YijtEvk2nfLmQL8xel1W2mV8n2Zx++a4O7Tc4voTm9PucBnTr+f5UURXiGBhQuRhr9 s+eX07ni7BWi8yU7RMqNOGHbFCt8N259gSCNs/j165dwdvsv1lCwgVrl3YPFvJUb86Po d6fBT/s8gyyKcxe0Vd3L9WDc781Xk4co5x583wO2nYHzfNiQEO9xWPs6VFvHriuwrYHh hGqalTdQXP74Ps++1jqOItdorWUg7/IeoMRLSt+7bUjuUydO7738EK38cnjp4yvAQvu3 bVLg== 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=H66kQihnNFQTC+Svr97QPGBSK5b8Gu+ZE4lJgnD4ecbp6GsDKhWxVRFXFui6MGVym/ 7x/TGkNMR/iAAn4gLnJufMNnP+bQQAtNut9H1fqQUwXcUdcANFsIcV5YYExn1OSl1Enj jQRclInoipMJwgk1m5FXp74xw1xn4H56KZhxiadRM/ILSzwl1o/0Bx0vEVGc/exfhgA6 CbWra2fy0ukvXVJyHCaPhsmFSZmxVS9kA+2oPhf/WXJExlpkUHObFxlXq+Im2tDyS9Cz S5+6wBfhtK1pb16Ee/D5sQt2Vn64iauU6BoTRKt7hVQInl9HmJrd9wGW2D5+82AaX+FU gCmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=SRHSJL9+; 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 14-20020a170906018e00b0087bd78cd19csi16706871ejb.10.2023.02.13.03.14.10; Mon, 13 Feb 2023 03:14:33 -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=SRHSJL9+; 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 S231131AbjBMLNR (ORCPT + 99 others); Mon, 13 Feb 2023 06:13:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230333AbjBMLNK (ORCPT ); Mon, 13 Feb 2023 06:13:10 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3D7818B25; Mon, 13 Feb 2023 03:12:42 -0800 (PST) Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31D8rpeo011727; Mon, 13 Feb 2023 11:11:54 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=SRHSJL9+J0gWyRxJtURjv42zZmKmzmpQznMHc4xUcornMkfea5O+tJQzVkxdX0utQrB/ bhd2YLOxu6xoORjfjKWG22etL1rsjlnAoZctMMDma94/zyr2Q6LeOi4xIaAJpA/UJODi LyJ1qvZjDZUhmFQLgtygaayF1e33NlQwoCMWC3s3qOgKSCUpWb5VMOoTKgpVdtXIrKoa HkTwU0FZED9S3BKD1+KDHRi8Y8/x8imuWjY6hTqyAj3EbcOhdGYDiAIxWun3GcQJ6szc W11A4QzVGT3M9XyM3UjUqczE066miOmWSQ932+wxndokuurhruepOmUN42Ii8Er2d/MR /A== 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 3np0qpuy9c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Feb 2023 11:11:54 +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 31DBBn37018453; Mon, 13 Feb 2023 11:11:49 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 3np43k9kta-1; Mon, 13 Feb 2023 11:11:49 +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 31DBBnp6018424; Mon, 13 Feb 2023 11:11:49 GMT Received: from kalyant-linux.qualcomm.com (kalyant-linux.qualcomm.com [10.204.66.210]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 31DBBnK6018421; Mon, 13 Feb 2023 11:11:49 +0000 Received: by kalyant-linux.qualcomm.com (Postfix, from userid 94428) id 374694BB3; Mon, 13 Feb 2023 03:11:47 -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 v4 1/4] drm/msm/dpu: clear DSPP reservations in rm release Date: Mon, 13 Feb 2023 03:11:41 -0800 Message-Id: <1676286704-818-2-git-send-email-quic_kalyant@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1676286704-818-1-git-send-email-quic_kalyant@quicinc.com> References: <1676286704-818-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: uTwn0ilSM_QoSNT1uDWxNVcDdPhZ6V19 X-Proofpoint-ORIG-GUID: uTwn0ilSM_QoSNT1uDWxNVcDdPhZ6V19 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-13_06,2023-02-13_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 impostorscore=0 malwarescore=0 phishscore=0 adultscore=0 suspectscore=0 spamscore=0 lowpriorityscore=0 clxscore=1015 bulkscore=0 mlxlogscore=759 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302130101 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?1757714184683940533?= X-GMAIL-MSGID: =?utf-8?q?1757714184683940533?= 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 Mon Feb 13 11:11:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalyan Thota X-Patchwork-Id: 56214 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2285431wrn; Mon, 13 Feb 2023 03:13:48 -0800 (PST) X-Google-Smtp-Source: AK7set+1cxmNr6L5kjfaFUjxInzo21IZG9eGjDCSYfFIQ2soaZxO1Vbzm7fulbxV7ODviUsV/fk8 X-Received: by 2002:a17:906:3a8e:b0:881:ad59:97f5 with SMTP id y14-20020a1709063a8e00b00881ad5997f5mr27926081ejd.2.1676286828510; Mon, 13 Feb 2023 03:13:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676286828; cv=none; d=google.com; s=arc-20160816; b=ARcaPsEQikmnEK0DdQiSFxhWOl8D4opmNl9QG+IqARKO844b8TEz8JzvDQB5N8PDcf N5fX99JEQNLGOGWBVqROq9ms7xQMIIbI1iCcs5LaeArnAUG6k2DJ0lr+wFU3It8E9N/n 3hVCIR2ozhGAtcjTVT1iumnPuh+AgWypX5iBJF5naa5/M/JTv6j76pH92rgd0xRhiajD U5NVqOGiJgIUhgXB9TTrNvajr0leldjndvogj4/SUAkGwW2mNsKvCXxG5jajFlSd4LYx of/Avk/JcuomUJkl3wgxb0rwRQIYrO+z515v4ciDQZXnYZ30gQeHOS9Qw3QWAINSDeu8 nsFQ== 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=GUom0pN7Pz0CI2gjUgFj4ymqWrO11uvM9vND2tlr3bvyiHZvPtxKNtEdPVV+kqJfII k4LN4QluITg/8b81y1fhhJbdcjfq3YnQ/x2H4KovP4m2ytGlmBrR31VLoas+M7S/BnwW UXcGFcz4cnG0Ey+Q0gSqOcn92tOBfNHVY+CKIfbkKi8fGqgv+Klt0Kkvi/8fXSpQH6AH OV6O0121btI80QqhIno/l5c37ki3b9YPQIIfjNzwfMVLyjFdEg2yb5/FZTNViJ7AoJvk xqxi1bnZZPX44EVVIpOMuP5OEkPaqZ/58vmgFCKA4latwiHnL2f7OR7iOsrC9cwKqk1k FSkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=A1qoF6od; 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 ac21-20020a170907345500b008785393ba3dsi12405188ejc.59.2023.02.13.03.13.26; Mon, 13 Feb 2023 03:13:48 -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=A1qoF6od; 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 S230444AbjBMLM6 (ORCPT + 99 others); Mon, 13 Feb 2023 06:12:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230388AbjBMLMz (ORCPT ); Mon, 13 Feb 2023 06:12:55 -0500 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F222116AC7; Mon, 13 Feb 2023 03:12:23 -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 31D8sM8a004355; Mon, 13 Feb 2023 11:11:54 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=A1qoF6odg2YV0qzNamuKV68fuy3disqHbjtHLtt5ui3K6/Jzhs2PXSGapZK8V9bywmjN lEbdcYwCwNgYq7sTXhJ9bofahT7kbawycdbKtFruDwYVn2VPsOfeNPhMncIFmFjwp+xP f9nZW7ieProSR2neDLhn4dXob4+pyL+/GIH6ItHYuED+ckskbZZ4FYAbQkS17GmSHmFv RPrwdg8FTMRi816c+WcuUZZp1VbWLu4pa+QPRqwEXReiMY0HZlhS60WIEtPRJRuc50+N 9FNO16ehpJf1FomzmpkKOkHKYGrrBGQETETOhBRmmq4zonhi23C99jw7Orkv4UGnNQz9 /Q== 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 3npmvrjkb3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Feb 2023 11:11:53 +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 31DBBn6D018454; Mon, 13 Feb 2023 11:11:49 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 3np43k9ktb-1; Mon, 13 Feb 2023 11:11:49 +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 31DBBn3p018427; Mon, 13 Feb 2023 11:11:49 GMT Received: from kalyant-linux.qualcomm.com (kalyant-linux.qualcomm.com [10.204.66.210]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 31DBBn7H018419; Mon, 13 Feb 2023 11:11:49 +0000 Received: by kalyant-linux.qualcomm.com (Postfix, from userid 94428) id 67CF04C07; Mon, 13 Feb 2023 03:11:48 -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 v4 2/4] drm/msm/dpu: add DSPPs into reservation upon a CTM request Date: Mon, 13 Feb 2023 03:11:42 -0800 Message-Id: <1676286704-818-3-git-send-email-quic_kalyant@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1676286704-818-1-git-send-email-quic_kalyant@quicinc.com> References: <1676286704-818-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: hdXeWfzgj4F4qO2oPB1Uw83uk4vfJruK X-Proofpoint-GUID: hdXeWfzgj4F4qO2oPB1Uw83uk4vfJruK X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-13_06,2023-02-13_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 phishscore=0 mlxscore=0 impostorscore=0 mlxlogscore=690 suspectscore=0 adultscore=0 malwarescore=0 spamscore=0 clxscore=1015 bulkscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302130101 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?1757714137357302426?= X-GMAIL-MSGID: =?utf-8?q?1757714137357302426?= 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 Reviewed-by: Marijn Suijten --- 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 Mon Feb 13 11:11:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalyan Thota X-Patchwork-Id: 56215 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2285560wrn; Mon, 13 Feb 2023 03:14:07 -0800 (PST) X-Google-Smtp-Source: AK7set+UmL1GBvbgJpN+6MJJbl7ra/htds4gjL/zRXu+EbrHtXCST+977kGJz+wUc7w/slKaPKbx X-Received: by 2002:a17:906:a1d3:b0:878:7cf3:a9e7 with SMTP id bx19-20020a170906a1d300b008787cf3a9e7mr21803390ejb.65.1676286847798; Mon, 13 Feb 2023 03:14:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676286847; cv=none; d=google.com; s=arc-20160816; b=IdwZSRZyHqkIfWLAupV+TBXTc7ibMxxxJAXqvkg4JtCPqaUCfVdplb1+umCIRKTvEz 3+ghdBE5ShRGm6F6+jn4LErNw9QilZlsKuhoaBg6L9kSatmLTQM0agerSePQ2QFqEnrQ VlYITv7qazwb+GBtqB30ryXsvb1MVh/Vf1MjvgYRZOPNCRZknzbPf7kDTQMMwLJdznLJ 9l/WSdoP86rwUbC8WHqMjUqyE0eUF5u62ZLruGrRuYgCFPNRZGuaiie5qU2vIFY4awKm HelIaOkGIzyASy+Df8yHjobKPqJHuGpOXWkMUv7VbCpkxSVTrHepO/oFyShBfh+BydFW Oy1g== 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=DIKhl9bO8/r1ohgkBBu1kx+Afn8nroyHGlpIW4XprQe2A/mDt5g9q3VGV5NKaHqBD9 GORQ5hDEcosOK/9TqOmM60LVFO3Sk3SHarRtRvriQJA/l/1C4KzFcqRfK34KdPfkNXjY skPRtcFpGd4mrPiPbK6+e6VwT6hlK/Ijq76BkrwXr/gQZiHsDKL/feNHwt2829eSDxWx bTqsbSi1Sfr3skwJZiAXigv0xLIO5611AFz1bt8GU9BlDURONpSaAI+dbIw8mjEgJIQG n7n7fG5L90Rl1/QQCGbjPwCJp7AWR0qqKhZhfVkm/4K7fHGpLwOm8RijTR2FuNRrnrC1 TQcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=IlzdqTw9; 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 z7-20020a17090674c700b0087bca83172asi8463280ejl.320.2023.02.13.03.13.44; Mon, 13 Feb 2023 03:14:07 -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=IlzdqTw9; 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 S230423AbjBMLM4 (ORCPT + 99 others); Mon, 13 Feb 2023 06:12:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230350AbjBMLMx (ORCPT ); Mon, 13 Feb 2023 06:12:53 -0500 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9859A193DF; Mon, 13 Feb 2023 03:12:22 -0800 (PST) Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31D9rXdl007542; Mon, 13 Feb 2023 11:11:54 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=IlzdqTw90axXJ2Cx5PmtgVYedAdvYdMkExxvFGM4f/ZgYwzUBLK3t4OvUabfSLgppWxl cPrvFiicV6XTCKjfqeEqr5dyx3zKLgC5I2vxQmdyTgEJ4oxWKU4Vlzk4uSAlBwyiB0au tTXfO1+ydH00EplW90gAX2QG9ehccN6fasemipvfxgRt36jUFvKF+2N36rNmIjOeitEY /HOmZh2EScF0lk3TLIzDGO5JvpFT1fI1w+YozcenlBXCn2n5qt3xDdQL5exxzviNr2cI 7ZxVv1vuQN0sq3xyUpDBkrtgWcZqGHOEmioVgGzKsLK9a50qTEMIU28BXXmPF2d0y8b8 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 3np0cw481j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Feb 2023 11:11:53 +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 31DBBnpH018457; Mon, 13 Feb 2023 11:11:49 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 3np43k9ktd-1; Mon, 13 Feb 2023 11:11:49 +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 31DBBnIO018428; Mon, 13 Feb 2023 11:11:49 GMT Received: from kalyant-linux.qualcomm.com (kalyant-linux.qualcomm.com [10.204.66.210]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 31DBBnbE018420; Mon, 13 Feb 2023 11:11:49 +0000 Received: by kalyant-linux.qualcomm.com (Postfix, from userid 94428) id CFB254C0C; Mon, 13 Feb 2023 03:11:48 -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 v4 3/4] drm/msm/dpu: avoid unnecessary check in DPU reservations Date: Mon, 13 Feb 2023 03:11:43 -0800 Message-Id: <1676286704-818-4-git-send-email-quic_kalyant@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1676286704-818-1-git-send-email-quic_kalyant@quicinc.com> References: <1676286704-818-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: ii_JLWj9XDsZDvWjrHN4-eiWfjeu0j3s X-Proofpoint-ORIG-GUID: ii_JLWj9XDsZDvWjrHN4-eiWfjeu0j3s X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-13_06,2023-02-13_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 lowpriorityscore=0 priorityscore=1501 adultscore=0 phishscore=0 mlxlogscore=851 clxscore=1011 suspectscore=0 mlxscore=0 impostorscore=0 malwarescore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302130101 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?1757714157423516250?= X-GMAIL-MSGID: =?utf-8?q?1757714157423516250?= Return immediately on failure, this will make dpu reservations part look cleaner. Signed-off-by: Kalyan Thota Reviewed-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten --- 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 Mon Feb 13 11:11:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalyan Thota X-Patchwork-Id: 56213 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2285364wrn; Mon, 13 Feb 2023 03:13:35 -0800 (PST) X-Google-Smtp-Source: AK7set8R1oZmkghJsZbyxDLnEZMC21uhceHuyTIp4c9iaGUwLI/eq1Q+rEFXW188k42y6vZyMv9S X-Received: by 2002:a50:d08c:0:b0:4ac:c720:9255 with SMTP id v12-20020a50d08c000000b004acc7209255mr3485916edd.34.1676286815505; Mon, 13 Feb 2023 03:13:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676286815; cv=none; d=google.com; s=arc-20160816; b=exKl8EqKwEGaXmcKMQc0m20zskRW0dZYPYt5usNMWBHRJ6XraJiE7dpA4Yi3fmyA+m +ccJCD+Sp59aQHVRQ9mUz/xHYHpiYlfOgCiRyLr4/0boPl+xAPZI96JxmxwhcJSFV++6 pjtbWSmiZb3Viz/phqAr3h6tI4WH4JXJVK/tiEb0YcucAv0D+ML8mMeMausoZmFMsIPf dTfleEvak1cVqkehzjrweuKS0J5Sg/+JkClBQ52nSNy9BQJEq1rbcUFwoBIFUJU460S1 g5Cm611v4GjJBma1eWSVxeHX4lQRToOtI7Y/A5kRi1nv5CDVPX7+ITIqeuzZ7nJpueCm sOAg== 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=bGXOI4SdGQN5cVzXB4ivGpckq0FRCIM7i3AruIy65tQ=; b=fE9mN6JjW+ITmIveajiRF6wyaW++fFWYJHEXHEergZwtemvCdDe8LtE3qVpxeiQKSO eezujw072OC7ru700OHdLv6z78qEV92waWcbkN4uEcaI6rb98NloRB+Z5+gFKneqb9Da 6aKRXb9Hr1VApf3EGPUxpttu3yfdopE94n5Amxp28nLdoxmPJWWpG3fWgtqNKrIIJiJ7 7/bHPytt0bed/7thWaJjQSttR7w7125da+6ZVfw1G0beHILLluEdfNXMN3X29mM0gClk wVQk4JsALabin2ejr8SxfTyVE907IQ0dwqiVV/JabCqAxyVQvNqpx5e+/OYU4tftbz76 qr9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=STxB21T0; 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 ba8-20020a0564021ac800b004ab2520281dsi12061477edb.55.2023.02.13.03.13.12; Mon, 13 Feb 2023 03:13:35 -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=STxB21T0; 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 S230394AbjBMLMz (ORCPT + 99 others); Mon, 13 Feb 2023 06:12:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230224AbjBMLMx (ORCPT ); Mon, 13 Feb 2023 06:12:53 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BA47193D5; Mon, 13 Feb 2023 03:12:22 -0800 (PST) Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31DAJCj8022820; Mon, 13 Feb 2023 11:11:54 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=bGXOI4SdGQN5cVzXB4ivGpckq0FRCIM7i3AruIy65tQ=; b=STxB21T0NVAu8EZ4oU0Bhu2pK/+qXVOjRU785OrAdPByPGGn2iuhvs+W7WJIEJ5uNZSL 7BkGbjtL3dohzuujhf7D1+pkPXql6jrx6yqH4fwA9Ev+M10u1SVX5SxRnTQpPiHPpsFw NgQ3/cX/uZvCIg1JG4MrJDS/QSsuTdDQvFwX413lSXYxGfJbeQwlLxEDeLc2izaZUWkf jsHvJ0l7QRME8lMDR23MIQQtwUypQg5YUWTOoGWi7uZ5O4XbYCXJgNiiPjG93Nvy88ot fOj7kXZaWfsDz09PpfavVjvXujtUCVO+Is+h2skExq9zIAk2vFzBhSMBPmajjLZTWhw9 bw== 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 3np46vkqhn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Feb 2023 11:11:54 +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 31DBBnd6018456; Mon, 13 Feb 2023 11:11:49 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 3np43k9ktc-1; Mon, 13 Feb 2023 11:11:49 +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 31DBBnRS018426; Mon, 13 Feb 2023 11:11:49 GMT Received: from kalyant-linux.qualcomm.com (kalyant-linux.qualcomm.com [10.204.66.210]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 31DBBnwB018418; Mon, 13 Feb 2023 11:11:49 +0000 Received: by kalyant-linux.qualcomm.com (Postfix, from userid 94428) id 90A6C4C0A; Mon, 13 Feb 2023 03:11:48 -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 v4 4/4] drm/msm/dpu: manage DPU resources if CTM is requested Date: Mon, 13 Feb 2023 03:11:44 -0800 Message-Id: <1676286704-818-5-git-send-email-quic_kalyant@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1676286704-818-1-git-send-email-quic_kalyant@quicinc.com> References: <1676286704-818-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: C2BDSiDV4BDEwB5wI3bIk8aZC4w-tsev X-Proofpoint-GUID: C2BDSiDV4BDEwB5wI3bIk8aZC4w-tsev X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-13_06,2023-02-13_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 mlxlogscore=899 bulkscore=0 lowpriorityscore=0 malwarescore=0 impostorscore=0 priorityscore=1501 clxscore=1015 spamscore=0 adultscore=0 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302130101 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?1757714123788562467?= X-GMAIL-MSGID: =?utf-8?q?1757714123788562467?= Allow modeset to be triggered during CTM enable/disable. In the modeset callbacks, DPU resources required for the CTM feature are managed appropriately. Signed-off-by: Kalyan Thota Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/msm_atomic.c | 18 ++++++++++++++++++ drivers/gpu/drm/msm/msm_drv.c | 2 +- drivers/gpu/drm/msm/msm_drv.h | 1 + 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/msm_atomic.c b/drivers/gpu/drm/msm/msm_atomic.c index 1686fbb..e3e607c 100644 --- a/drivers/gpu/drm/msm/msm_atomic.c +++ b/drivers/gpu/drm/msm/msm_atomic.c @@ -179,6 +179,24 @@ static unsigned get_crtc_mask(struct drm_atomic_state *state) return mask; } +int msm_atomic_check(struct drm_device *dev, struct drm_atomic_state *state) +{ + struct drm_crtc_state *old_crtc_state, *new_crtc_state; + struct drm_crtc *crtc; + int i; + + for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, + new_crtc_state, i) { + if ((old_crtc_state->ctm && !new_crtc_state->ctm) || + (!old_crtc_state->ctm && new_crtc_state->ctm)) { + new_crtc_state->mode_changed = true; + state->allow_modeset = true; + } + } + + return drm_atomic_helper_check(dev, state); +} + void msm_atomic_commit_tail(struct drm_atomic_state *state) { struct drm_device *dev = state->dev; diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index 0759e2d..3221284 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -52,7 +52,7 @@ static const struct drm_mode_config_funcs mode_config_funcs = { .fb_create = msm_framebuffer_create, .output_poll_changed = drm_fb_helper_output_poll_changed, - .atomic_check = drm_atomic_helper_check, + .atomic_check = msm_atomic_check, .atomic_commit = drm_atomic_helper_commit, }; diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h index ea80846..7d0243a 100644 --- a/drivers/gpu/drm/msm/msm_drv.h +++ b/drivers/gpu/drm/msm/msm_drv.h @@ -209,6 +209,7 @@ int msm_atomic_init_pending_timer(struct msm_pending_timer *timer, struct msm_kms *kms, int crtc_idx); void msm_atomic_destroy_pending_timer(struct msm_pending_timer *timer); void msm_atomic_commit_tail(struct drm_atomic_state *state); +int msm_atomic_check(struct drm_device *dev, struct drm_atomic_state *state); struct drm_atomic_state *msm_atomic_state_alloc(struct drm_device *dev); void msm_atomic_state_clear(struct drm_atomic_state *state); void msm_atomic_state_free(struct drm_atomic_state *state);