• Tvrtko Ursulin's avatar
    drm/i915: Track old framebuffer instead of object · ab8d6675
    Tvrtko Ursulin authored
    Daniel Vetter spotted a bug while reviewing some of my refactoring in this
    are of the code. I'll quote:
    
    """
    > @@ -9764,6 +9768,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
    >  	work->event = event;
    >  	work->crtc = crtc;
    >  	work->old_fb_obj = intel_fb_obj(old_fb);
    > +	work->old_tiling_mode = to_intel_framebuffer(old_fb)->tiling_mode;
    
    Hm, that's actually an interesting bugfix - currently userspace could be
    sneaky and destroy the old fb immediately after the flip completes and the
    change the tiling of the underlying object before the unpin work had a
    chance to run (needs some fudgin with rt prios to starve workers to make
    this work though).
    
    Imo the right fix is to hold a reference onto the fb and not the
    underlying gem object. With that tiling is guaranteed not to change.
    """
    
    This patch tries to implement the above proposed change.
    Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
    Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
    Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
    ab8d6675
intel_drv.h 42.4 KB