lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3630bc42-c04c-4c22-99f2-5dc6bd5d8e2f@amd.com>
Date:   Thu, 14 Sep 2023 16:40:52 -0400
From:   Harry Wentland <harry.wentland@....com>
To:     Hamza Mahfooz <hamza.mahfooz@....com>,
        amd-gfx@...ts.freedesktop.org
Cc:     stable@...r.kernel.org, Leo Li <sunpeng.li@....com>,
        Rodrigo Siqueira <Rodrigo.Siqueira@....com>,
        Alex Deucher <alexander.deucher@....com>,
        Christian König <christian.koenig@....com>,
        "Pan, Xinhui" <Xinhui.Pan@....com>,
        David Airlie <airlied@...il.com>,
        Daniel Vetter <daniel@...ll.ch>,
        Qingqing Zhuo <Qingqing.Zhuo@....com>,
        Aurabindo Pillai <aurabindo.pillai@....com>,
        Hersen Wu <hersenxs.wu@....com>,
        Srinivasan Shanmugam <srinivasan.shanmugam@....com>,
        Stylon Wang <stylon.wang@....com>,
        Wayne Lin <wayne.lin@....com>, Alan Liu <haoping.liu@....com>,
        Joshua Ashton <joshua@...ggi.es>,
        dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/amd/display: fix the ability to use lower resolution
 modes on eDP

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.

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.

Harry

> Cc: stable@...r.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@....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);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ