From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?Christian_K=F6nig?= Subject: Re: [PATCH] drm/radeon: track global bo name and always return the same Date: Wed, 28 Nov 2012 11:19:33 +0100 Message-ID: <50B5E535.4060906@vodafone.de> References: <1354042922-26610-1-git-send-email-j.glisse@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" Content-Transfer-Encoding: quoted-printable Return-path: Received: from outgoing.email.vodafone.de (outgoing.email.vodafone.de [139.7.28.128]) by gabe.freedesktop.org (Postfix) with ESMTP id EEE80E5F42 for ; Wed, 28 Nov 2012 02:19:39 -0800 (PST) In-Reply-To: <1354042922-26610-1-git-send-email-j.glisse@gmail.com> 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: j.glisse@gmail.com Cc: Jerome Glisse , dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On 27.11.2012 20:02, j.glisse@gmail.com wrote: > From: Jerome Glisse > > To avoid kernel rejecting cs if we return different global name > for same bo keep track of global name and always return the same. > Seems to fix issue with suspend/resume failing and repeatly printing > following message : > [drm:radeon_cs_ioctl] *ERROR* Failed to parse relocation -35! > > There might still be way for a rogue program to trigger this issue. > > Signed-off-by: Jerome Glisse Reviewed-by: Christian K=F6nig > --- > radeon/radeon_bo_gem.c | 16 +++++++++++----- > 1 file changed, 11 insertions(+), 5 deletions(-) > > diff --git a/radeon/radeon_bo_gem.c b/radeon/radeon_bo_gem.c > index 265f177..fca0aaf 100644 > --- a/radeon/radeon_bo_gem.c > +++ b/radeon/radeon_bo_gem.c > @@ -47,11 +47,11 @@ > #include "radeon_bo_gem.h" > #include > struct radeon_bo_gem { > - struct radeon_bo_int base; > - uint32_t name; > - int map_count; > - atomic_t reloc_in_cs; > - void *priv_ptr; > + struct radeon_bo_int base; > + uint32_t name; > + int map_count; > + atomic_t reloc_in_cs; > + void *priv_ptr; > }; > = > struct bo_manager_gem { > @@ -320,15 +320,21 @@ void *radeon_gem_get_reloc_in_cs(struct radeon_bo *= bo) > = > int radeon_gem_get_kernel_name(struct radeon_bo *bo, uint32_t *name) > { > + struct radeon_bo_gem *bo_gem =3D (struct radeon_bo_gem*)bo; > struct radeon_bo_int *boi =3D (struct radeon_bo_int *)bo; > struct drm_gem_flink flink; > int r; > = > + if (bo_gem->name) { > + *name =3D bo_gem->name; > + return 0; > + } > flink.handle =3D bo->handle; > r =3D drmIoctl(boi->bom->fd, DRM_IOCTL_GEM_FLINK, &flink); > if (r) { > return r; > } > + bo_gem->name =3D flink.name; > *name =3D flink.name; > return 0; > }