Skip to contentSkip to conversation

drm/amdgpu: correct clock info for SRIOV

PATCH In review Xiangliang Yu 2 participants 4 messages Jun 3, 2017 – Jun 6, 2017 3 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: correct clock info for SRIOV

Currently, get clock info from default clk of pm if dpm is disable. Buf SRIOV doesn't support dpm and pm, can't get anything from pm. Only get clock info only from default clk of amdgpu for SRIOV.

And driver get pm default clk also from amdgpu default clk and never be changed by others. So use amdgpu default clk value for SRIOV and non-dpm cases.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +2 -2
index 4947f04..1935f07 100644
@@ -530,8 +530,8 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file
 			dev_info.max_engine_clock = amdgpu_dpm_get_sclk(adev, false) * 10;
 			dev_info.max_memory_clock = amdgpu_dpm_get_mclk(adev, false) * 10;
 		} else {
-			dev_info.max_engine_clock = adev->pm.default_sclk * 10;
-			dev_info.max_memory_clock = adev->pm.default_mclk * 10;
+			dev_info.max_engine_clock = adev->clock.default_sclk * 10;
+			dev_info.max_memory_clock = adev->clock.default_mclk * 10;
 		}
 		dev_info.enabled_rb_pipes_mask = adev->gfx.config.backend_enable_mask;
 		dev_info.num_rb_pipes = adev->gfx.config.max_backends_per_se *
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1496483095-11415-1-git-send-email-Xiangliang.Yu-5C7GfCeVMHo@public.gmane.org

#2 lore raw
Quoted 8 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Xiangliang Yu
Sent: Saturday, June 03, 2017 5:45 AM
To: [email protected]
Cc: Yu, Xiangliang
Subject: [PATCH] drm/amdgpu: correct clock info for SRIOV

Quoted 7 lines

Currently, get clock info from default clk of pm if dpm is disable. Buf SRIOV doesn't support dpm and pm, can't get anything from pm. Only get clock info only from default clk of amdgpu for SRIOV.

And driver get pm default clk also from amdgpu default clk and never be changed by others. So use amdgpu default clk value for SRIOV and non-dpm cases.

This won't work for vega10 or Raven since we don't parse the default clock info on them anymore due to atom firmware changes.

Alex

Quoted 30 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +0 -0
index 4947f04..1935f07 100644
@@ -530,8 +530,8 @@ static int amdgpu_info_ioctl(struct drm_device *dev,

void *data, struct drm_file
dev_info.max_engine_clock =
amdgpu_dpm_get_sclk(adev, false) * 10;
dev_info.max_memory_clock =
amdgpu_dpm_get_mclk(adev, false) * 10;

drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +0 -1
 		} else {
-			dev_info.max_engine_clock = adev-
Quoted 1 line

pm.default_sclk * 10;

drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +0 -1
-			dev_info.max_memory_clock = adev-
Quoted 1 line

pm.default_mclk * 10;

drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +1 -0
+			dev_info.max_engine_clock = adev-
Quoted 1 line

clock.default_sclk * 10;

drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +1 -0
+			dev_info.max_memory_clock = adev-
Quoted 1 line

clock.default_mclk * 10;

drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +0 -0
 		}
 		dev_info.enabled_rb_pipes_mask = adev-
Quoted 1 line

gfx.config.backend_enable_mask;

dev_info.num_rb_pipes = adev-

Quoted 8 lines
Quoted 1 line

gfx.config.max_backends_per_se *

--
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): BN6PR12MB1652E86A04552889BF7827D0F7CA0-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

#4 lore raw
Quoted 10 lines
Quoted 7 lines

Currently, get clock info from default clk of pm if dpm is disable. Buf SRIOV doesn't support dpm and pm, can't get anything from pm. Only get clock info only from default clk of amdgpu for SRIOV.

And driver get pm default clk also from amdgpu default clk and never be changed by others. So use amdgpu default clk value for SRIOV and non-dpm cases.

This won't work for vega10 or Raven since we don't parse the default clock info on them anymore due to atom firmware changes.

I don't get the info.
Even so, we need to support this for VI family.

Quoted 41 lines

Alex

Quoted 38 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +0 -2
index 4947f04..1935f07 100644
@@ -530,8 +530,8 @@ static int amdgpu_info_ioctl(struct drm_device
 *dev, void *data, struct drm_file
 			dev_info.max_engine_clock =
 amdgpu_dpm_get_sclk(adev, false) * 10;
 			dev_info.max_memory_clock =
 amdgpu_dpm_get_mclk(adev, false) * 10;
 		} else {
-			dev_info.max_engine_clock = adev-
 >pm.default_sclk * 10;
-			dev_info.max_memory_clock = adev-
Quoted 1 line

pm.default_mclk * 10;

drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +1 -0
+			dev_info.max_engine_clock = adev-
Quoted 1 line

clock.default_sclk * 10;

drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +1 -0
+			dev_info.max_memory_clock = adev-
Quoted 1 line

clock.default_mclk * 10;

drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +0 -0
 		}
 		dev_info.enabled_rb_pipes_mask = adev-
Quoted 1 line

gfx.config.backend_enable_mask;

dev_info.num_rb_pipes = adev-

Quoted 1 line

gfx.config.max_backends_per_se *

--
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): BY2PR1201MB0935E8E42BA0FD5EB5E56F6BEBCB0-O28G1zQ8oGkaqtME6NEo1mrFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/[email protected]

Acked-by Alex Deucher
#6 lore raw
Quoted 14 lines

-----Original Message-----
From: Yu, Xiangliang
Sent: Monday, June 05, 2017 10:33 PM
To: Deucher, Alexander; [email protected]
Subject: RE: [PATCH] drm/amdgpu: correct clock info for SRIOV

Quoted 8 lines
Quoted 7 lines

Currently, get clock info from default clk of pm if dpm is disable. Buf SRIOV doesn't support dpm and pm, can't get anything from pm. Only get clock info only from default clk of amdgpu for SRIOV.

And driver get pm default clk also from amdgpu default clk and never be changed by others. So use amdgpu default clk value for SRIOV and non-dpm cases.

Quoted 5 lines
Quoted 2 lines

This won't work for vega10 or Raven since we don't parse the default clock info on them anymore due to atom firmware changes.

I don't get the info.
Even so, we need to support this for VI family.

The default clocks are the boot clocks which don't reflect the actual clocks that chip is running it. Assuming that is ok, the patch is:

Quoted 34 lines
Quoted 34 lines

Alex

Quoted 30 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +0 -2
index 4947f04..1935f07 100644
@@ -530,8 +530,8 @@ static int amdgpu_info_ioctl(struct drm_device
 *dev, void *data, struct drm_file
 			dev_info.max_engine_clock =
 amdgpu_dpm_get_sclk(adev, false) * 10;
 			dev_info.max_memory_clock =
 amdgpu_dpm_get_mclk(adev, false) * 10;
 		} else {
-			dev_info.max_engine_clock = adev-
 >pm.default_sclk * 10;
-			dev_info.max_memory_clock = adev-
Quoted 1 line

pm.default_mclk * 10;

drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +1 -0
+			dev_info.max_engine_clock = adev-
Quoted 1 line

clock.default_sclk * 10;

drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +1 -0
+			dev_info.max_memory_clock = adev-
Quoted 1 line

clock.default_mclk * 10;

drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +0 -0
 		}
 		dev_info.enabled_rb_pipes_mask = adev-
Quoted 1 line

gfx.config.backend_enable_mask;

dev_info.num_rb_pipes = adev-

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 1 line

gfx.config.max_backends_per_se *

--
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx