• Chris Wilson's avatar
    drm/i915: Demidlayer driver loading · 8f460e2c
    Chris Wilson authored
    Take control over allocating, loading and registering the driver from the
    DRM midlayer by performing it manually from i915_pci_probe. This allows
    us to carefully control the order of when we setup the hardware vs when
    it becomes visible to third parties (including userspace). The current
    ordering makes the driver visible to userspace first (in order to
    coordinate with removed DRI1 userspace), but that ordering incurs risk.
    The risk increases as we strive for more asynchronous loading.
    
    One side effect of controlling the allocation is that we can allocate
    both the drm_device + drm_i915_private in one block, the next step
    towards subclassing.
    
    Unload is still left as before, a mix of midlayer and driver.
    
    v2: After drm_dev_init(), we should call drm_dev_unref() so that we call
    drm_dev_release() and free everything from drm_dev_init().
    v3: Fixup missed error code for failing to allocate dev_priv
    Suggested-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
    Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
    Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
    Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
    Link: http://patchwork.freedesktop.org/patch/msgid/1466773227-7994-6-git-send-email-chris@chris-wilson.co.uk
    8f460e2c
i915_drv.c 51 KB