enum pipe pipe = intel_crtc->pipe;
struct drm_framebuffer *old_fb;
struct drm_i915_gem_object *obj = to_intel_framebuffer(fb)->obj;
+ struct drm_i915_gem_object *old_obj;
int ret;
if (intel_crtc_has_pending_flip(crtc)) {
}
old_fb = crtc->primary->fb;
+ old_obj = old_fb ? to_intel_framebuffer(old_fb)->obj : NULL;
mutex_lock(&dev->struct_mutex);
ret = intel_pin_and_fence_fb_obj(dev, obj, NULL);
if (ret == 0)
- i915_gem_track_fb(to_intel_framebuffer(old_fb)->obj, obj,
+ i915_gem_track_fb(old_obj, obj,
INTEL_FRONTBUFFER_PRIMARY(pipe));
mutex_unlock(&dev->struct_mutex);
if (ret != 0) {