AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig-5C7GfCeVMHo@public.gmane.org>
To: Huang Rui <ray.huang-5C7GfCeVMHo@public.gmane.org>,
	"StDenis, Tom" <Tom.StDenis-5C7GfCeVMHo@public.gmane.org>
Cc: "Fu, Ping" <Ping.Fu-5C7GfCeVMHo@public.gmane.org>,
	"Mao, David" <David.Mao-5C7GfCeVMHo@public.gmane.org>,
	"Kuehling, Felix" <Felix.Kuehling-5C7GfCeVMHo@public.gmane.org>,
	"amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
	<amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
	"Deucher,
	Alexander" <Alexander.Deucher-5C7GfCeVMHo@public.gmane.org>,
	"Zhu, Rex" <Rex.Zhu-5C7GfCeVMHo@public.gmane.org>,
	"Zhang, Hawking" <Hawking.Zhang-5C7GfCeVMHo@public.gmane.org>
Subject: Re: [PART1 PATCH v4 7/8] drm/amdgpu: add get clockgating_state method for uvd v5&v6
Date: Mon, 9 Jan 2017 15:45:33 +0100	[thread overview]
Message-ID: <523a8df8-2573-0c56-e6c7-5ac74f77f1f3@amd.com> (raw)
In-Reply-To: <20170109144614.GA3743@hr-amur2>

Am 09.01.2017 um 15:46 schrieb Huang Rui:
> On Mon, Jan 09, 2017 at 07:29:00PM +0800, StDenis, Tom wrote:
>> Yup it's held by both amdgpu_dpm_enable_uvd() and amdgpu_dpm_enable_vce()
>>
>> Tom
>>
> <snip>
>
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c b/drivers/gpu/drm/amd/
>> amdgpu/uvd_v5_0.c
>>> index 03a35d9..e647d3e 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c
>>> @@ -781,16 +781,48 @@ static int uvd_v5_0_set_powergating_state(void *handle,
>>>          * the smc and the hw blocks
>>>          */
>>>         struct amdgpu_device *adev = (struct amdgpu_device *)handle;
>>> +     int ret = 0;
>>>   
>>>         if (!(adev->pg_flags & AMD_PG_SUPPORT_UVD))
>>>                 return 0;
>>>   
>>> +     mutex_lock(&adev->pm.mutex);
>> Might be that I'm wrong, but didn't Tom said the mutex is taken anyway
>> when this function is called?
>>
>> If that's true we would certainly run into problem when we try to
>> acquire it again.
>>
> OK, I see. Actually, pm.mutex is already held on upper layer call
> (amdgpu_dpm_enable_uvd). So we should not hold it again here.
>
>>> +
>>> +static void uvd_v5_0_get_clockgating_state(void *handle, u32 *flags)
>>> +{
>>> +     struct amdgpu_device *adev = (struct amdgpu_device *)handle;
>>> +     int data;
>>> +
>>> +     mutex_lock(&adev->pm.mutex);
>>> +
> We just need keep pm.mutex here in set_clockgating_state, that's enough.
>
> Christian, Tom, am I right?

Yes, I think so.

Christian.

>
> Thanks,
> Rui


_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  reply	other threads:[~2017-01-09 14:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-09  3:00 [PART1 PATCH v4 2/8] drm/amdgpu: add parse clock gating state Huang Rui
     [not found] ` <1483930814-23529-1-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org>
2017-01-09  3:00   ` [PART1 PATCH v4 7/8] drm/amdgpu: add get clockgating_state method for uvd v5&v6 Huang Rui
     [not found]     ` <1483930814-23529-2-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org>
2017-01-09 10:32       ` Christian König
     [not found]         ` <364cc068-e347-5f77-b4ff-414f8e8b4fdb-5C7GfCeVMHo@public.gmane.org>
2017-01-09 11:29           ` StDenis, Tom
     [not found]             ` <CY4PR12MB176846FDA72EF232B6825609F7640-rpdhrqHFk06yjjPBNVDk/QdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-01-09 14:46               ` Huang Rui
2017-01-09 14:45                 ` Christian König [this message]
     [not found]                   ` <523a8df8-2573-0c56-e6c7-5ac74f77f1f3-5C7GfCeVMHo@public.gmane.org>
2017-01-09 14:50                     ` StDenis, Tom
2017-01-09  3:00   ` [PART1 PATCH v4 8/8] drm/amdgpu: add get clockgating_state method for vce v3 Huang Rui
2017-01-09 14:02   ` [PART1 PATCH v4 2/8] drm/amdgpu: add parse clock gating state Deucher, Alexander

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=523a8df8-2573-0c56-e6c7-5ac74f77f1f3@amd.com \
    --to=christian.koenig-5c7gfcevmho@public.gmane.org \
    --cc=Alexander.Deucher-5C7GfCeVMHo@public.gmane.org \
    --cc=David.Mao-5C7GfCeVMHo@public.gmane.org \
    --cc=Felix.Kuehling-5C7GfCeVMHo@public.gmane.org \
    --cc=Hawking.Zhang-5C7GfCeVMHo@public.gmane.org \
    --cc=Ping.Fu-5C7GfCeVMHo@public.gmane.org \
    --cc=Rex.Zhu-5C7GfCeVMHo@public.gmane.org \
    --cc=Tom.StDenis-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=ray.huang-5C7GfCeVMHo@public.gmane.org \
    /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