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>
Showing
- drivers/gpu/drm/ast/ast_ttm.c 1 addition, 1 deletiondrivers/gpu/drm/ast/ast_ttm.c
- drivers/gpu/drm/bochs/bochs_mm.c 1 addition, 1 deletiondrivers/gpu/drm/bochs/bochs_mm.c
- drivers/gpu/drm/cirrus/cirrus_ttm.c 1 addition, 1 deletiondrivers/gpu/drm/cirrus/cirrus_ttm.c
- drivers/gpu/drm/drm_fops.c 3 additions, 22 deletionsdrivers/gpu/drm/drm_fops.c
- drivers/gpu/drm/drm_stub.c 11 additions, 1 deletiondrivers/gpu/drm/drm_stub.c
- drivers/gpu/drm/i915/i915_gem.c 2 additions, 1 deletiondrivers/gpu/drm/i915/i915_gem.c
- drivers/gpu/drm/mgag200/mgag200_ttm.c 1 addition, 1 deletiondrivers/gpu/drm/mgag200/mgag200_ttm.c
- drivers/gpu/drm/nouveau/nouveau_gem.c 1 addition, 1 deletiondrivers/gpu/drm/nouveau/nouveau_gem.c
- drivers/gpu/drm/omapdrm/omap_gem.c 17 additions, 17 deletionsdrivers/gpu/drm/omapdrm/omap_gem.c
- drivers/gpu/drm/qxl/qxl_object.c 1 addition, 2 deletionsdrivers/gpu/drm/qxl/qxl_object.c
- drivers/gpu/drm/qxl/qxl_ttm.c 1 addition, 2 deletionsdrivers/gpu/drm/qxl/qxl_ttm.c
- drivers/gpu/drm/radeon/radeon_object.c 1 addition, 1 deletiondrivers/gpu/drm/radeon/radeon_object.c
- drivers/gpu/drm/radeon/radeon_ttm.c 1 addition, 1 deletiondrivers/gpu/drm/radeon/radeon_ttm.c
- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c 1 addition, 1 deletiondrivers/gpu/drm/vmwgfx/vmwgfx_drv.c
- include/drm/drmP.h 1 addition, 1 deletioninclude/drm/drmP.h
Loading
Please register or sign in to comment