Skip to contentSkip to conversation

drm/radeon/kms: fix r600 vbo size computation

PATCH NAK Jerome Glisse 2 participants 2 messages Aug 25, 2010 – Aug 26, 2010

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

PATCH 1/1 drm/radeon/kms: fix r600 vbo size computation

size given in resource is the exact size (not size - 1)

---
 drivers/gpu/drm/radeon/r600_cs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/gpu/drm/radeon/r600_cs.c +1 -1
index d886494..487a765 100644
@@ -1401,7 +1401,7 @@ static int r600_packet3_check(struct radeon_cs_parser *p,
 					return -EINVAL;
 				}
 				offset = radeon_get_ib_value(p, idx+1+(i*7)+0);
-				size = radeon_get_ib_value(p, idx+1+(i*7)+1) + 1;
+				size = radeon_get_ib_value(p, idx+1+(i*7)+1);
 				if (p->rdev && (size + offset) > radeon_bo_size(reloc->robj)) {
 					/* force size to size of the buffer */
 					dev_warn(p->dev, "vbo resource seems too big (%d) for the bo (%ld)\n",
Signature · 1 line
1.7.0.1
#1 lore raw
Quoted 2 lines · Jerome Glisse

size given in resource is the exact size (not size - 1)

NAK, the vtx resource size is size minus 1. See the accel code in the ddx and the code in r600 driver in mesa.

Alex

Quoted 26 lines

---
 drivers/gpu/drm/radeon/r600_cs.c |    2 +-

 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/gpu/drm/radeon/r600_cs.c +1 -2
index d886494..487a765 100644
@@ -1401,7 +1401,7 @@ static int r600_packet3_check(struct radeon_cs_parser *p,
                                        return -EINVAL;
                                }
                                offset = radeon_get_ib_value(p, idx+1+(i*7)+0);
-                               size = radeon_get_ib_value(p, idx+1+(i*7)+1) + 1;
+                               size = radeon_get_ib_value(p, idx+1+(i*7)+1);
                                if (p->rdev && (size + offset) > radeon_bo_size(reloc->robj)) {
                                        /* force size to size of the buffer */
                                        dev_warn(p->dev, "vbo resource seems too big (%d) for the bo (%ld)\n",
--

1.7.0.1

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