Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org,
	intel-gfx@lists.freedesktop.org,
	Harry Wentland <harry.wentland@amd.com>,
	Leo Li <sunpeng.li@amd.com>,
	Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>,
	Alex Deucher <alexander.deucher@amd.com>
Subject: Re: [RESEND 3/3] drm/amd/display: switch to guid_gen() to generate valid GUIDs
Date: Wed, 28 Aug 2024 16:40:33 +0300	[thread overview]
Message-ID: <87plpsydda.fsf@intel.com> (raw)
In-Reply-To: <Zs8kJOC2pH7gSfET@phenom.ffwll.local>

On Wed, 28 Aug 2024, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> On Mon, Aug 12, 2024 at 03:23:12PM +0300, Jani Nikula wrote:
>> Instead of just smashing jiffies into a GUID, use guid_gen() to generate
>> RFC 4122 compliant GUIDs.
>> 
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>> 
>> ---
>> 
>> Side note, it baffles me why amdgpu has a copy of this instead of
>> plumbing it into drm mst code.
>
> Yeah ec5fa9fcdeca ("drm/amd/display: Adjust the MST resume flow") promised
> a follow-up, but that seems to have never materialized. Really should
> materialize though. Patch lgtm
>
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Thanks!

Cc: AMD folks, ack for merging the series via drm-misc-next?

BR,
Jani.


>
>
>> ---
>>  .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 23 ++++++++++---------
>>  1 file changed, 12 insertions(+), 11 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 72c10fc2c890..ce05e7e2a383 100644
>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> @@ -2568,9 +2568,9 @@ static int dm_late_init(void *handle)
>>  
>>  static void resume_mst_branch_status(struct drm_dp_mst_topology_mgr *mgr)
>>  {
>> +	u8 buf[UUID_SIZE];
>> +	guid_t guid;
>>  	int ret;
>> -	u8 guid[16];
>> -	u64 tmp64;
>>  
>>  	mutex_lock(&mgr->lock);
>>  	if (!mgr->mst_primary)
>> @@ -2591,26 +2591,27 @@ static void resume_mst_branch_status(struct drm_dp_mst_topology_mgr *mgr)
>>  	}
>>  
>>  	/* Some hubs forget their guids after they resume */
>> -	ret = drm_dp_dpcd_read(mgr->aux, DP_GUID, guid, 16);
>> -	if (ret != 16) {
>> +	ret = drm_dp_dpcd_read(mgr->aux, DP_GUID, buf, sizeof(buf));
>> +	if (ret != sizeof(buf)) {
>>  		drm_dbg_kms(mgr->dev, "dpcd read failed - undocked during suspend?\n");
>>  		goto out_fail;
>>  	}
>>  
>> -	if (memchr_inv(guid, 0, 16) == NULL) {
>> -		tmp64 = get_jiffies_64();
>> -		memcpy(&guid[0], &tmp64, sizeof(u64));
>> -		memcpy(&guid[8], &tmp64, sizeof(u64));
>> +	import_guid(&guid, buf);
>>  
>> -		ret = drm_dp_dpcd_write(mgr->aux, DP_GUID, guid, 16);
>> +	if (guid_is_null(&guid)) {
>> +		guid_gen(&guid);
>> +		export_guid(buf, &guid);
>>  
>> -		if (ret != 16) {
>> +		ret = drm_dp_dpcd_write(mgr->aux, DP_GUID, buf, sizeof(buf));
>> +
>> +		if (ret != sizeof(buf)) {
>>  			drm_dbg_kms(mgr->dev, "check mstb guid failed - undocked during suspend?\n");
>>  			goto out_fail;
>>  		}
>>  	}
>>  
>> -	import_guid(&mgr->mst_primary->guid, guid);
>> +	guid_copy(&mgr->mst_primary->guid, &guid);
>>  
>>  out_fail:
>>  	mutex_unlock(&mgr->lock);
>> -- 
>> 2.39.2
>> 

-- 
Jani Nikula, Intel

  reply	other threads:[~2024-08-28 13:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-12 12:23 [RESEND 1/3] drm/mst: switch to guid_t type for GUID Jani Nikula
2024-08-12 12:23 ` [RESEND 2/3] drm/mst: switch to guid_gen() to generate valid GUIDs Jani Nikula
2024-08-28 13:16   ` Daniel Vetter
2024-08-12 12:23 ` [RESEND 3/3] drm/amd/display: " Jani Nikula
2024-08-28 13:20   ` Daniel Vetter
2024-08-28 13:40     ` Jani Nikula [this message]
2024-08-28 13:58       ` Alex Deucher
2024-08-28 15:08         ` Harry Wentland
2024-08-29  9:32           ` Jani Nikula
2024-08-28 13:53   ` Hamza Mahfooz
2024-08-28 14:06     ` Jani Nikula
2024-08-28 15:10       ` Jani Nikula
2024-08-28 15:13       ` Hamza Mahfooz
2024-08-12 14:19 ` ✗ Fi.CI.SPARSE: warning for series starting with [RESEND,1/3] drm/mst: switch to guid_t type for GUID Patchwork
2024-08-12 14:34 ` ✓ Fi.CI.BAT: success " Patchwork
2024-08-13  0:39 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-08-28 13:00 ` [RESEND 1/3] " Daniel Vetter

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=87plpsydda.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=Rodrigo.Siqueira@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=harry.wentland@amd.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=sunpeng.li@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