Skip to contentSkip to conversation

drm/radeon/kms: clean up CS flags chunk processing

PATCH In review [email protected] 3 participants 4 messages Dec 21, 2011 – Jan 6, 2012

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

PATCH 1/1 drm/radeon/kms: clean up CS flags chunk processing

From: Alex Deucher <[email protected]>

---
 drivers/gpu/drm/radeon/radeon_cs.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
drivers/gpu/drm/radeon/radeon_cs.c +3 -4
index de3cac0..e30a36f 100644
@@ -203,10 +203,9 @@ int radeon_cs_parser_init(struct radeon_cs_parser *p, void *data)
 		}
 		if (p->chunks[i].chunk_id == RADEON_CHUNK_ID_FLAGS) {
 			p->chunk_flags_idx = i;
-		}
-		if (p->chunks[i].chunk_id == RADEON_CHUNK_ID_FLAGS &&
-		    !p->chunks[i].length_dw) {
-			return -EINVAL;
+			/* zero length flags aren't useful */
+			if (p->chunks[i].length_dw == 0)
+				return -EINVAL;
 		}
 
 		p->chunks[i].length_dw = user_chunk.length_dw;
Signature · 1 line
1.7.3.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · On Wed, Dec 21, 2011 at 3:41 PM, <[email protected]> wrote:

From: Alex Deucher <[email protected]>

Quoted 29 lines

---
 drivers/gpu/drm/radeon/radeon_cs.c |    7 +++----

 1 files changed, 3 insertions(+), 4 deletions(-)
drivers/gpu/drm/radeon/radeon_cs.c +3 -5
index de3cac0..e30a36f 100644
@@ -203,10 +203,9 @@ int radeon_cs_parser_init(struct radeon_cs_parser *p, void *data)
                }
                if (p->chunks[i].chunk_id == RADEON_CHUNK_ID_FLAGS) {
                        p->chunk_flags_idx = i;
-               }
-               if (p->chunks[i].chunk_id == RADEON_CHUNK_ID_FLAGS &&
-                   !p->chunks[i].length_dw) {
-                       return -EINVAL;
+                       /* zero length flags aren't useful */
+                       if (p->chunks[i].length_dw == 0)
+                               return -EINVAL;
                }
 
                p->chunks[i].length_dw = user_chunk.length_dw;
--

1.7.3.4

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

maintainer
#2 lore raw
In reply to [email protected]

Can you rebase this onto -next, I've no idea what it applies against.

Dave.

Quoted 26 lines

---
 drivers/gpu/drm/radeon/radeon_cs.c |    7 +++----

 1 files changed, 3 insertions(+), 4 deletions(-)
drivers/gpu/drm/radeon/radeon_cs.c +3 -5
index de3cac0..e30a36f 100644
@@ -203,10 +203,9 @@ int radeon_cs_parser_init(struct radeon_cs_parser *p, void *data)
                }
                if (p->chunks[i].chunk_id == RADEON_CHUNK_ID_FLAGS) {
                        p->chunk_flags_idx = i;
-               }
-               if (p->chunks[i].chunk_id == RADEON_CHUNK_ID_FLAGS &&
-                   !p->chunks[i].length_dw) {
-                       return -EINVAL;
+                       /* zero length flags aren't useful */
+                       if (p->chunks[i].length_dw == 0)
+                               return -EINVAL;
                }
 
                p->chunks[i].length_dw = user_chunk.length_dw;
--

1.7.3.4

#3 lore raw
Quoted 1 line · Dave Airlie

Can you rebase this onto -next, I've no idea what it applies against.

You can skip this. I just rolled it into the VM patch.

Alex

Quoted 29 lines

Dave.

Quoted 26 lines

---
 drivers/gpu/drm/radeon/radeon_cs.c |    7 +++----

 1 files changed, 3 insertions(+), 4 deletions(-)
drivers/gpu/drm/radeon/radeon_cs.c +3 -5
index de3cac0..e30a36f 100644
@@ -203,10 +203,9 @@ int radeon_cs_parser_init(struct radeon_cs_parser *p, void *data)
                }
                if (p->chunks[i].chunk_id == RADEON_CHUNK_ID_FLAGS) {
                        p->chunk_flags_idx = i;
-               }
-               if (p->chunks[i].chunk_id == RADEON_CHUNK_ID_FLAGS &&
-                   !p->chunks[i].length_dw) {
-                       return -EINVAL;
+                       /* zero length flags aren't useful */
+                       if (p->chunks[i].length_dw == 0)
+                               return -EINVAL;
                }
 
                p->chunks[i].length_dw = user_chunk.length_dw;
--

1.7.3.4