From: "Christian König" <deathsimple@vodafone.de>
To: j.glisse@gmail.com
Cc: Jerome Glisse <jglisse@redhat.com>, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/radeon: track global bo name and always return the same
Date: Wed, 28 Nov 2012 11:19:33 +0100 [thread overview]
Message-ID: <50B5E535.4060906@vodafone.de> (raw)
In-Reply-To: <1354042922-26610-1-git-send-email-j.glisse@gmail.com>
On 27.11.2012 20:02, j.glisse@gmail.com wrote:
> From: Jerome Glisse <jglisse@redhat.com>
>
> 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 <jglisse@redhat.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
> ---
> 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 <fcntl.h>
> 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 = (struct radeon_bo_gem*)bo;
> struct radeon_bo_int *boi = (struct radeon_bo_int *)bo;
> struct drm_gem_flink flink;
> int r;
>
> + if (bo_gem->name) {
> + *name = bo_gem->name;
> + return 0;
> + }
> flink.handle = bo->handle;
> r = drmIoctl(boi->bom->fd, DRM_IOCTL_GEM_FLINK, &flink);
> if (r) {
> return r;
> }
> + bo_gem->name = flink.name;
> *name = flink.name;
> return 0;
> }
prev parent reply other threads:[~2012-11-28 10:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-27 19:02 [PATCH] drm/radeon: track global bo name and always return the same j.glisse
2012-11-28 10:19 ` Christian König [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50B5E535.4060906@vodafone.de \
--to=deathsimple@vodafone.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=j.glisse@gmail.com \
--cc=jglisse@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.