From patchwork Wed Jun 25 00:05:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Roper X-Patchwork-Id: 4414961 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CCFE79F402 for ; Wed, 25 Jun 2014 00:05:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 022DA202E9 for ; Wed, 25 Jun 2014 00:05:00 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id AC4F72035D for ; Wed, 25 Jun 2014 00:04:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3AF596E00E; Tue, 24 Jun 2014 17:04:56 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 94F5B6E00E for ; Tue, 24 Jun 2014 17:04:54 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 24 Jun 2014 16:59:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,541,1400050800"; d="scan'208";a="562917042" Received: from mdroper-hswdev.fm.intel.com (HELO mdroper-hswdev) ([10.1.134.215]) by orsmga002.jf.intel.com with ESMTP; 24 Jun 2014 17:04:39 -0700 Received: from mattrope by mdroper-hswdev with local (Exim 4.82) (envelope-from ) id 1Wzai7-0001sh-7t; Tue, 24 Jun 2014 17:05:11 -0700 From: Matt Roper To: intel-gfx@lists.freedesktop.org Date: Tue, 24 Jun 2014 17:05:02 -0700 Message-Id: <1403654702-7199-1-git-send-email-matthew.d.roper@intel.com> X-Mailer: git-send-email 1.8.5.1 Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH] drm/i915: Don't try to look up object for non-existent fb X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP crtc->primary->fb may be NULL upon entry to intel_pipe_set_base() if the primary plane has previously been disabled via the universal plane interface. We need to check for NULL before trying to reference old_fb's obj. This fixes a regression introduced in commit a071fa00647bc9a3c53f917b236fff9aea175e3a Author: Daniel Vetter Date: Wed Jun 18 23:28:09 2014 +0200 drm/i915: Introduce accurate frontbuffer tracking Testcase: igt/kms_universal_plane Cc: Daniel Vetter Signed-off-by: Matt Roper Reviewed-by: Chris Wilson --- drivers/gpu/drm/i915/intel_display.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index fa77557..539ac3b 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -2690,6 +2690,7 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y, 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)) { @@ -2711,11 +2712,12 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y, } 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) {