From patchwork Thu Jul 4 19:42:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Widawsky X-Patchwork-Id: 2823913 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 64CAEBF4A1 for ; Thu, 4 Jul 2013 19:39:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4A9A32012E for ; Thu, 4 Jul 2013 19:39:21 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 770DF20125 for ; Thu, 4 Jul 2013 19:39:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 32CC2E5FD8 for ; Thu, 4 Jul 2013 12:39:19 -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 D3B5DE5ECD for ; Thu, 4 Jul 2013 12:39:08 -0700 (PDT) Received: by shiva.localdomain (Postfix, from userid 99) id 1D8E088652; Thu, 4 Jul 2013 19:39:08 +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=-4.4 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 EDF3788167; Thu, 4 Jul 2013 19:39:06 +0000 (UTC) From: Ben Widawsky To: Intel GFX Date: Thu, 4 Jul 2013 12:42:15 -0700 Message-Id: <1372966935-18966-1-git-send-email-ben@bwidawsk.net> X-Mailer: git-send-email 1.8.3.2 Cc: Ben Widawsky Subject: [Intel-gfx] [PATCH] drm/i915: Don't use a special stolen reserve offset 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 Setting the node directly is good enough. We don't need a special value to store the gtt_offset, and we no longer have the pointer to tuck things away neatly. This is temporarily broken since: commit 7dedae28b41000539b6c18bcf72107c97e4937e4 Author: Ben Widawsky Date: Wed Jul 3 14:45:24 2013 -0700 drm/i915: Use gtt_space->start for stolen reservation However with no userspace currently, the bisection problem shouldn't be a concern. CC: Chris Wilson Reported-by: Daniel Vetter Signed-off-by: Ben Widawsky --- drivers/gpu/drm/i915/i915_drv.h | 1 - drivers/gpu/drm/i915/i915_gem_gtt.c | 1 - drivers/gpu/drm/i915/i915_gem_stolen.c | 8 ++++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index ea86ad6..b9e8ba1 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -1201,7 +1201,6 @@ enum hdmi_force_audio { HDMI_AUDIO_ON, /* force turn on HDMI audio */ }; -#define I915_GTT_RESERVED (ULONG_MAX) #define I915_GTT_OFFSET_NONE ((u32)-1) struct drm_i915_gem_object_ops { diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c index f075831..c0ca103 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c @@ -632,7 +632,6 @@ void i915_gem_setup_global_gtt(struct drm_device *dev, DRM_DEBUG_KMS("reserving preallocated space: %lx + %zx\n", i915_gem_obj_ggtt_offset(obj), obj->base.size); - BUG_ON(obj->gtt_space->start != I915_GTT_RESERVED); obj->gtt_space = drm_mm_create_block(&dev_priv->mm.gtt_space, i915_gem_obj_ggtt_offset(obj), obj->base.size, diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c index c6b70312..289d511d 100644 --- a/drivers/gpu/drm/i915/i915_gem_stolen.c +++ b/drivers/gpu/drm/i915/i915_gem_stolen.c @@ -397,8 +397,12 @@ i915_gem_object_create_stolen_for_preallocated(struct drm_device *dev, drm_gem_object_unreference(&obj->base); return NULL; } - } else - obj->gtt_space->start = I915_GTT_RESERVED; + } else { + /* Generally it isn't safe to directly set attributes of the + * drm_mm_node, however this is a special case where we'll + * promise to handle everything properly later. */ + obj->gtt_space->start = gtt_offset; + } obj->has_global_gtt_mapping = 1;