[PART1 PATCH v2 7/8] drm/amdgpu: add get clockgating_state method for uvd v5&v6

Huang Rui ray.huang at amd.com
Fri Jan 6 10:23:22 UTC 2017


On Fri, Jan 06, 2017 at 06:14:27PM +0800, Huang Rui wrote:
> On Fri, Jan 06, 2017 at 10:52:25AM +0100, Christian König wrote:
> > Am 06.01.2017 um 08:45 schrieb Huang Rui:
> > >+static void uvd_v6_0_get_clockgating_state(void *handle, u32 *flags)
> > >+{
> > >+	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
> > >+	int data;
> > >+
> > >+	if (adev->uvd.is_powergated) {
> > >+		DRM_INFO("Cannot get clockgating state when UVD is powergated.\n");
> > >+		return;
> > >  	}
> > 
> > This is not really save. The power can be gated just in the moment
> > you check the variable.
> > 
> > Adding a spinlock or mutex to protect the variable should be sufficient.
> > 
> 
> Yes, a lock should be added. How about below changes:
> 

Christian, sorry please ignore this mail, I just update uvd v5, missed to
update uvd v6. I will send it later.

Thanks,
Rui


More information about the amd-gfx mailing list