Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1784374rdh; Tue, 26 Sep 2023 03:36:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGkGQr/icIvLvSDceADHLeFa4DfAXnZEoKCRf1k9OQOIV2CYXZpo0G6A403WZTxYKYw3W1P X-Received: by 2002:a05:6870:d29a:b0:1d6:51aa:13a2 with SMTP id d26-20020a056870d29a00b001d651aa13a2mr11069310oae.10.1695724584522; Tue, 26 Sep 2023 03:36:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695724584; cv=none; d=google.com; s=arc-20160816; b=BEcR0Cs7So9+qjhIGMCm92XLEEgBKNho3mDdNTGCta/NHfycQLevXKMqnjiSxHePWW nqTK8dXGGRGwkb4JqPT7224jf1ZnNxzjMn8S4XoBZRbNp1FUMBCoovXspMJ7lYnC9TIA jO/DgufylIRxFcNI57bASru5CaHQgQJCJp8GRu2Enf1Vms7pJfuKCnZLo0Q/3lJQSVLu RZSUY1eXY9gYaKd4dXXWPMBrMQhOm46ATc6z6w7JPLQPyLMg0dksCkLXGewFGFp+MxJ/ fx1qtPtdHyFOe0amuI7+P//x9CQ5Q4PIXqNlW8UyMbUT7m78I3kkq9cEPYP7uCXY0AnM hfaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=a98I+/enWVs0BEjUps7tbFx8/Tj78e5XZIx5A8fkfhE=; fh=Rv4j8xW2jkvfVj+ysWYT0bzwbhgPURxk8+CP2g8u+O0=; b=Yvfp4WrPCnK62g2lpZwnidBmnpfmkUttxlOsS9gMwbVteb5a8K6hAV8zRreqRBGh+A 01iCZHWJGEU5gG2DB3r4L04zWEEnDgu5QxmW5td48UHaa00GnYDZvuJRYlnZJfKweTDO JWDzVxEN3pR8onOowFhTWSxfZeyaNzWcj3v9rySuaAeH+TqSIvyyt+EQLmLP4E/X9rZN yh5ijYRC/nCz5KXqQmopMlOJGEEdVD12mSU+qbNGnPO3Yk3d8ysXzyJZUECYco6mo8Vv iEjLK7uZ+r4UDlMXJAQMCal7A6zAhtME2sZ9Btbv4tXEQUpHU15Z4iJYBMeVlatEphP1 SsxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="eT/u6bJU"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id bz14-20020a056a02060e00b00578b6e32b60si14168129pgb.126.2023.09.26.03.36.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 03:36:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="eT/u6bJU"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 6DE95817C1F2; Tue, 26 Sep 2023 03:22:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229445AbjIZKWY (ORCPT + 99 others); Tue, 26 Sep 2023 06:22:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229845AbjIZKWV (ORCPT ); Tue, 26 Sep 2023 06:22:21 -0400 Received: from mail-yw1-x1130.google.com (mail-yw1-x1130.google.com [IPv6:2607:f8b0:4864:20::1130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 440E1B3 for ; Tue, 26 Sep 2023 03:22:15 -0700 (PDT) Received: by mail-yw1-x1130.google.com with SMTP id 00721157ae682-59f6763767dso57150327b3.2 for ; Tue, 26 Sep 2023 03:22:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695723734; x=1696328534; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=a98I+/enWVs0BEjUps7tbFx8/Tj78e5XZIx5A8fkfhE=; b=eT/u6bJUvD3zAQnvIe1VnlKFkKwyk7s+H5HFzh0L7pvVn3OtZ0x38c0K30VkyEGBhJ hPBTNKjiTEeOipNfw+6fbf9pvV7qnXJY6TAjhNH5/tFgrmk7QIV/XAV/iZgJTxInPvyh 4dRzTZDs3DSze7gTdR8uud7MHfYD3BRBXlOctDewLRxSD0vpzkdbtS1+ZX0XaN0NIIe7 vd7kkDQ6iGjP451lIBiiqC2722J9ROG0M+41vEfmWRws1217ENwA5pyeqmVmcR/vyDKs Y66qzSDp7h+agAbVFtqxz2rJMvOzqVGkPtuzqX047utvdSsFE3yhBTjE80t0XANAxEa7 FB7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695723734; x=1696328534; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=a98I+/enWVs0BEjUps7tbFx8/Tj78e5XZIx5A8fkfhE=; b=iSSJbfRSnkf9CRerDmyG5mNOU1pU2yaVjoOf/g+ic82jVoODBhtfxZiNwpAHEo2e85 pzqKzhsCLCREbtZCJzzRGuHHW44qebcSEeU5ZzfpMChKypGvNTVGSthrOkIXtCpha30z 85SK3NZDTN4jd2/juj4JRepGMLIArPxVomHcXpdsJ73KbuZUpYiVI+lbyhZoILPa+u7x s+PTfOIngjuaPD/CKN4LeXmsnlUgHN9gx5AR+6/OE8bLKsf6N4aaskpyaprcp+Tz0aLc JUwmX6iQfO6HCxxVHtbjFd3ckEUm+gSfYDWs2SNZ8ZSiw+YsvoEi1iUJFC7AP6LTiS3M fwMg== X-Gm-Message-State: AOJu0YzMWGpyoMa4SfEykfEo95vVWkzEbVkP2F4FXLcgd71y/IUS30Q9 AxVKX/NCgeu2ELy3iqgp8+hiInMM+MLTRPalvz2uSQ== X-Received: by 2002:a0d:d046:0:b0:586:c27c:3eee with SMTP id s67-20020a0dd046000000b00586c27c3eeemr10831532ywd.38.1695723734453; Tue, 26 Sep 2023 03:22:14 -0700 (PDT) MIME-Version: 1.0 References: <20230911221627.9569-1-quic_abhinavk@quicinc.com> In-Reply-To: <20230911221627.9569-1-quic_abhinavk@quicinc.com> From: Dmitry Baryshkov Date: Tue, 26 Sep 2023 13:21:08 +0300 Message-ID: Subject: Re: [PATCH v2 1/2] drm/msm/dpu: fail dpu_plane_atomic_check() based on mdp clk limits To: Abhinav Kumar Cc: freedreno@lists.freedesktop.org, Rob Clark , Sean Paul , Marijn Suijten , David Airlie , Daniel Vetter , Archit Taneja , Chandan Uddaraju , Jeykumar Sankaran , Rajesh Yadav , dri-devel@lists.freedesktop.org, quic_jesszhan@quicinc.com, quic_parellan@quicinc.com, nespera@igalia.com, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 26 Sep 2023 03:22:22 -0700 (PDT) On Tue, 12 Sept 2023 at 01:18, Abhinav Kumar wrote: > > Currently, dpu_plane_atomic_check() does not check whether the > plane can process the image without exceeding the per chipset > limits for MDP clock. This leads to underflow issues because the > SSPP is not able to complete the processing for the data rate of > the display. > > Fail the dpu_plane_atomic_check() if the SSPP cannot process the > image without exceeding the MDP clock limits. > > changes in v2: > - use crtc_state's adjusted_mode instead of mode > > Fixes: 25fdd5933e4c ("drm/msm: Add SDM845 DPU support") > Signed-off-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov > --- > drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 15 ++++++++++++--- > 1 file changed, 12 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c > index 98c1b22e9bca..0be195f9149c 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c > @@ -733,9 +733,11 @@ static int dpu_plane_check_inline_rotation(struct dpu_plane *pdpu, > static int dpu_plane_atomic_check_pipe(struct dpu_plane *pdpu, > struct dpu_sw_pipe *pipe, > struct dpu_sw_pipe_cfg *pipe_cfg, > - const struct dpu_format *fmt) > + const struct dpu_format *fmt, > + const struct drm_display_mode *mode) > { > uint32_t min_src_size; > + struct dpu_kms *kms = _dpu_plane_get_kms(&pdpu->base); > > min_src_size = DPU_FORMAT_IS_YUV(fmt) ? 2 : 1; > > @@ -774,6 +776,12 @@ static int dpu_plane_atomic_check_pipe(struct dpu_plane *pdpu, > return -EINVAL; > } > > + /* max clk check */ > + if (_dpu_plane_calc_clk(mode, pipe_cfg) > kms->perf.max_core_clk_rate) { > + DPU_DEBUG_PLANE(pdpu, "plane exceeds max mdp core clk limits\n"); > + return -E2BIG; > + } > + > return 0; > } > > @@ -899,12 +907,13 @@ static int dpu_plane_atomic_check(struct drm_plane *plane, > r_pipe_cfg->dst_rect.x1 = pipe_cfg->dst_rect.x2; > } > > - ret = dpu_plane_atomic_check_pipe(pdpu, pipe, pipe_cfg, fmt); > + ret = dpu_plane_atomic_check_pipe(pdpu, pipe, pipe_cfg, fmt, &crtc_state->adjusted_mode); > if (ret) > return ret; > > if (r_pipe->sspp) { > - ret = dpu_plane_atomic_check_pipe(pdpu, r_pipe, r_pipe_cfg, fmt); > + ret = dpu_plane_atomic_check_pipe(pdpu, r_pipe, r_pipe_cfg, fmt, > + &crtc_state->adjusted_mode); > if (ret) > return ret; > } > -- > 2.40.1 > -- With best wishes Dmitry