From patchwork Fri Dec 23 14:58:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9487505 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9A184601D7 for ; Fri, 23 Dec 2016 14:59:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 871B023B3D for ; Fri, 23 Dec 2016 14:59:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7C24725D9E; Fri, 23 Dec 2016 14:59:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 330D523B3D for ; Fri, 23 Dec 2016 14:59:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C263F6E078; Fri, 23 Dec 2016 14:59:40 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wj0-x241.google.com (mail-wj0-x241.google.com [IPv6:2a00:1450:400c:c01::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id F2AFB6E069 for ; Fri, 23 Dec 2016 14:58:17 +0000 (UTC) Received: by mail-wj0-x241.google.com with SMTP id kp2so40575192wjc.0 for ; Fri, 23 Dec 2016 06:58:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=I45IHPisWbkVol2/FwT4HE8RyReuSE4QTQd89rqN3z4=; b=AULGBChPVusYAtd4BOekAdLgyYPocXTqRw7bS2EKQ+SXwZbXfdTddQmoDCDYE95XEb Ta4lUPNAICn8VVGyaEcvuGFz8MNa++n0f2NV3NLqcyWcuB9QWdaGZozsI7lshVTdZOpp 18CT9r8lysJ6txslvD2+lFFq7IoVwiNc1nDJVXoQ7ZPtLEjg/u5AAMqrVYWn+v2Wh1jo pPDMzEOwWoI4UGHJkOS4KuGi/G1LwiTGQPYNhPefGcNRW9TFf8DOmEK/7fefgKRBfR6G UPuS8z2Xd+Bc5SABMjKKWTuH1xnrum1n7PHMIYKsLTaPKX/WswwFKLoT3TcH8DpazIqT gVnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=I45IHPisWbkVol2/FwT4HE8RyReuSE4QTQd89rqN3z4=; b=FivU7Rk12lpdhA+3SJW93Wtql0vvWNVX09dh67i61bU+oKo1okDqXEttKUy8JQ1flP 1zQkGfCOcJxGer7JlJrr0EFFjhqwXxkn5OFt3q0UwVmJm47pNfD5p2Po1WTS0/zYapGs PF1KtOrG6aM6DPT3XqYpf2DcrN9dMrDnDsBNYzl0KZWbfSA/K2Vn6mQD4MXmkcQ39BDl 5zW0oixR+YyuUk+Loyi9mHzUJqcgqQZGrsM2QxlD2RWqTEzDjfbUe8a86xwx033R9vgM c447V7R1KaBqx4pMKcY5SdS8wvIbHZ0BytL3z3ZlQJC9UypeEK6wbfYOaeoyqiDy/QyI o/mw== X-Gm-Message-State: AIkVDXIXK9uKmFvu/nEClIdw8HE8LwrMA2hclJoUBHlgEghETeThnAazeQs+ntdJdC13+A== X-Received: by 10.195.30.165 with SMTP id kf5mr13652226wjd.41.1482505096037; Fri, 23 Dec 2016 06:58:16 -0800 (PST) Received: from haswell.alporthouse.com ([78.156.65.138]) by smtp.gmail.com with ESMTPSA id i15sm40786462wjs.16.2016.12.23.06.58.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Dec 2016 06:58:15 -0800 (PST) From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Fri, 23 Dec 2016 14:58:02 +0000 Message-Id: <20161223145804.6605-8-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20161223145804.6605-1-chris@chris-wilson.co.uk> References: <20161223145804.6605-1-chris@chris-wilson.co.uk> Subject: [Intel-gfx] [PATCH 08/10] drm/i915: Eliminate superfluous i915_ggtt_view_normal 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: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Since commit 058d88c4330f ("drm/i915: Track pinned VMA"), there is only one user of i915_ggtt_view_normal rodate. Just treat NULL as no special view in pin_to_display() like everywhere else. Signed-off-by: Chris Wilson Reviewed-by: Joonas Lahtinen --- drivers/gpu/drm/i915/i915_gem.c | 2 +- drivers/gpu/drm/i915/i915_gem_gtt.c | 4 ---- drivers/gpu/drm/i915/i915_gem_gtt.h | 2 -- drivers/gpu/drm/i915/intel_overlay.c | 3 +-- 4 files changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 1281f0fa45f6..2f1f01d2d768 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -3514,7 +3514,7 @@ i915_gem_object_pin_to_display_plane(struct drm_i915_gem_object *obj, * try to preserve the existing ABI). */ vma = ERR_PTR(-ENOSPC); - if (view->type == I915_GGTT_VIEW_NORMAL) + if (!view || view->type == I915_GGTT_VIEW_NORMAL) vma = i915_gem_object_ggtt_pin(obj, view, 0, alignment, PIN_MAPPABLE | PIN_NONBLOCK); if (IS_ERR(vma)) { diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c index f60665459802..a67746775f71 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c @@ -99,10 +99,6 @@ static int i915_get_ggtt_vma_pages(struct i915_vma *vma); -const struct i915_ggtt_view i915_ggtt_view_normal = { - .type = I915_GGTT_VIEW_NORMAL, -}; - int intel_sanitize_enable_ppgtt(struct drm_i915_private *dev_priv, int enable_ppgtt) { diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.h b/drivers/gpu/drm/i915/i915_gem_gtt.h index 513fe4db7899..d9860669082c 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.h +++ b/drivers/gpu/drm/i915/i915_gem_gtt.h @@ -167,8 +167,6 @@ struct i915_ggtt_view { }; }; -extern const struct i915_ggtt_view i915_ggtt_view_normal; - enum i915_cache_level; struct i915_vma; diff --git a/drivers/gpu/drm/i915/intel_overlay.c b/drivers/gpu/drm/i915/intel_overlay.c index 4473a611c664..0608fad7f593 100644 --- a/drivers/gpu/drm/i915/intel_overlay.c +++ b/drivers/gpu/drm/i915/intel_overlay.c @@ -811,8 +811,7 @@ static int intel_overlay_do_put_image(struct intel_overlay *overlay, if (ret != 0) return ret; - vma = i915_gem_object_pin_to_display_plane(new_bo, 0, - &i915_ggtt_view_normal); + vma = i915_gem_object_pin_to_display_plane(new_bo, 0, NULL); if (IS_ERR(vma)) return PTR_ERR(vma);