Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Abhinav Kumar <quic_abhinavk@quicinc.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	Rob Clark <robdclark@gmail.com>, Sean Paul <sean@poorly.run>,
	Marijn Suijten <marijn.suijten@somainline.org>,
	Chandan Uddaraju <chandanu@codeaurora.org>,
	Jeykumar Sankaran <jsanka@codeaurora.org>,
	Jordan Crouse <jordan@cosmicpenguin.net>,
	Sravanthi Kollukuduru <skolluku@codeaurora.org>,
	<dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>,
	Archit Taneja <architt@codeaurora.org>,
	Rajesh Yadav <ryadav@codeaurora.org>,
	<linux-arm-msm@vger.kernel.org>,
	<freedreno@lists.freedesktop.org>,
	Simona Vetter <simona.vetter@ffwll.ch>
Subject: Re: [PATCH 3/6] drm/msm/dpu: don't use active in atomic_check()
Date: Wed, 8 Jan 2025 21:37:23 -0800	[thread overview]
Message-ID: <a8159ad0-3d33-4331-899c-6728862a728a@quicinc.com> (raw)
In-Reply-To: <vhqmcb6fu6mfmbjo3jyjdhzpowhvnxbtxg2osk42xwogrsylku@5hvs6mtizqcr>



On 1/8/2025 8:22 PM, Dmitry Baryshkov wrote:
> On Wed, Jan 08, 2025 at 05:19:40PM -0800, Abhinav Kumar wrote:
>>
>>
>> On 12/21/2024 9:00 PM, Dmitry Baryshkov wrote:
>>> The driver isn't supposed to consult crtc_state->active/active_check for
>>> resource allocation. Instead all resources should be allocated if
>>> crtc_state->enabled is set. Stop consulting active / active_changed in
>>> order to determine whether the hardware resources should be
>>> (re)allocated.
>>>
>>> Fixes: 25fdd5933e4c ("drm/msm: Add SDM845 DPU support")
>>> Reported-by: Simona Vetter <simona.vetter@ffwll.ch>
>>> Closes: https://lore.kernel.org/dri-devel/ZtW_S0j5AEr4g0QW@phenom.ffwll.local/
>>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>>> ---
>>>    drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c    | 4 ----
>>>    drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 3 +--
>>>    2 files changed, 1 insertion(+), 6 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
>>> index 7191b1a6d41b3a96f956d199398f12b2923e8c82..65e33eba61726929b740831c95330756b2817e28 100644
>>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
>>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
>>> @@ -1264,10 +1264,6 @@ static int dpu_crtc_atomic_check(struct drm_crtc *crtc,
>>>    	DRM_DEBUG_ATOMIC("%s: check\n", dpu_crtc->name);
>>> -	/* force a full mode set if active state changed */
>>> -	if (crtc_state->active_changed)
>>> -		crtc_state->mode_changed = true;
>>> -
>>>    	if (cstate->num_mixers) {
>>>    		rc = _dpu_crtc_check_and_setup_lm_bounds(crtc, crtc_state);
>>>    		if (rc)
>>> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
>>> index 83de7564e2c1fe14fcf8c4f82335cafc937e1b99..d1ccdca6044353f110bf5b507788efe368f223a3 100644
>>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
>>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
>>> @@ -793,12 +793,11 @@ static int dpu_encoder_virt_atomic_check(
>>>    		crtc_state->mode_changed = true;
>>>    	/*
>>>    	 * 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->enable)
>>
>> I think this was leftover code.
>>
>> What happened was, we used to have dpu_rm_reserve() both in dpu_encoder's
>> atomic_check and mode_set. Hence this is checking !active_changed because
>> that case was expected to get handled in mode_set to avoid duplicate
>> dpu_rm_reserve() calls. Code has progressed since then to drop the
>> dpu_rm_reserve() from mode_set and only use atomic_check.
>>
>> So the correct fixes tag for this should be:
>>
>> Fixes: de3916c70a24 ("drm/msm/dpu: Track resources in global state")
> 
> Actually it should be:
> 
> Fixes: ccc862b957c6 ("drm/msm/dpu: Fix reservation failures in modeset")
> 

Ack.

>> With that addressed, this is
>>
>> Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
>>
>>> +		if (crtc_state->enable)
>>>    			ret = dpu_rm_reserve(&dpu_kms->rm, global_state,
>>>    					drm_enc, crtc_state, topology);
>>>    		if (!ret)
>>>
> 

  reply	other threads:[~2025-01-09  5:38 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-22  5:00 [PATCH 0/6] drm: enforce rules for drm_atomic_helper_check_modeset() Dmitry Baryshkov
2024-12-22  5:00 ` [PATCH 1/6] drm/atomic-helper: document drm_atomic_helper_check() restrictions Dmitry Baryshkov
2025-01-08 17:26   ` Simona Vetter
2025-01-09  5:26   ` Abhinav Kumar
2024-12-22  5:00 ` [PATCH 2/6] drm/atomic: prepare to check that drivers follow restrictions for needs_modeset Dmitry Baryshkov
2025-01-08 17:53   ` Simona Vetter
2025-01-08 18:32     ` Dmitry Baryshkov
2024-12-22  5:00 ` [PATCH 3/6] drm/msm/dpu: don't use active in atomic_check() Dmitry Baryshkov
2025-01-08 17:56   ` Simona Vetter
2025-01-09  1:19   ` Abhinav Kumar
2025-01-09  4:22     ` Dmitry Baryshkov
2025-01-09  5:37       ` Abhinav Kumar [this message]
2024-12-22  5:00 ` [PATCH 4/6] drm/msm/dpu: move needs_cdm setting to dpu_encoder_get_topology() Dmitry Baryshkov
2025-01-09  1:26   ` Abhinav Kumar
2024-12-22  5:00 ` [PATCH 5/6] drm/msm/dpu: simplify dpu_encoder_get_topology() interface Dmitry Baryshkov
2025-01-09  1:32   ` Abhinav Kumar
2024-12-22  5:00 ` [PATCH 6/6] drm/msm/dpu: don't set crtc_state->mode_changed from atomic_check() Dmitry Baryshkov
2025-01-08 17:55   ` Simona Vetter
2025-01-08 18:55     ` Dmitry Baryshkov
2025-01-09  2:27   ` Abhinav Kumar
2025-01-09  4:11     ` Abhinav Kumar
2025-01-09  4:26       ` Dmitry Baryshkov
2025-01-09  5:22         ` Abhinav Kumar
2025-01-09 12:12           ` Dmitry Baryshkov
2025-01-09  4:24     ` Dmitry Baryshkov
2025-01-09 13:53 ` [PATCH 0/6] drm: enforce rules for drm_atomic_helper_check_modeset() Thomas Zimmermann
2025-01-09 23:57   ` Dmitry Baryshkov
2025-01-10 13:30     ` Thomas Zimmermann
2025-01-13  8:47       ` Dmitry Baryshkov
2025-01-23 12:08   ` Dmitry Baryshkov
2025-01-23 12:36 ` (subset) " Dmitry Baryshkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a8159ad0-3d33-4331-899c-6728862a728a@quicinc.com \
    --to=quic_abhinavk@quicinc.com \
    --cc=airlied@gmail.com \
    --cc=architt@codeaurora.org \
    --cc=chandanu@codeaurora.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=jordan@cosmicpenguin.net \
    --cc=jsanka@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=marijn.suijten@somainline.org \
    --cc=mripard@kernel.org \
    --cc=robdclark@gmail.com \
    --cc=ryadav@codeaurora.org \
    --cc=sean@poorly.run \
    --cc=simona.vetter@ffwll.ch \
    --cc=simona@ffwll.ch \
    --cc=skolluku@codeaurora.org \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox