mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-05 13:51:52 +00:00
drm/amdgpu:No action when VCN PG state is unchanged
When VCN PG state is unchanged, it is unnecessary to reset power gate state Signed-off-by: James Zhu <James.Zhu@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
2faec55c4d
commit
c95f75f4e8
2 changed files with 11 additions and 2 deletions
|
@ -69,6 +69,7 @@ struct amdgpu_vcn {
|
||||||
struct amdgpu_ring ring_jpeg;
|
struct amdgpu_ring ring_jpeg;
|
||||||
struct amdgpu_irq_src irq;
|
struct amdgpu_irq_src irq;
|
||||||
unsigned num_enc_rings;
|
unsigned num_enc_rings;
|
||||||
|
enum amd_powergating_state cur_state;
|
||||||
};
|
};
|
||||||
|
|
||||||
int amdgpu_vcn_sw_init(struct amdgpu_device *adev);
|
int amdgpu_vcn_sw_init(struct amdgpu_device *adev);
|
||||||
|
|
|
@ -1633,12 +1633,20 @@ static int vcn_v1_0_set_powergating_state(void *handle,
|
||||||
* revisit this when there is a cleaner line between
|
* revisit this when there is a cleaner line between
|
||||||
* the smc and the hw blocks
|
* the smc and the hw blocks
|
||||||
*/
|
*/
|
||||||
|
int ret;
|
||||||
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
|
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
|
||||||
|
|
||||||
|
if(state == adev->vcn.cur_state)
|
||||||
|
return 0;
|
||||||
|
|
||||||
if (state == AMD_PG_STATE_GATE)
|
if (state == AMD_PG_STATE_GATE)
|
||||||
return vcn_v1_0_stop(adev);
|
ret = vcn_v1_0_stop(adev);
|
||||||
else
|
else
|
||||||
return vcn_v1_0_start(adev);
|
ret = vcn_v1_0_start(adev);
|
||||||
|
|
||||||
|
if(!ret)
|
||||||
|
adev->vcn.cur_state = state;
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct amd_ip_funcs vcn_v1_0_ip_funcs = {
|
static const struct amd_ip_funcs vcn_v1_0_ip_funcs = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue