diff options
author | David Herrmann <dh.herrmann@gmail.com> | 2014-01-03 14:24:19 +0100 |
---|---|---|
committer | David Herrmann <dh.herrmann@gmail.com> | 2014-03-16 12:23:33 +0100 |
commit | 6796cb16c088905bf3af40548fda68c09e6f6ee5 (patch) | |
tree | d40162f17dad7b54ac63feaf62b7c84493556f5a /drivers/gpu/drm/bochs/bochs_mm.c | |
parent | 31bbe16f6d88622d6731fa2cb4ab38d57d844ac1 (diff) | |
download | talos-obmc-linux-6796cb16c088905bf3af40548fda68c09e6f6ee5.tar.gz talos-obmc-linux-6796cb16c088905bf3af40548fda68c09e6f6ee5.zip |
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/bochs/bochs_mm.c')
-rw-r--r-- | drivers/gpu/drm/bochs/bochs_mm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/bochs/bochs_mm.c b/drivers/gpu/drm/bochs/bochs_mm.c index ce6858765b37..2d8546d7b4af 100644 --- a/drivers/gpu/drm/bochs/bochs_mm.c +++ b/drivers/gpu/drm/bochs/bochs_mm.c @@ -359,7 +359,7 @@ static int bochs_bo_create(struct drm_device *dev, int size, int align, } bochsbo->bo.bdev = &bochs->ttm.bdev; - bochsbo->bo.bdev->dev_mapping = dev->dev_mapping; + bochsbo->bo.bdev->dev_mapping = dev->anon_inode->i_mapping; bochs_ttm_placement(bochsbo, TTM_PL_FLAG_VRAM | TTM_PL_FLAG_SYSTEM); |