aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJerome Glisse2012-11-27 12:59:11 -0600
committerJerome Glisse2012-11-28 09:41:26 -0600
commit0980633afd9c7eecc0c75ef3bea4d3c6b7aa1898 (patch)
tree58c24fd2ae441ab1fc4f76083288d8c077862044
parent171666e4b8127c17c68ea0d44cf4e81ec342f2d0 (diff)
downloadlibdrm-0980633afd9c7eecc0c75ef3bea4d3c6b7aa1898.tar.gz
libdrm-0980633afd9c7eecc0c75ef3bea4d3c6b7aa1898.tar.xz
libdrm-0980633afd9c7eecc0c75ef3bea4d3c6b7aa1898.zip
drm/radeon: track global bo name and always return the same
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>
-rw-r--r--radeon/radeon_bo_gem.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/radeon/radeon_bo_gem.c b/radeon/radeon_bo_gem.c
index 265f1777..fca0aaf0 100644
--- a/radeon/radeon_bo_gem.c
+++ b/radeon/radeon_bo_gem.c
@@ -47,11 +47,11 @@
47#include "radeon_bo_gem.h" 47#include "radeon_bo_gem.h"
48#include <fcntl.h> 48#include <fcntl.h>
49struct radeon_bo_gem { 49struct radeon_bo_gem {
50 struct radeon_bo_int base; 50 struct radeon_bo_int base;
51 uint32_t name; 51 uint32_t name;
52 int map_count; 52 int map_count;
53 atomic_t reloc_in_cs; 53 atomic_t reloc_in_cs;
54 void *priv_ptr; 54 void *priv_ptr;
55}; 55};
56 56
57struct bo_manager_gem { 57struct bo_manager_gem {
@@ -320,15 +320,21 @@ void *radeon_gem_get_reloc_in_cs(struct radeon_bo *bo)
320 320
321int radeon_gem_get_kernel_name(struct radeon_bo *bo, uint32_t *name) 321int radeon_gem_get_kernel_name(struct radeon_bo *bo, uint32_t *name)
322{ 322{
323 struct radeon_bo_gem *bo_gem = (struct radeon_bo_gem*)bo;
323 struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; 324 struct radeon_bo_int *boi = (struct radeon_bo_int *)bo;
324 struct drm_gem_flink flink; 325 struct drm_gem_flink flink;
325 int r; 326 int r;
326 327
328 if (bo_gem->name) {
329 *name = bo_gem->name;
330 return 0;
331 }
327 flink.handle = bo->handle; 332 flink.handle = bo->handle;
328 r = drmIoctl(boi->bom->fd, DRM_IOCTL_GEM_FLINK, &flink); 333 r = drmIoctl(boi->bom->fd, DRM_IOCTL_GEM_FLINK, &flink);
329 if (r) { 334 if (r) {
330 return r; 335 return r;
331 } 336 }
337 bo_gem->name = flink.name;
332 *name = flink.name; 338 *name = flink.name;
333 return 0; 339 return 0;
334} 340}