From patchwork Sun Oct 11 11:18:32 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 52998 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9BBJQB9003294 for ; Sun, 11 Oct 2009 11:19:26 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 86E539E941; Sun, 11 Oct 2009 04:19:25 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from orsmga101.jf.intel.com (mga06.intel.com [134.134.136.21]) by gabe.freedesktop.org (Postfix) with ESMTP id 6A4729E7DD for ; Sun, 11 Oct 2009 04:19:24 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 11 Oct 2009 04:03:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.44,541,1249282800"; d="scan'208";a="558517103" Received: from unknown (HELO localhost.localdomain) ([10.255.17.78]) by orsmga001.jf.intel.com with ESMTP; 11 Oct 2009 04:18:28 -0700 From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Sun, 11 Oct 2009 12:18:32 +0100 Message-Id: <1255259912-9765-1-git-send-email-chris@chris-wilson.co.uk> X-Mailer: git-send-email 1.6.4.3 Subject: [Intel-gfx] [PATCH] drm/i915: Warn if the buffer is not in the correct domain during a fault X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.9 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index abfc27b..0c788c6 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -1217,6 +1217,9 @@ int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf) goto unlock; } + WARN_ON((obj->read_domains & I915_GEM_DOMAIN_GTT) == 0); + WARN_ON(write && (obj->write_domain & I915_GEM_DOMAIN_GTT) == 0); + pfn = ((dev->agp->base + obj_priv->gtt_offset) >> PAGE_SHIFT) + page_offset;