From patchwork Fri Dec 23 14:58:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9487495 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 CA8EA601D7 for ; Fri, 23 Dec 2016 14:58:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD82625D9E for ; Fri, 23 Dec 2016 14:58:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B268826212; Fri, 23 Dec 2016 14:58:47 +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 4C7B325D9E for ; Fri, 23 Dec 2016 14:58:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 74E6D6E079; Fri, 23 Dec 2016 14:58:37 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id D7FE36E076 for ; Fri, 23 Dec 2016 14:58:16 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id l2so16465184wml.2 for ; Fri, 23 Dec 2016 06:58:16 -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=U3P7JO8KCqCt91Uh3KFw3A20wqIxQVyOFMnKYcqWvqc=; b=kVUFUCP3FOpbERKExpuD0WN8kJFTN60Jlf/4zD5WgU2pjDhQyUhU+bDyYS0mXsWOZD /fpT5JVVHQzCMrXJ52sKOMqlRrrlfAkXZcznSSvir5wM+0mp5DF+tRUMFolKh42+FDRC /IDAIffAJUYvt55ZIDwTQwYWt7D/9+wBKYbm4RZNit62sVjBtVDRC0Mjac7Qt/yyUHH6 Cydr0AKwOZpz/VDbwzCwft3n5p9R+l++YNHDOuPwvJYe1a7g1dn0z92VBaKX0em82kO3 QORzjU/3EyvE0biU+GVOdEBlsSHYg3CzwQg0MyTNpCA0tU3MgiY+Kao9pJByCXznvG8G GsoA== 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=U3P7JO8KCqCt91Uh3KFw3A20wqIxQVyOFMnKYcqWvqc=; b=BiHgch+YhXM4ncKBZPXTjlQDQKhvzrKGzkS9cja2JzmuoFNjaRMmBh4GIzAei1m4Vi gsBA2Kb2+yEJxQMcUhxkuF5QgCX1yK/Te2NwfHHm6PuzdmrnOcvUChcCABlm8ocTwRGj ParAvyJCNcoL23mXvEBYzP6EkpI4/F9sEXemunpj1uLJ27NMd2DhS1/SOHXzQkgjkxal dr9f0/dN0TvcVjo5eQAzAHRfPoes4nu7Luaf5C7IoYtxb5Wty28nNJJlKNixR4gaEaXW nPv4z751g8lK3Rn8ZBa3bQvcLM5uKedVA/p933x6NtGl9ctyD9n5tEHkBiofNX5thJG9 21HQ== X-Gm-Message-State: AIkVDXJiYDYDWZy7ULqtYoODtV22qbNjLTUNXhULuP6LnFToFTN+oa1XQwTnaiAZIqQLxg== X-Received: by 10.28.232.16 with SMTP id f16mr13514565wmh.103.1482505095178; Fri, 23 Dec 2016 06:58:15 -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.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Dec 2016 06:58:14 -0800 (PST) From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Fri, 23 Dec 2016 14:58:01 +0000 Message-Id: <20161223145804.6605-7-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 07/10] drm/i915: Eliminate superfluous i915_ggtt_view_rotated 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 It is only being used to clear a struct and set the type, after which it is overwritten. Since we no longer check the unset bits of the union, skipping the clear is permissible. Signed-off-by: Chris Wilson Reviewed-by: Joonas Lahtinen --- drivers/gpu/drm/i915/i915_gem_gtt.c | 3 --- drivers/gpu/drm/i915/i915_gem_gtt.h | 1 - drivers/gpu/drm/i915/intel_display.c | 5 ++--- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c index 7903a7480715..f60665459802 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c @@ -102,9 +102,6 @@ i915_get_ggtt_vma_pages(struct i915_vma *vma); const struct i915_ggtt_view i915_ggtt_view_normal = { .type = I915_GGTT_VIEW_NORMAL, }; -const struct i915_ggtt_view i915_ggtt_view_rotated = { - .type = I915_GGTT_VIEW_ROTATED, -}; 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 f3d71b6cc702..513fe4db7899 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.h +++ b/drivers/gpu/drm/i915/i915_gem_gtt.h @@ -168,7 +168,6 @@ struct i915_ggtt_view { }; extern const struct i915_ggtt_view i915_ggtt_view_normal; -extern const struct i915_ggtt_view i915_ggtt_view_rotated; enum i915_cache_level; diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 5869efea22fa..26c0947fdc6e 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -2138,11 +2138,10 @@ intel_fill_fb_ggtt_view(struct i915_ggtt_view *view, const struct drm_framebuffer *fb, unsigned int rotation) { + view->type = I915_GGTT_VIEW_NORMAL; if (drm_rotation_90_or_270(rotation)) { - *view = i915_ggtt_view_rotated; + view->type = I915_GGTT_VIEW_ROTATED; view->rotated = to_intel_framebuffer(fb)->rot_info; - } else { - *view = i915_ggtt_view_normal; } }