diff mbox

drm/radeon: free uvd ring on unload

Message ID 1393460567-612-1-git-send-email-j.glisse@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jerome Glisse Feb. 27, 2014, 12:22 a.m. UTC
From: Jerome Glisse <jglisse@redhat.com>

Need to free the uvd ring. Also reshuffle gart tear down to
happen after uvd tear down.

Signed-off-by: Jérôme Glisse <jglisse@redhat.com>
Cc: stable@vger.kernel.org
---
 drivers/gpu/drm/radeon/evergreen.c  | 2 +-
 drivers/gpu/drm/radeon/radeon_uvd.c | 2 ++
 drivers/gpu/drm/radeon/rv770.c      | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)

Comments

Christian König Feb. 27, 2014, 9:20 a.m. UTC | #1
Am 27.02.2014 01:22, schrieb j.glisse@gmail.com:
> From: Jerome Glisse <jglisse@redhat.com>
>
> Need to free the uvd ring. Also reshuffle gart tear down to
> happen after uvd tear down.
>
> Signed-off-by: Jérôme Glisse <jglisse@redhat.com>
> Cc: stable@vger.kernel.org

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>   drivers/gpu/drm/radeon/evergreen.c  | 2 +-
>   drivers/gpu/drm/radeon/radeon_uvd.c | 2 ++
>   drivers/gpu/drm/radeon/rv770.c      | 2 +-
>   3 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c
> index 5623e75..8a2c010 100644
> --- a/drivers/gpu/drm/radeon/evergreen.c
> +++ b/drivers/gpu/drm/radeon/evergreen.c
> @@ -5475,9 +5475,9 @@ void evergreen_fini(struct radeon_device *rdev)
>   	radeon_wb_fini(rdev);
>   	radeon_ib_pool_fini(rdev);
>   	radeon_irq_kms_fini(rdev);
> -	evergreen_pcie_gart_fini(rdev);
>   	uvd_v1_0_fini(rdev);
>   	radeon_uvd_fini(rdev);
> +	evergreen_pcie_gart_fini(rdev);
>   	r600_vram_scratch_fini(rdev);
>   	radeon_gem_fini(rdev);
>   	radeon_fence_driver_fini(rdev);
> diff --git a/drivers/gpu/drm/radeon/radeon_uvd.c b/drivers/gpu/drm/radeon/radeon_uvd.c
> index 6781fee..3e6804b 100644
> --- a/drivers/gpu/drm/radeon/radeon_uvd.c
> +++ b/drivers/gpu/drm/radeon/radeon_uvd.c
> @@ -171,6 +171,8 @@ void radeon_uvd_fini(struct radeon_device *rdev)
>   
>   	radeon_bo_unref(&rdev->uvd.vcpu_bo);
>   
> +	radeon_ring_fini(rdev, &rdev->ring[R600_RING_TYPE_UVD_INDEX]);
> +
>   	release_firmware(rdev->uvd_fw);
>   }
>   
> diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c
> index 6c772e5..4e37a42 100644
> --- a/drivers/gpu/drm/radeon/rv770.c
> +++ b/drivers/gpu/drm/radeon/rv770.c
> @@ -1955,9 +1955,9 @@ void rv770_fini(struct radeon_device *rdev)
>   	radeon_wb_fini(rdev);
>   	radeon_ib_pool_fini(rdev);
>   	radeon_irq_kms_fini(rdev);
> -	rv770_pcie_gart_fini(rdev);
>   	uvd_v1_0_fini(rdev);
>   	radeon_uvd_fini(rdev);
> +	rv770_pcie_gart_fini(rdev);
>   	r600_vram_scratch_fini(rdev);
>   	radeon_gem_fini(rdev);
>   	radeon_fence_driver_fini(rdev);
Alex Deucher Feb. 27, 2014, 5:41 p.m. UTC | #2
Applied to my -fixes tree.  thanks!

On Wed, Feb 26, 2014 at 7:22 PM,  <j.glisse@gmail.com> wrote:
> From: Jerome Glisse <jglisse@redhat.com>
>
> Need to free the uvd ring. Also reshuffle gart tear down to
> happen after uvd tear down.
>
> Signed-off-by: Jérôme Glisse <jglisse@redhat.com>
> Cc: stable@vger.kernel.org
> ---
>  drivers/gpu/drm/radeon/evergreen.c  | 2 +-
>  drivers/gpu/drm/radeon/radeon_uvd.c | 2 ++
>  drivers/gpu/drm/radeon/rv770.c      | 2 +-
>  3 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c
> index 5623e75..8a2c010 100644
> --- a/drivers/gpu/drm/radeon/evergreen.c
> +++ b/drivers/gpu/drm/radeon/evergreen.c
> @@ -5475,9 +5475,9 @@ void evergreen_fini(struct radeon_device *rdev)
>         radeon_wb_fini(rdev);
>         radeon_ib_pool_fini(rdev);
>         radeon_irq_kms_fini(rdev);
> -       evergreen_pcie_gart_fini(rdev);
>         uvd_v1_0_fini(rdev);
>         radeon_uvd_fini(rdev);
> +       evergreen_pcie_gart_fini(rdev);
>         r600_vram_scratch_fini(rdev);
>         radeon_gem_fini(rdev);
>         radeon_fence_driver_fini(rdev);
> diff --git a/drivers/gpu/drm/radeon/radeon_uvd.c b/drivers/gpu/drm/radeon/radeon_uvd.c
> index 6781fee..3e6804b 100644
> --- a/drivers/gpu/drm/radeon/radeon_uvd.c
> +++ b/drivers/gpu/drm/radeon/radeon_uvd.c
> @@ -171,6 +171,8 @@ void radeon_uvd_fini(struct radeon_device *rdev)
>
>         radeon_bo_unref(&rdev->uvd.vcpu_bo);
>
> +       radeon_ring_fini(rdev, &rdev->ring[R600_RING_TYPE_UVD_INDEX]);
> +
>         release_firmware(rdev->uvd_fw);
>  }
>
> diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c
> index 6c772e5..4e37a42 100644
> --- a/drivers/gpu/drm/radeon/rv770.c
> +++ b/drivers/gpu/drm/radeon/rv770.c
> @@ -1955,9 +1955,9 @@ void rv770_fini(struct radeon_device *rdev)
>         radeon_wb_fini(rdev);
>         radeon_ib_pool_fini(rdev);
>         radeon_irq_kms_fini(rdev);
> -       rv770_pcie_gart_fini(rdev);
>         uvd_v1_0_fini(rdev);
>         radeon_uvd_fini(rdev);
> +       rv770_pcie_gart_fini(rdev);
>         r600_vram_scratch_fini(rdev);
>         radeon_gem_fini(rdev);
>         radeon_fence_driver_fini(rdev);
> --
> 1.8.3.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox

Patch

diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c
index 5623e75..8a2c010 100644
--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -5475,9 +5475,9 @@  void evergreen_fini(struct radeon_device *rdev)
 	radeon_wb_fini(rdev);
 	radeon_ib_pool_fini(rdev);
 	radeon_irq_kms_fini(rdev);
-	evergreen_pcie_gart_fini(rdev);
 	uvd_v1_0_fini(rdev);
 	radeon_uvd_fini(rdev);
+	evergreen_pcie_gart_fini(rdev);
 	r600_vram_scratch_fini(rdev);
 	radeon_gem_fini(rdev);
 	radeon_fence_driver_fini(rdev);
diff --git a/drivers/gpu/drm/radeon/radeon_uvd.c b/drivers/gpu/drm/radeon/radeon_uvd.c
index 6781fee..3e6804b 100644
--- a/drivers/gpu/drm/radeon/radeon_uvd.c
+++ b/drivers/gpu/drm/radeon/radeon_uvd.c
@@ -171,6 +171,8 @@  void radeon_uvd_fini(struct radeon_device *rdev)
 
 	radeon_bo_unref(&rdev->uvd.vcpu_bo);
 
+	radeon_ring_fini(rdev, &rdev->ring[R600_RING_TYPE_UVD_INDEX]);
+
 	release_firmware(rdev->uvd_fw);
 }
 
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c
index 6c772e5..4e37a42 100644
--- a/drivers/gpu/drm/radeon/rv770.c
+++ b/drivers/gpu/drm/radeon/rv770.c
@@ -1955,9 +1955,9 @@  void rv770_fini(struct radeon_device *rdev)
 	radeon_wb_fini(rdev);
 	radeon_ib_pool_fini(rdev);
 	radeon_irq_kms_fini(rdev);
-	rv770_pcie_gart_fini(rdev);
 	uvd_v1_0_fini(rdev);
 	radeon_uvd_fini(rdev);
+	rv770_pcie_gart_fini(rdev);
 	r600_vram_scratch_fini(rdev);
 	radeon_gem_fini(rdev);
 	radeon_fence_driver_fini(rdev);