From patchwork Thu Dec 22 10:56:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9484683 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 D43CF601D3 for ; Thu, 22 Dec 2016 10:57:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CED542818E for ; Thu, 22 Dec 2016 10:57:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C3A7028324; Thu, 22 Dec 2016 10:57:00 +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 828F22818E for ; Thu, 22 Dec 2016 10:57:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 209376F213; Thu, 22 Dec 2016 10:56:58 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wj0-x243.google.com (mail-wj0-x243.google.com [IPv6:2a00:1450:400c:c01::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 330706F20D for ; Thu, 22 Dec 2016 10:56:35 +0000 (UTC) Received: by mail-wj0-x243.google.com with SMTP id j10so35718175wjb.3 for ; Thu, 22 Dec 2016 02:56:35 -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=P5fVI2fiDy1Hme3hKlNoR6EF3wW2PWitWPX74XY96wM=; b=tA68ZqhDGUW9xIdUEmKVIRfRgk8ghs3aMsdObSSeS9ye4Ukf3XwhnEfq/deeHWsemc Q6rugsbwI2O3ie5hfDo1Ee/i5k40HLjcE5pE09qgoSHFLLYKqW34Frc4yUXoOx55hFqm //npPJaKgzCGpEX7r6E+PmTLHRNZM5jfD8V6NDnpeZtP0u8Dj5HJm7LGvDk/7rQqB1jJ KYoCQnGcUsUygD+/FrtbJVe/abGFStuihvfGO7p4Byl19TfL00hLIEztqIJc5D7a+VPa ZbSsBg1pVAqReJizUad859tz0mGeO6qVAcPl5dkY1NxWamKQDJG2BvFhco04Q1zAybUt WB8w== 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=P5fVI2fiDy1Hme3hKlNoR6EF3wW2PWitWPX74XY96wM=; b=sQZiQ/p0Cd87svzx29a+FJQ6OGzE4wWUU/MgWCzsW+kO1dYiS49APjad58Azka0k84 snm2mMEmx/gLAwSt5SqG2hnR9/ab+JK4dJ1LUaZD+zQt9BMxuvGH3qy6laFsLRZ7iKuZ fM/6I7TjDvU7pgn+BWOVzxI5goQR3Guwp9bJFQz3FbG5asAJXZ6c3CStnIXH/HeQfg5s Hpu8UxKdC5u7yIqjm2EtXft3IcmHdw0kL33hoi9zOuqp+6bl6EZcmdOLN10b7SaU1F7c a3dKLdR5XI+Yc2i9LvQRSbPazagG9FP3Xz+XN4cjcuz0YMsrqevGJUErF1QaJXq337Pv jQDw== X-Gm-Message-State: AIkVDXIW45BA6G7xZxd9J1NDkutDImsDpNv/aiNTW1TTQc4qfoVp3DnxI/7AUXMlm8Lkrg== X-Received: by 10.194.20.68 with SMTP id l4mr8590678wje.49.1482404192855; Thu, 22 Dec 2016 02:56:32 -0800 (PST) Received: from haswell.alporthouse.com ([78.156.65.138]) by smtp.gmail.com with ESMTPSA id u78sm31553040wma.11.2016.12.22.02.56.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Dec 2016 02:56:32 -0800 (PST) From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Thu, 22 Dec 2016 10:56:24 +0000 Message-Id: <20161222105625.10832-4-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20161222105625.10832-1-chris@chris-wilson.co.uk> References: <20161222105625.10832-1-chris@chris-wilson.co.uk> Subject: [Intel-gfx] [PATCH 4/5] 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 a0dc8cbc2aa4..62719124840a 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -3513,7 +3513,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 c2a79eb6f40c..3d6e151e5d7a 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 2af09cc63186..9ae9aa8aea2b 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 489c14ff2cb9..934dafa9dfa1 100644 --- a/drivers/gpu/drm/i915/intel_overlay.c +++ b/drivers/gpu/drm/i915/intel_overlay.c @@ -753,8 +753,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);