All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Khatri, Sunil" <sukhatri@amd.com>
To: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>,
	Sunil Khatri <sunil.khatri@amd.com>,
	dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org
Cc: "Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Pierre-Eric Pelloux-Prayer" <pierre-eric.pelloux-prayer@amd.com>
Subject: Re: [PATCH v3 2/4] drm/amdgpu: add drm_file reference in userq_mgr
Date: Wed, 16 Apr 2025 14:12:45 +0530	[thread overview]
Message-ID: <c3108180-4579-4aed-b375-946863b0fc87@amd.com> (raw)
In-Reply-To: <dcc0921c-d0f1-491c-b5f8-ef0be4d08dfb@igalia.com>


On 4/16/2025 12:59 PM, Tvrtko Ursulin wrote:
>
> On 15/04/2025 19:43, Sunil Khatri wrote:
>> drm_file will be used in usermode queues code to
>> enable better process information in logging and hence
>> add drm_file part of the userq_mgr struct.
>>
>> update the drm_file pointer in userq_mgr for each
>> amdgpu_driver_open_kms.
>>
>> Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c       | 1 +
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.h | 1 +
>>   2 files changed, 2 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c 
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
>> index 3d319687c1c9..3de3071d66ee 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
>> @@ -1436,6 +1436,7 @@ int amdgpu_driver_open_kms(struct drm_device 
>> *dev, struct drm_file *file_priv)
>>         amdgpu_ctx_mgr_init(&fpriv->ctx_mgr, adev);
>>   +    fpriv->userq_mgr.file = file_priv;
>>       r = amdgpu_userq_mgr_init(&fpriv->userq_mgr, adev);
>
> It's a bit of a layering violation since amdgpu_userq_mgr_init() is 
> the place which otherwise initialises fpriv->user_mgr. One day someome 
> might put a memset in there for example. Anyway, I think it would be 
> nicer if you passed fpriv to that function. Potentially instead of 
> adev. Looks like that would be cleaner "design".
>
I agree totally this should be inside amdgpu_userq_mgr_init with fpriv 
passed to function. But i guess whoever wrote it in first place thought 
to make it same as done in a line above fot ctx_mgr. Once we have these 
patches merge i will push these fixes separately.

Regards
Sunil Khatri

> Regards,
>
> Tvrtko
>
>>       if (r)
>>           DRM_WARN("Can't setup usermode queues, use legacy workload 
>> submission only\n");
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.h 
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.h
>> index 381b9c6f0573..fe51a45f7ee4 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.h
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.h
>> @@ -77,6 +77,7 @@ struct amdgpu_userq_mgr {
>>       struct amdgpu_device        *adev;
>>       struct delayed_work        resume_work;
>>       struct list_head        list;
>> +    struct drm_file            *file;
>>   };
>>     struct amdgpu_db_info {
>

  reply	other threads:[~2025-04-16  8:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-15 18:43 [PATCH v3 1/4] drm: add function drm_file_err to print proc information too Sunil Khatri
2025-04-15 18:43 ` [PATCH v3 2/4] drm/amdgpu: add drm_file reference in userq_mgr Sunil Khatri
2025-04-16  7:29   ` Tvrtko Ursulin
2025-04-16  8:42     ` Khatri, Sunil [this message]
2025-04-15 18:43 ` [PATCH v3 3/4] drm/amdgpu: use drm_file_err in logging to also dump process information Sunil Khatri
2025-04-16  7:26   ` Tvrtko Ursulin
2025-04-16 10:01     ` Khatri, Sunil
2025-04-16 12:07       ` Pierre-Eric Pelloux-Prayer
2025-04-16 12:16         ` Khatri, Sunil
2025-04-15 18:43 ` [PATCH v3 4/4] drm/amdgpu: change DRM_ERROR to drm_file_err in amdgpu_userqueue.c Sunil Khatri
2025-04-16  7:18   ` Tvrtko Ursulin
2025-04-16  7:22     ` Khatri, Sunil
2025-04-16  7:07 ` [PATCH v3 1/4] drm: add function drm_file_err to print proc information too Tvrtko Ursulin
2025-04-16  8:39   ` Khatri, Sunil
2025-04-16 11:22     ` Christian König

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=c3108180-4579-4aed-b375-946863b0fc87@amd.com \
    --to=sukhatri@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=pierre-eric.pelloux-prayer@amd.com \
    --cc=sunil.khatri@amd.com \
    --cc=tvrtko.ursulin@igalia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.