[PATCH] drm/radeon: fix write back suspend regression with uvd
Alex Deucher
alexdeucher at gmail.com
Fri Jun 7 06:34:11 PDT 2013
On Thu, Jun 6, 2013 at 5:55 PM, <j.glisse at gmail.com> wrote:
> From: Jerome Glisse <jglisse at redhat.com>
>
> UVD ring can't use scratch thus it does need writeback buffer to keep
> a valid address or radeon_ring_backup will trigger a kernel fault.
>
> It's ok to not unpin the write back buffer on suspend as it leave in
> gtt and thus does not need eviction.
>
> Reported and tracked by Wojtek <wojtask9 at wp.pl>
>
> Signed-off-by: Jerome Glisse <jglisse at redhat.com>
Applied. thanks!
Alex
> ---
> drivers/gpu/drm/radeon/radeon_device.c | 15 +++++----------
> 1 file changed, 5 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
> index 1899738..eb8068a 100644
> --- a/drivers/gpu/drm/radeon/radeon_device.c
> +++ b/drivers/gpu/drm/radeon/radeon_device.c
> @@ -244,16 +244,6 @@ void radeon_scratch_free(struct radeon_device *rdev, uint32_t reg)
> */
> void radeon_wb_disable(struct radeon_device *rdev)
> {
> - int r;
> -
> - if (rdev->wb.wb_obj) {
> - r = radeon_bo_reserve(rdev->wb.wb_obj, false);
> - if (unlikely(r != 0))
> - return;
> - radeon_bo_kunmap(rdev->wb.wb_obj);
> - radeon_bo_unpin(rdev->wb.wb_obj);
> - radeon_bo_unreserve(rdev->wb.wb_obj);
> - }
> rdev->wb.enabled = false;
> }
>
> @@ -269,6 +259,11 @@ void radeon_wb_fini(struct radeon_device *rdev)
> {
> radeon_wb_disable(rdev);
> if (rdev->wb.wb_obj) {
> + if (!radeon_bo_reserve(rdev->wb.wb_obj, false)) {
> + radeon_bo_kunmap(rdev->wb.wb_obj);
> + radeon_bo_unpin(rdev->wb.wb_obj);
> + radeon_bo_unreserve(rdev->wb.wb_obj);
> + }
> radeon_bo_unref(&rdev->wb.wb_obj);
> rdev->wb.wb = NULL;
> rdev->wb.wb_obj = NULL;
> --
> 1.7.11.7
>
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
More information about the dri-devel
mailing list