* [PATCH 1/3] drm/radeon: split out radeon_uvd_resume from uvd_v4_2_resume
@ 2013-08-29 21:24 Alex Deucher
2013-08-29 21:24 ` [PATCH 2/3] drm/radeon: check the return value of uvd_v1_0_start in uvd_v1_0_init Alex Deucher
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Alex Deucher @ 2013-08-29 21:24 UTC (permalink / raw)
To: dri-devel; +Cc: Alex Deucher
For powergating, we just need to re-init the registers, there
is no need to resture the uvd BOs. This just adds needless
work when powergating uvd for playback while the system is
on. We only need to restore the uvd BOs on an actual resume
from suspend or when the driver loads.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
drivers/gpu/drm/radeon/cik.c | 13 ++++++++-----
drivers/gpu/drm/radeon/uvd_v4_2.c | 5 -----
2 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
index e336a31..79124f8 100644
--- a/drivers/gpu/drm/radeon/cik.c
+++ b/drivers/gpu/drm/radeon/cik.c
@@ -7051,12 +7051,15 @@ static int cik_startup(struct radeon_device *rdev)
return r;
}
- r = uvd_v4_2_resume(rdev);
+ r = radeon_uvd_resume(rdev);
if (!r) {
- r = radeon_fence_driver_start_ring(rdev,
- R600_RING_TYPE_UVD_INDEX);
- if (r)
- dev_err(rdev->dev, "UVD fences init error (%d).\n", r);
+ r = uvd_v4_2_resume(rdev);
+ if (!r) {
+ r = radeon_fence_driver_start_ring(rdev,
+ R600_RING_TYPE_UVD_INDEX);
+ if (r)
+ dev_err(rdev->dev, "UVD fences init error (%d).\n", r);
+ }
}
if (r)
rdev->ring[R600_RING_TYPE_UVD_INDEX].ring_size = 0;
diff --git a/drivers/gpu/drm/radeon/uvd_v4_2.c b/drivers/gpu/drm/radeon/uvd_v4_2.c
index d7e4807..d04d507 100644
--- a/drivers/gpu/drm/radeon/uvd_v4_2.c
+++ b/drivers/gpu/drm/radeon/uvd_v4_2.c
@@ -39,11 +39,6 @@ int uvd_v4_2_resume(struct radeon_device *rdev)
{
uint64_t addr;
uint32_t size;
- int r;
-
- r = radeon_uvd_resume(rdev);
- if (r)
- return r;
/* programm the VCPU memory controller bits 0-27 */
addr = rdev->uvd.gpu_addr >> 3;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH 2/3] drm/radeon: check the return value of uvd_v1_0_start in uvd_v1_0_init
2013-08-29 21:24 [PATCH 1/3] drm/radeon: split out radeon_uvd_resume from uvd_v4_2_resume Alex Deucher
@ 2013-08-29 21:24 ` Alex Deucher
2013-08-29 21:24 ` [PATCH 3/3] drm/radeon/dpm: only need to reprogram uvd if uvd pg is enabled Alex Deucher
2013-08-30 6:49 ` [PATCH 1/3] drm/radeon: split out radeon_uvd_resume from uvd_v4_2_resume Christian König
2 siblings, 0 replies; 4+ messages in thread
From: Alex Deucher @ 2013-08-29 21:24 UTC (permalink / raw)
To: dri-devel; +Cc: Alex Deucher
No need to try the ring tests if starting the UVD block failed.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
drivers/gpu/drm/radeon/uvd_v1_0.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/radeon/uvd_v1_0.c b/drivers/gpu/drm/radeon/uvd_v1_0.c
index 76ca669..3426be9 100644
--- a/drivers/gpu/drm/radeon/uvd_v1_0.c
+++ b/drivers/gpu/drm/radeon/uvd_v1_0.c
@@ -85,7 +85,9 @@ int uvd_v1_0_init(struct radeon_device *rdev)
/* raise clocks while booting up the VCPU */
radeon_set_uvd_clocks(rdev, 53300, 40000);
- uvd_v1_0_start(rdev);
+ r = uvd_v1_0_start(rdev);
+ if (r)
+ goto done;
ring->ready = true;
r = radeon_ring_test(rdev, R600_RING_TYPE_UVD_INDEX, ring);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 3/3] drm/radeon/dpm: only need to reprogram uvd if uvd pg is enabled
2013-08-29 21:24 [PATCH 1/3] drm/radeon: split out radeon_uvd_resume from uvd_v4_2_resume Alex Deucher
2013-08-29 21:24 ` [PATCH 2/3] drm/radeon: check the return value of uvd_v1_0_start in uvd_v1_0_init Alex Deucher
@ 2013-08-29 21:24 ` Alex Deucher
2013-08-30 6:49 ` [PATCH 1/3] drm/radeon: split out radeon_uvd_resume from uvd_v4_2_resume Christian König
2 siblings, 0 replies; 4+ messages in thread
From: Alex Deucher @ 2013-08-29 21:24 UTC (permalink / raw)
To: dri-devel; +Cc: Alex Deucher
Avoid needless uvd reprogramming if uvd powergating is disabled.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
drivers/gpu/drm/radeon/kv_dpm.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/radeon/kv_dpm.c b/drivers/gpu/drm/radeon/kv_dpm.c
index a102077..15a6f67 100644
--- a/drivers/gpu/drm/radeon/kv_dpm.c
+++ b/drivers/gpu/drm/radeon/kv_dpm.c
@@ -1491,17 +1491,20 @@ void kv_dpm_powergate_uvd(struct radeon_device *rdev, bool gate)
pi->uvd_power_gated = gate;
if (gate) {
- uvd_v1_0_stop(rdev);
- cik_update_cg(rdev, RADEON_CG_BLOCK_UVD, false);
+ if (pi->caps_uvd_pg) {
+ uvd_v1_0_stop(rdev);
+ cik_update_cg(rdev, RADEON_CG_BLOCK_UVD, false);
+ }
kv_update_uvd_dpm(rdev, gate);
if (pi->caps_uvd_pg)
kv_notify_message_to_smu(rdev, PPSMC_MSG_UVDPowerOFF);
} else {
- if (pi->caps_uvd_pg)
+ if (pi->caps_uvd_pg) {
kv_notify_message_to_smu(rdev, PPSMC_MSG_UVDPowerON);
- uvd_v4_2_resume(rdev);
- uvd_v1_0_start(rdev);
- cik_update_cg(rdev, RADEON_CG_BLOCK_UVD, true);
+ uvd_v4_2_resume(rdev);
+ uvd_v1_0_start(rdev);
+ cik_update_cg(rdev, RADEON_CG_BLOCK_UVD, true);
+ }
kv_update_uvd_dpm(rdev, gate);
}
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH 1/3] drm/radeon: split out radeon_uvd_resume from uvd_v4_2_resume
2013-08-29 21:24 [PATCH 1/3] drm/radeon: split out radeon_uvd_resume from uvd_v4_2_resume Alex Deucher
2013-08-29 21:24 ` [PATCH 2/3] drm/radeon: check the return value of uvd_v1_0_start in uvd_v1_0_init Alex Deucher
2013-08-29 21:24 ` [PATCH 3/3] drm/radeon/dpm: only need to reprogram uvd if uvd pg is enabled Alex Deucher
@ 2013-08-30 6:49 ` Christian König
2 siblings, 0 replies; 4+ messages in thread
From: Christian König @ 2013-08-30 6:49 UTC (permalink / raw)
To: Alex Deucher; +Cc: Alex Deucher, dri-devel
Am 29.08.2013 23:24, schrieb Alex Deucher:
> For powergating, we just need to re-init the registers, there
> is no need to resture the uvd BOs. This just adds needless
> work when powergating uvd for playback while the system is
> on. We only need to restore the uvd BOs on an actual resume
> from suspend or when the driver loads.
>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
We probably should mention somewhere that this patchset fixes multiple
stream playback on Kabini, apart from that the patches are:
Reviewed-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/gpu/drm/radeon/cik.c | 13 ++++++++-----
> drivers/gpu/drm/radeon/uvd_v4_2.c | 5 -----
> 2 files changed, 8 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
> index e336a31..79124f8 100644
> --- a/drivers/gpu/drm/radeon/cik.c
> +++ b/drivers/gpu/drm/radeon/cik.c
> @@ -7051,12 +7051,15 @@ static int cik_startup(struct radeon_device *rdev)
> return r;
> }
>
> - r = uvd_v4_2_resume(rdev);
> + r = radeon_uvd_resume(rdev);
> if (!r) {
> - r = radeon_fence_driver_start_ring(rdev,
> - R600_RING_TYPE_UVD_INDEX);
> - if (r)
> - dev_err(rdev->dev, "UVD fences init error (%d).\n", r);
> + r = uvd_v4_2_resume(rdev);
> + if (!r) {
> + r = radeon_fence_driver_start_ring(rdev,
> + R600_RING_TYPE_UVD_INDEX);
> + if (r)
> + dev_err(rdev->dev, "UVD fences init error (%d).\n", r);
> + }
> }
> if (r)
> rdev->ring[R600_RING_TYPE_UVD_INDEX].ring_size = 0;
> diff --git a/drivers/gpu/drm/radeon/uvd_v4_2.c b/drivers/gpu/drm/radeon/uvd_v4_2.c
> index d7e4807..d04d507 100644
> --- a/drivers/gpu/drm/radeon/uvd_v4_2.c
> +++ b/drivers/gpu/drm/radeon/uvd_v4_2.c
> @@ -39,11 +39,6 @@ int uvd_v4_2_resume(struct radeon_device *rdev)
> {
> uint64_t addr;
> uint32_t size;
> - int r;
> -
> - r = radeon_uvd_resume(rdev);
> - if (r)
> - return r;
>
> /* programm the VCPU memory controller bits 0-27 */
> addr = rdev->uvd.gpu_addr >> 3;
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-08-30 6:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-29 21:24 [PATCH 1/3] drm/radeon: split out radeon_uvd_resume from uvd_v4_2_resume Alex Deucher
2013-08-29 21:24 ` [PATCH 2/3] drm/radeon: check the return value of uvd_v1_0_start in uvd_v1_0_init Alex Deucher
2013-08-29 21:24 ` [PATCH 3/3] drm/radeon/dpm: only need to reprogram uvd if uvd pg is enabled Alex Deucher
2013-08-30 6:49 ` [PATCH 1/3] drm/radeon: split out radeon_uvd_resume from uvd_v4_2_resume Christian König
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.