[PATCH 2/3] drm/radeon: no need to check all relocs for dublicates
Paul Menzel
paulepanter at users.sourceforge.net
Wed Oct 26 01:19:43 PDT 2011
Am Dienstag, den 25.10.2011, 17:04 +0200 schrieb Christian König:
> Only check the previusly checked relocs for
previ*o*usly
> dublicates.
du*p*licates (also in commit summary)
> Also leaving the handle uninitialized isn't such a good idea.
>
> Signed-off-by: Christian König <deathsimple at vodafone.de>
> ---
> drivers/gpu/drm/radeon/radeon_cs.c | 5 +++--
> 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 fae00c0..7b6e98a 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);
> }
Thanks,
Paul
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20111026/322cd9c7/attachment.pgp>
More information about the dri-devel
mailing list