From patchwork Thu Jun 27 23:30:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Widawsky X-Patchwork-Id: 2796601 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BB84EBF4A1 for ; Thu, 27 Jun 2013 23:57:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DFC9720204 for ; Thu, 27 Jun 2013 23:57:26 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 1A148201FD for ; Thu, 27 Jun 2013 23:57:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F1DE3E64CD for ; Thu, 27 Jun 2013 16:57:25 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from shiva.localdomain (unknown [209.20.75.48]) by gabe.freedesktop.org (Postfix) with ESMTP id CFF39E6458 for ; Thu, 27 Jun 2013 16:28:37 -0700 (PDT) Received: by shiva.localdomain (Postfix, from userid 99) id BB8E9884FB; Thu, 27 Jun 2013 23:28:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from lundgren.jf.intel.com (jfdmzpr02-ext.jf.intel.com [134.134.137.71]) by shiva.localdomain (Postfix) with ESMTPSA id 435C5884FB; Thu, 27 Jun 2013 23:28:37 +0000 (UTC) From: Ben Widawsky To: Intel GFX Date: Thu, 27 Jun 2013 16:30:58 -0700 Message-Id: <1372375867-1003-58-git-send-email-ben@bwidawsk.net> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1372375867-1003-1-git-send-email-ben@bwidawsk.net> References: <1372375867-1003-1-git-send-email-ben@bwidawsk.net> Cc: Ben Widawsky Subject: [Intel-gfx] [PATCH 57/66] drm/i915: Disallow pin with full ppgtt X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 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+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Virus-Scanned: ClamAV using ClamSMTP Pin doesn't fit with PPGTT since the interface doesn't allow for the context for which we want to pin. Full PPGTT will bring a new "soft pin" interface. The semantics of which will probably take some time to iron out. Signed-off-by: Ben Widawsky --- drivers/gpu/drm/i915/i915_gem.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index a4db2cc..e58584b 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -3746,6 +3746,7 @@ i915_gem_object_pin(struct drm_i915_gem_object *obj, return -EBUSY; BUG_ON(map_and_fenceable && !is_i915_ggtt(vm)); + BUG_ON(!HAS_HW_CONTEXTS(obj->base.dev) && !is_i915_ggtt(vm)); if (i915_gem_obj_bound(obj, vm)) { if ((alignment && @@ -3800,6 +3801,7 @@ int i915_gem_pin_ioctl(struct drm_device *dev, void *data, struct drm_file *file) { + struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_gem_pin *args = data; struct drm_i915_gem_object *obj; int ret; @@ -3808,6 +3810,11 @@ i915_gem_pin_ioctl(struct drm_device *dev, void *data, if (ret) return ret; + if (!dev_priv->hw_contexts_disabled) { + mutex_unlock(&dev->struct_mutex); + return -ENXIO; + } + obj = to_intel_bo(drm_gem_object_lookup(dev, file, args->handle)); if (&obj->base == NULL) { ret = -ENOENT;