mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hamza Mahfooz <hamza.mahfooz@amd.com>
To: Harry Wentland <harry.wentland@amd.com>, amd-gfx@lists.freedesktop.org
Cc: "Stylon Wang" <stylon.wang@amd.com>,
	"Alan Liu" <haoping.liu@amd.com>,
	"Srinivasan Shanmugam" <srinivasan.shanmugam@amd.com>,
	"Leo Li" <sunpeng.li@amd.com>,
	"Qingqing Zhuo" <Qingqing.Zhuo@amd.com>,
	"Pan, Xinhui" <Xinhui.Pan@amd.com>,
	"Rodrigo Siqueira" <Rodrigo.Siqueira@amd.com>,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	"Aurabindo Pillai" <aurabindo.pillai@amd.com>,
	"Hersen Wu" <hersenxs.wu@amd.com>,
	dri-devel@lists.freedesktop.org, "Wayne Lin" <wayne.lin@amd.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Joshua Ashton" <joshua@froggi.es>
Subject: Re: [PATCH] drm/amd/display: fix the ability to use lower resolution modes on eDP
Date: Thu, 14 Sep 2023 17:12:44 -0400	[thread overview]
Message-ID: <e44d8385-1137-4f41-a3db-9af88ff87bb9@amd.com> (raw)
In-Reply-To: <290648a9-4882-4228-bdbd-1045e20b71f7@amd.com>


On 9/14/23 17:04, Hamza Mahfooz wrote:
> 
> On 9/14/23 16:40, Harry Wentland wrote:
>> On 2023-09-14 13:53, Hamza Mahfooz wrote:
>>> On eDP we can receive invalid modes from dm_update_crtc_state() for
>>> entirely new streams for which drm_mode_set_crtcinfo() shouldn't be
>>> called on. So, instead of calling drm_mode_set_crtcinfo() from within
>>> create_stream_for_sink() we can instead call it from
>>> amdgpu_dm_connector_mode_valid(). Since, we are guaranteed to only call
>>> drm_mode_set_crtcinfo() for valid modes from that function (invalid
>>> modes are rejected by that callback) and that is the only user
>>> of create_validate_stream_for_sink() that we need to call
>>> drm_mode_set_crtcinfo() for (as before commit cb841d27b876
>>> ("drm/amd/display: Always pass connector_state to stream validation"),
>>> that is the only place where create_validate_stream_for_sink()'s
>>> dm_state was NULL).
>>>
>>
>> I don't seem to see how a NULL dm_state in
>> create_validate_stream_for_sink() (or create_stream_for_sink() for that
>> matter) has an impact on the drm_mode_set_crtcinfo() call. That one 
>> depends
>> on !old_stream and &mode.
> 
> If we look back to commit 4a2df0d1f28e ("drm/amd/display: Fixed
> non-native modes not lighting up") it seems like the intent was to only
> have drm_mode_set_crtcinfo() called for
> amdgpu_dm_connector_mode_valid(). Since, even if we go that far back
> create_stream_for_sink()'s dm_state was only NULL when it was called
> from amdgpu_dm_connector_mode_valid().
> 
>>
>> It does look like &mode is an empty mode if we can't find a 
>> preferred_mode,
>> though. Not sure if that can cause an issue.
> 
> I don't think it should be an issue, since before commit 4a2df0d1f28e
> ("drm/amd/display: Fixed non-native modes not lighting up") we always

I meant to refer to commit bd49f19039c1 ("drm/amd/display: Always set
crtcinfo from create_stream_for_sink") here.

> called drm_mode_set_crtcinfo() in the aforementioned case (and only for 
> that case).
> 
>>
>> Harry
>>
>>> Cc: stable@vger.kernel.org
>>> Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2693
>>> Fixes: cb841d27b876 ("drm/amd/display: Always pass connector_state to 
>>> stream validation")
>>> Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
>>> ---
>>>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++--
>>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c 
>>> b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>>> index 933c9b5d5252..beef4fef7338 100644
>>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>>> @@ -6128,8 +6128,6 @@ create_stream_for_sink(struct 
>>> amdgpu_dm_connector *aconnector,
>>>       if (recalculate_timing)
>>>           drm_mode_set_crtcinfo(&saved_mode, 0);
>>> -    else if (!old_stream)
>>> -        drm_mode_set_crtcinfo(&mode, 0);
>>>       /*
>>>        * If scaling is enabled and refresh rate didn't change
>>> @@ -6691,6 +6689,8 @@ enum drm_mode_status 
>>> amdgpu_dm_connector_mode_valid(struct drm_connector *connec
>>>           goto fail;
>>>       }
>>> +    drm_mode_set_crtcinfo(mode, 0);
>>> +
>>>       stream = create_validate_stream_for_sink(aconnector, mode,
>>>                            to_dm_connector_state(connector->state),
>>>                            NULL);
>>
-- 
Hamza


  reply	other threads:[~2023-09-14 21:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-14 17:53 Hamza Mahfooz
2023-09-14 20:40 ` Harry Wentland
2023-09-14 21:04   ` Hamza Mahfooz
2023-09-14 21:12     ` Hamza Mahfooz [this message]
2023-09-15 18:10       ` Harry Wentland

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=e44d8385-1137-4f41-a3db-9af88ff87bb9@amd.com \
    --to=hamza.mahfooz@amd.com \
    --cc=Qingqing.Zhuo@amd.com \
    --cc=Rodrigo.Siqueira@amd.com \
    --cc=Xinhui.Pan@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=aurabindo.pillai@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=haoping.liu@amd.com \
    --cc=harry.wentland@amd.com \
    --cc=hersenxs.wu@amd.com \
    --cc=joshua@froggi.es \
    --cc=linux-kernel@vger.kernel.org \
    --cc=srinivasan.shanmugam@amd.com \
    --cc=stable@vger.kernel.org \
    --cc=stylon.wang@amd.com \
    --cc=sunpeng.li@amd.com \
    --cc=wayne.lin@amd.com \
    /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

all inboxes | Powered by JetHome®