All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/radeon: disable vce init on cayman
@ 2015-07-08 17:44 Alex Deucher
  2015-07-08 18:16 ` Christian König
  0 siblings, 1 reply; 3+ messages in thread
From: Alex Deucher @ 2015-07-08 17:44 UTC (permalink / raw)
  To: dri-devel; +Cc: Alex Deucher

Cayman does not have vce.  There were a few places in the
shared cayman/TV code where we were trying to do vce stuff.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/radeon/ni.c | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c
index 6a8afe2..2b2e177 100644
--- a/drivers/gpu/drm/radeon/ni.c
+++ b/drivers/gpu/drm/radeon/ni.c
@@ -2185,18 +2185,20 @@ static int cayman_startup(struct radeon_device *rdev)
 			DRM_ERROR("radeon: failed initializing UVD (%d).\n", r);
 	}
 
-	ring = &rdev->ring[TN_RING_TYPE_VCE1_INDEX];
-	if (ring->ring_size)
-		r = radeon_ring_init(rdev, ring, ring->ring_size, 0, 0x0);
+	if (rdev->family == CHIP_ARUBA) {
+		ring = &rdev->ring[TN_RING_TYPE_VCE1_INDEX];
+		if (ring->ring_size)
+			r = radeon_ring_init(rdev, ring, ring->ring_size, 0, 0x0);
 
-	ring = &rdev->ring[TN_RING_TYPE_VCE2_INDEX];
-	if (ring->ring_size)
-		r = radeon_ring_init(rdev, ring, ring->ring_size, 0, 0x0);
+		ring = &rdev->ring[TN_RING_TYPE_VCE2_INDEX];
+		if (ring->ring_size)
+			r = radeon_ring_init(rdev, ring, ring->ring_size, 0, 0x0);
 
-	if (!r)
-		r = vce_v1_0_init(rdev);
-	else if (r != -ENOENT)
-		DRM_ERROR("radeon: failed initializing VCE (%d).\n", r);
+		if (!r)
+			r = vce_v1_0_init(rdev);
+		else if (r != -ENOENT)
+			DRM_ERROR("radeon: failed initializing VCE (%d).\n", r);
+	}
 
 	r = radeon_ib_pool_init(rdev);
 	if (r) {
@@ -2419,7 +2421,8 @@ void cayman_fini(struct radeon_device *rdev)
 	radeon_irq_kms_fini(rdev);
 	uvd_v1_0_fini(rdev);
 	radeon_uvd_fini(rdev);
-	radeon_vce_fini(rdev);
+	if (rdev->family == CHIP_ARUBA)
+		radeon_vce_fini(rdev);
 	cayman_pcie_gart_fini(rdev);
 	r600_vram_scratch_fini(rdev);
 	radeon_gem_fini(rdev);
-- 
1.8.3.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/radeon: disable vce init on cayman
  2015-07-08 17:44 [PATCH] drm/radeon: disable vce init on cayman Alex Deucher
@ 2015-07-08 18:16 ` Christian König
  2015-07-08 19:09   ` Deucher, Alexander
  0 siblings, 1 reply; 3+ messages in thread
From: Christian König @ 2015-07-08 18:16 UTC (permalink / raw)
  To: Alex Deucher, dri-devel; +Cc: Alex Deucher

On 08.07.2015 19:44, Alex Deucher wrote:
> Cayman does not have vce.  There were a few places in the
> shared cayman/TV code where we were trying to do vce stuff.
>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

If I remember correctly that was the reason we have the "if (r != 
-ENOENT)" and "if (ring->ring_size)" checks in the code. E.g. if VCE 
isn't supported ring->ring_size is zero and vce_v1_0_init return -ENOENT.

So when we make the check implicit I think we should at least remove the 
-ENOENT check.

Regards,
Christian.

> ---
>   drivers/gpu/drm/radeon/ni.c | 25 ++++++++++++++-----------
>   1 file changed, 14 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c
> index 6a8afe2..2b2e177 100644
> --- a/drivers/gpu/drm/radeon/ni.c
> +++ b/drivers/gpu/drm/radeon/ni.c
> @@ -2185,18 +2185,20 @@ static int cayman_startup(struct radeon_device *rdev)
>   			DRM_ERROR("radeon: failed initializing UVD (%d).\n", r);
>   	}
>   
> -	ring = &rdev->ring[TN_RING_TYPE_VCE1_INDEX];
> -	if (ring->ring_size)
> -		r = radeon_ring_init(rdev, ring, ring->ring_size, 0, 0x0);
> +	if (rdev->family == CHIP_ARUBA) {
> +		ring = &rdev->ring[TN_RING_TYPE_VCE1_INDEX];
> +		if (ring->ring_size)
> +			r = radeon_ring_init(rdev, ring, ring->ring_size, 0, 0x0);
>   
> -	ring = &rdev->ring[TN_RING_TYPE_VCE2_INDEX];
> -	if (ring->ring_size)
> -		r = radeon_ring_init(rdev, ring, ring->ring_size, 0, 0x0);
> +		ring = &rdev->ring[TN_RING_TYPE_VCE2_INDEX];
> +		if (ring->ring_size)
> +			r = radeon_ring_init(rdev, ring, ring->ring_size, 0, 0x0);
>   
> -	if (!r)
> -		r = vce_v1_0_init(rdev);
> -	else if (r != -ENOENT)
> -		DRM_ERROR("radeon: failed initializing VCE (%d).\n", r);
> +		if (!r)
> +			r = vce_v1_0_init(rdev);
> +		else if (r != -ENOENT)
> +			DRM_ERROR("radeon: failed initializing VCE (%d).\n", r);
> +	}
>   
>   	r = radeon_ib_pool_init(rdev);
>   	if (r) {
> @@ -2419,7 +2421,8 @@ void cayman_fini(struct radeon_device *rdev)
>   	radeon_irq_kms_fini(rdev);
>   	uvd_v1_0_fini(rdev);
>   	radeon_uvd_fini(rdev);
> -	radeon_vce_fini(rdev);
> +	if (rdev->family == CHIP_ARUBA)
> +		radeon_vce_fini(rdev);
>   	cayman_pcie_gart_fini(rdev);
>   	r600_vram_scratch_fini(rdev);
>   	radeon_gem_fini(rdev);

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] drm/radeon: disable vce init on cayman
  2015-07-08 18:16 ` Christian König
@ 2015-07-08 19:09   ` Deucher, Alexander
  0 siblings, 0 replies; 3+ messages in thread
From: Deucher, Alexander @ 2015-07-08 19:09 UTC (permalink / raw)
  To: Christian König, Alex Deucher,
	dri-devel@lists.freedesktop.org

> -----Original Message-----
> From: Christian König [mailto:deathsimple@vodafone.de]
> Sent: Wednesday, July 08, 2015 2:17 PM
> To: Alex Deucher; dri-devel@lists.freedesktop.org
> Cc: Deucher, Alexander
> Subject: Re: [PATCH] drm/radeon: disable vce init on cayman
> 
> On 08.07.2015 19:44, Alex Deucher wrote:
> > Cayman does not have vce.  There were a few places in the
> > shared cayman/TV code where we were trying to do vce stuff.
> >
> > Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> 
> If I remember correctly that was the reason we have the "if (r !=
> -ENOENT)" and "if (ring->ring_size)" checks in the code. E.g. if VCE
> isn't supported ring->ring_size is zero and vce_v1_0_init return -ENOENT.

The problem is vce_v1_0_init() doesn't return -ENOENT.  So vce_v1_0_start() tries to run on cayman and fails leading to problems.

> 
> So when we make the check implicit I think we should at least remove the
> -ENOENT check.

I'll do that.

Alex

> 
> Regards,
> Christian.
> 
> > ---
> >   drivers/gpu/drm/radeon/ni.c | 25 ++++++++++++++-----------
> >   1 file changed, 14 insertions(+), 11 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c
> > index 6a8afe2..2b2e177 100644
> > --- a/drivers/gpu/drm/radeon/ni.c
> > +++ b/drivers/gpu/drm/radeon/ni.c
> > @@ -2185,18 +2185,20 @@ static int cayman_startup(struct radeon_device
> *rdev)
> >   			DRM_ERROR("radeon: failed initializing UVD
> (%d).\n", r);
> >   	}
> >
> > -	ring = &rdev->ring[TN_RING_TYPE_VCE1_INDEX];
> > -	if (ring->ring_size)
> > -		r = radeon_ring_init(rdev, ring, ring->ring_size, 0, 0x0);
> > +	if (rdev->family == CHIP_ARUBA) {
> > +		ring = &rdev->ring[TN_RING_TYPE_VCE1_INDEX];
> > +		if (ring->ring_size)
> > +			r = radeon_ring_init(rdev, ring, ring->ring_size, 0,
> 0x0);
> >
> > -	ring = &rdev->ring[TN_RING_TYPE_VCE2_INDEX];
> > -	if (ring->ring_size)
> > -		r = radeon_ring_init(rdev, ring, ring->ring_size, 0, 0x0);
> > +		ring = &rdev->ring[TN_RING_TYPE_VCE2_INDEX];
> > +		if (ring->ring_size)
> > +			r = radeon_ring_init(rdev, ring, ring->ring_size, 0,
> 0x0);
> >
> > -	if (!r)
> > -		r = vce_v1_0_init(rdev);
> > -	else if (r != -ENOENT)
> > -		DRM_ERROR("radeon: failed initializing VCE (%d).\n", r);
> > +		if (!r)
> > +			r = vce_v1_0_init(rdev);
> > +		else if (r != -ENOENT)
> > +			DRM_ERROR("radeon: failed initializing VCE (%d).\n",
> r);
> > +	}
> >
> >   	r = radeon_ib_pool_init(rdev);
> >   	if (r) {
> > @@ -2419,7 +2421,8 @@ void cayman_fini(struct radeon_device *rdev)
> >   	radeon_irq_kms_fini(rdev);
> >   	uvd_v1_0_fini(rdev);
> >   	radeon_uvd_fini(rdev);
> > -	radeon_vce_fini(rdev);
> > +	if (rdev->family == CHIP_ARUBA)
> > +		radeon_vce_fini(rdev);
> >   	cayman_pcie_gart_fini(rdev);
> >   	r600_vram_scratch_fini(rdev);
> >   	radeon_gem_fini(rdev);

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-07-08 19:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-08 17:44 [PATCH] drm/radeon: disable vce init on cayman Alex Deucher
2015-07-08 18:16 ` Christian König
2015-07-08 19:09   ` Deucher, Alexander

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.