From patchwork Tue Feb 7 14:29:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalyan Thota X-Patchwork-Id: 53950 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2388:b0:96:219d:e725 with SMTP id i8csp4046527dyf; Tue, 7 Feb 2023 06:35:45 -0800 (PST) X-Google-Smtp-Source: AK7set953omTwvPk9wSeJi5+4RBl1JXEMd+CT7SV63a5Ex0ABzURx90nl9NtupXPAX7U/ik4G94V X-Received: by 2002:a17:906:528d:b0:8aa:8b52:5914 with SMTP id c13-20020a170906528d00b008aa8b525914mr1581201ejm.53.1675780545388; Tue, 07 Feb 2023 06:35:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675780545; cv=none; d=google.com; s=arc-20160816; b=gho9n0g0Kv7g1TfNPw9BksLEI+o/Wd7fZpggUMlD1Ea+Sm/t1PyIrJzNgjGZUFef/a i6K9GLPgRcELszjFLmC6Rpy+hJrXK/hXvFD3ADBRWJPV8ywlN3z8Ls0Nf+DmVgjgAqyz ls0piCUl4OUNz2NWUf+Hjtmvr1uqKE0aD5jvzieasvD1LbIJSZ2hJ5mKHvqSoIZtYIH7 u0EXwQWbHd6MpoOtFJ/yWKqWSo6nykX74wPMg/2q+wH0wG1sGkwxRJHQUZu9MI7Jh0BZ CqFCstZa1aNcyQXUPALek/hbl/OzLhzyepbEfyZtHPtiltBg6fRzI7Z8tfCZ5uAbrDOo xvwg== 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=NS90slSACWJ0/WLpkNKGa2YnsV2TaoWISg4Fks6F5M4=; b=fimJ2n9Quti1gHfKzXAeYbI86whMZjJyqXQrL8aF8r4L8EUks2Osnxv+yrGbS57Nxi GTzTD9AgvaXXIx2OT6LPX/GfeUivJikjGtAXhwGJ1GJ8NuLDEhNcBq7CyO7wy5McDvOF jtdKYijZHwdQjU/QlVihhuHg2WF0mN1H/+qn5OgWH8Zpc0vFO5EbIIH4sXzN2+DEnjwM rAVu8XfHc7zAT4lYuASRaQt7+rVW5W+dqwGiKPCyRQm2NWbhWHQpxnxzU3qULVQvpokd sYlygcKX43JSAwzaa4TQVKtX5FEGgkoB6QcLG9v0AhH8GWwgiljQ2R4EhNOf+G3hEUal t2Pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=drSl5OGY; 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 fb10-20020a1709073a0a00b0088fa742b8ebsi10920219ejc.667.2023.02.07.06.35.22; Tue, 07 Feb 2023 06:35:45 -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=drSl5OGY; 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 S232837AbjBGOeF (ORCPT + 99 others); Tue, 7 Feb 2023 09:34:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232868AbjBGOdB (ORCPT ); Tue, 7 Feb 2023 09:33:01 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF8883EC42; Tue, 7 Feb 2023 06:30:13 -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 317CEtk8026890; Tue, 7 Feb 2023 14:30:08 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=NS90slSACWJ0/WLpkNKGa2YnsV2TaoWISg4Fks6F5M4=; b=drSl5OGYYvKeFBWOwmdhH0KFvpBDxA1GNzpsbkPKUbMZp6SgTX6FEi2IQ/DlIlIWNTuL MbCY8mzJ9qtBThUYk2u5nzV+tJ43IFBx0wWMGMM0TPLc+hjOF4unWvLotQggP7DwzIN5 WYiKIh1mkMqCoUWO3C4SSCkYu7FYKUi1Cwq1Zp0C4yBuCYYXSvlLO3mJF5OKv1AwtPxk /3yb8cqPABiAjVw8DsHau74rcYisB448U2y5E6pUvgCcoUH0Z12m8c2+S3GUGeBnWFQR EpD7hutHGBVMws2O9JCN1+bJuqKLqGYsz5lcpG2WMlZldlbEDa1MIX4i4ru1XXaSUvZC 9g== 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 3nkmnnrfxq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Feb 2023 14:30:08 +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 317EU48x003184; Tue, 7 Feb 2023 14:30:04 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 3nhgeke6f5-1; Tue, 07 Feb 2023 14:30:04 +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 317EU48p003164; Tue, 7 Feb 2023 14:30:04 GMT Received: from kalyant-linux.qualcomm.com (kalyant-linux.qualcomm.com [10.204.66.210]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 317EU4tx003148; Tue, 07 Feb 2023 14:30:04 +0000 Received: by kalyant-linux.qualcomm.com (Postfix, from userid 94428) id 80FDF4BE0; Tue, 7 Feb 2023 06:30:02 -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 v2 3/4] drm/msm/dpu: avoid unnecessary check in DPU reservations Date: Tue, 7 Feb 2023 06:29:55 -0800 Message-Id: <1675780196-3076-4-git-send-email-quic_kalyant@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1675780196-3076-1-git-send-email-quic_kalyant@quicinc.com> References: <1675780196-3076-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: BXMRNY_kPOrCf1ZjiQC0ETQMhboBheCy X-Proofpoint-GUID: BXMRNY_kPOrCf1ZjiQC0ETQMhboBheCy 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-07_06,2023-02-06_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 impostorscore=0 mlxlogscore=858 phishscore=0 adultscore=0 clxscore=1015 malwarescore=0 priorityscore=1501 suspectscore=0 spamscore=0 lowpriorityscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302070129 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?1757183260847118190?= X-GMAIL-MSGID: =?utf-8?q?1757183260847118190?= 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);