From patchwork Fri May 8 11:37:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joonas Lahtinen X-Patchwork-Id: 6364731 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8F0B2BEEE1 for ; Fri, 8 May 2015 11:37:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ACCF420220 for ; Fri, 8 May 2015 11:37:46 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 1F85C20204 for ; Fri, 8 May 2015 11:37:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 262246E81F; Fri, 8 May 2015 04:37:44 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id 896236E81F for ; Fri, 8 May 2015 04:37:43 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP; 08 May 2015 04:37:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,390,1427785200"; d="scan'208";a="691906721" Received: from unknown (HELO [10.252.15.97]) ([10.252.15.97]) by orsmga001.jf.intel.com with ESMTP; 08 May 2015 04:37:41 -0700 Message-ID: <1431085059.3551.0.camel@jlahtine-mobl1> From: Joonas Lahtinen To: intel-gfx , Daniel Vetter Date: Fri, 08 May 2015 14:37:39 +0300 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Mailer: Evolution 3.10.4 (3.10.4-4.fc20) Mime-Version: 1.0 Subject: [Intel-gfx] [PATCH] drm/i915: Reject huge tiled objects X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 We do not yet support tiled objects bigger than the mappable aperture size so reject them. Reported-by: Chris Wilson Signed-off-by: Joonas Lahtinen Tested-By: Intel Graphics QA PRTS (Patch Regression Test System Contact: shuang.he@intel.com) --- drivers/gpu/drm/i915/i915_gem.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index b45f93b..6b09eff 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -1670,6 +1670,11 @@ int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf) /* Use a partial view if the object is bigger than the aperture. */ if (obj->base.size >= dev_priv->gtt.mappable_end) { + if (obj->tiling_mode != I915_TILING_NONE) { + ret = -ENOSPC; + goto unlock; + } + static const unsigned int chunk_size = 256; // 1 MiB memset(&view, 0, sizeof(view)); view.type = I915_GGTT_VIEW_PARTIAL;