diff options
author | David Herrmann <dh.herrmann@gmail.com> | 2014-01-03 08:24:19 -0500 |
---|---|---|
committer | David Herrmann <dh.herrmann@gmail.com> | 2014-03-16 07:23:33 -0400 |
commit | 6796cb16c088905bf3af40548fda68c09e6f6ee5 (patch) | |
tree | d40162f17dad7b54ac63feaf62b7c84493556f5a /drivers/gpu/drm/radeon/radeon_ttm.c | |
parent | 31bbe16f6d88622d6731fa2cb4ab38d57d844ac1 (diff) |
drm: use anon-inode instead of relying on cdevs
DRM drivers share a common address_space across all character-devices of a
single DRM device. This allows simple buffer eviction and mapping-control.
However, DRM core currently waits for the first ->open() on any char-dev
to mark the underlying inode as backing inode of the device. This delayed
initialization causes ugly conditions all over the place:
if (dev->dev_mapping)
do_sth();
To avoid delayed initialization and to stop reusing the inode of the
char-dev, we allocate an anonymous inode for each DRM device and reset
filp->f_mapping to it on ->open().
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_ttm.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_ttm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c index 60dfce889ecf..4663fbcfda28 100644 --- a/drivers/gpu/drm/radeon/radeon_ttm.c +++ b/drivers/gpu/drm/radeon/radeon_ttm.c | |||
@@ -745,7 +745,7 @@ int radeon_ttm_init(struct radeon_device *rdev) | |||
745 | } | 745 | } |
746 | DRM_INFO("radeon: %uM of GTT memory ready.\n", | 746 | DRM_INFO("radeon: %uM of GTT memory ready.\n", |
747 | (unsigned)(rdev->mc.gtt_size / (1024 * 1024))); | 747 | (unsigned)(rdev->mc.gtt_size / (1024 * 1024))); |
748 | rdev->mman.bdev.dev_mapping = rdev->ddev->dev_mapping; | 748 | rdev->mman.bdev.dev_mapping = rdev->ddev->anon_inode->i_mapping; |
749 | 749 | ||
750 | r = radeon_ttm_debugfs_init(rdev); | 750 | r = radeon_ttm_debugfs_init(rdev); |
751 | if (r) { | 751 | if (r) { |