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>
This commit is contained in:
@@ -228,7 +228,7 @@ nouveau_gem_ioctl_new(struct drm_device *dev, void *data,
|
||||
struct nouveau_bo *nvbo = NULL;
|
||||
int ret = 0;
|
||||
|
||||
drm->ttm.bdev.dev_mapping = drm->dev->dev_mapping;
|
||||
drm->ttm.bdev.dev_mapping = drm->dev->anon_inode->i_mapping;
|
||||
|
||||
if (!pfb->memtype_valid(pfb, req->info.tile_flags)) {
|
||||
NV_ERROR(cli, "bad page flags: 0x%08x\n", req->info.tile_flags);
|
||||
|
Reference in New Issue
Block a user