From: Paul Menzel Subject: Re: [PATCH 2/3] drm/radeon: no need to check all relocs for dublicates Date: Wed, 26 Oct 2011 10:19:43 +0200 Message-ID: <1319617183.3784.2.camel@mattotaupa> References: <1319555075-9862-1-git-send-email-deathsimple@vodafone.de> <1319555075-9862-2-git-send-email-deathsimple@vodafone.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1166929900==" Return-path: Received: from mail.gw90.de (mail.gw90.de [188.40.100.199]) by gabe.freedesktop.org (Postfix) with ESMTP id 42B149F02F for ; Wed, 26 Oct 2011 01:19:52 -0700 (PDT) In-Reply-To: <1319555075-9862-2-git-send-email-deathsimple@vodafone.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: dri-devel@lists.freedesktop.org Cc: Christian =?ISO-8859-1?Q?K=F6nig?= List-Id: dri-devel@lists.freedesktop.org --===============1166929900== Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-EeJW69RMD3Y43TzqHTfS" --=-EeJW69RMD3Y43TzqHTfS Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Am Dienstag, den 25.10.2011, 17:04 +0200 schrieb Christian K=C3=B6nig: > 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. >=20 > Signed-off-by: Christian K=C3=B6nig > --- > drivers/gpu/drm/radeon/radeon_cs.c | 5 +++-- > 1 files changed, 3 insertions(+), 2 deletions(-) >=20 > 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) > =20 > duplicate =3D false; > r =3D (struct drm_radeon_cs_reloc *)&chunk->kdata[i*4]; > - for (j =3D 0; j < p->nrelocs; j++) { > + for (j =3D 0; j < i; j++) { > if (r->handle =3D=3D p->relocs[j].handle) { > p->relocs_ptr[i] =3D &p->relocs[j]; > duplicate =3D true; > @@ -84,7 +84,8 @@ int radeon_cs_parser_relocs(struct radeon_cs_parser *p) > p->relocs[i].flags =3D r->flags; > radeon_bo_list_add_object(&p->relocs[i].lobj, > &p->validated); > - } > + } else > + p->relocs[i].handle =3D 0; > } > return radeon_bo_list_validate(&p->validated); > } Thanks, Paul --=-EeJW69RMD3Y43TzqHTfS Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEABECAAYFAk6nwp8ACgkQPX1aK2wOHVgSFgCeLKofT5tMzX8IsrUlUPaLONyt bPwAnRokjeem4K50C5tZ1Q9ny6eHVGjq =ZkxA -----END PGP SIGNATURE----- --=-EeJW69RMD3Y43TzqHTfS-- --===============1166929900== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel --===============1166929900==--