Skip to contentSkip to conversation

drm/radeon/cs: return an error if no uvd support

PATCH In review Alex Deucher 3 participants 3 messages Mar 5, 2014 – Mar 6, 2014

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

PATCH 1/1 drm/radeon/cs: return an error if no uvd support

When selecting the engine, return an error if the GPU doesn't have UVD.

---
 drivers/gpu/drm/radeon/radeon_cs.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/radeon/radeon_cs.c +4 -1
index dfb5a1d..fa7839b 100644
@@ -145,7 +145,10 @@ static int radeon_cs_get_ring(struct radeon_cs_parser *p, u32 ring, s32 priority
 		}
 		break;
 	case RADEON_CS_RING_UVD:
-		p->ring = R600_RING_TYPE_UVD_INDEX;
+		if (p->rdev->has_uvd)
+			p->ring = R600_RING_TYPE_UVD_INDEX;
+		else
+			return -EINVAL;
 		break;
 	}
 	return 0;
Signature · 1 line
1.8.3.1
#1 lore raw

Am 05.03.2014 23:03, schrieb Alex Deucher:

Quoted 2 lines

When selecting the engine, return an error if the GPU doesn't have UVD.

Why exactly is that needed? If UVD isn't present the ring should be active, so we should fail the same way just a little bit later. Additional to that userspace should check before submitting a job if UVD is available or not.

Christian.

Quoted 23 lines
---
  drivers/gpu/drm/radeon/radeon_cs.c | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/radeon/radeon_cs.c +4 -1
index dfb5a1d..fa7839b 100644
@@ -145,7 +145,10 @@ static int radeon_cs_get_ring(struct radeon_cs_parser *p, u32 ring, s32 priority
  		}
  		break;
  	case RADEON_CS_RING_UVD:
-		p->ring = R600_RING_TYPE_UVD_INDEX;
+		if (p->rdev->has_uvd)
+			p->ring = R600_RING_TYPE_UVD_INDEX;
+		else
+			return -EINVAL;
  		break;
  	}
  	return 0;
#2 lore raw
Quoted 7 lines

-----Original Message-----
From: Christian König [mailto:[email protected]]
Sent: Thursday, March 06, 2014 3:56 AM
To: Alex Deucher; [email protected]
Cc: Deucher, Alexander; [email protected]
Subject: Re: [PATCH] drm/radeon/cs: return an error if no uvd support

Quoted 8 lines

Am 05.03.2014 23:03, schrieb Alex Deucher:

Quoted 2 lines

When selecting the engine, return an error if the GPU doesn't have UVD.

Why exactly is that needed? If UVD isn't present the ring should be active, so we should fail the same way just a little bit later. Additional to that userspace should check before submitting a job if UVD is available or not.

It's just an additional check. It's not required.

Alex

Quoted 29 lines

Christian.

Review

Quoted 8 lines
---
  drivers/gpu/drm/radeon/radeon_cs.c | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/radeon/radeon_cs.c

drivers/gpu/drm/radeon/radeon_cs.c static int radeon_cs_get_ring(struct

Quoted 4 lines

index dfb5a1d..fa7839b 100644

drivers/gpu/drm/radeon/radeon_cs.c +0 -0
@@ -145,7 +145,10 @@ static int radeon_cs_get_ring(struct

radeon_cs_parser *p, u32 ring, s32 priority

Quoted 11 lines
drivers/gpu/drm/radeon/radeon_cs.c +4 -1
  		}
  		break;
  	case RADEON_CS_RING_UVD:
-		p->ring = R600_RING_TYPE_UVD_INDEX;
+		if (p->rdev->has_uvd)
+			p->ring = R600_RING_TYPE_UVD_INDEX;
+		else
+			return -EINVAL;
  		break;
  	}
  	return 0;