summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorChristian König <deathsimple@vodafone.de>2011-10-24 14:59:17 +0200
committerDave Airlie <airlied@redhat.com>2011-12-20 20:49:08 +0100
commit16557f1ef0e14fd43b0a46b7dc89c431020ff3e2 (patch)
tree56a95f59c732c15b42c5f9ce8058a0882512b516 /drivers/gpu/drm
parentdrm/radeon: fix debugfs handling v3 (diff)
downloadlinux-16557f1ef0e14fd43b0a46b7dc89c431020ff3e2.tar.xz
linux-16557f1ef0e14fd43b0a46b7dc89c431020ff3e2.zip
drm/radeon: no need to check all relocs for duplicates
Only check the previously checked relocs for duplicates. Also leaving the handle uninitialized isn't such a good idea. Signed-off-by: Christian König <deathsimple@vodafone.de> Reviewed-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/radeon/radeon_cs.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c
index 29afd71e0840..aaacadc86ae7 100644
--- a/drivers/gpu/drm/radeon/radeon_cs.c
+++ b/drivers/gpu/drm/radeon/radeon_cs.c
@@ -58,7 +58,7 @@ int radeon_cs_parser_relocs(struct radeon_cs_parser *p)
duplicate = false;
r = (struct drm_radeon_cs_reloc *)&chunk->kdata[i*4];
- for (j = 0; j < p->nrelocs; j++) {
+ for (j = 0; j < i; j++) {
if (r->handle == p->relocs[j].handle) {
p->relocs_ptr[i] = &p->relocs[j];
duplicate = true;
@@ -84,7 +84,8 @@ int radeon_cs_parser_relocs(struct radeon_cs_parser *p)
p->relocs[i].flags = r->flags;
radeon_bo_list_add_object(&p->relocs[i].lobj,
&p->validated);
- }
+ } else
+ p->relocs[i].handle = 0;
}
return radeon_bo_list_validate(&p->validated);
}