From patchwork Wed Nov 16 08:55:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 9431085 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 5F2D36021C for ; Wed, 16 Nov 2016 08:56:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5022728E91 for ; Wed, 16 Nov 2016 08:56:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 450D528EA6; Wed, 16 Nov 2016 08:56:08 +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 07EC628E91 for ; Wed, 16 Nov 2016 08:56:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 83A3A6E66D; Wed, 16 Nov 2016 08:56:05 +0000 (UTC) X-Original-To: Intel-gfx@lists.freedesktop.org Delivered-To: Intel-gfx@lists.freedesktop.org Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id C377E6E661 for ; Wed, 16 Nov 2016 08:55:58 +0000 (UTC) Received: by mail-wm0-x244.google.com with SMTP id u144so8749062wmu.0 for ; Wed, 16 Nov 2016 00:55:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ursulin-net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GxjnIcgegjLfxAxSKmuJbTRy1sV4eOsyCLMjb4NZ5tk=; b=Py/JvPzmT9oIkq6BM3F4R9bCFOUHaopi+5iX8ihJR3OU1CKMTD6W38GAXAdqRDiJlK qpRda21ndgF8BJcmvQsR22pSxFSFwbx/z6zbb04XJpsAt0bkTyGQL6UeZSUpYGoLcjbi QrSv62CwCxgH1Rw45UCRoPEREMcwY4riRVjTpjsG0lNi4KWZmq0l//jkVuZneCP3OvGG Bf323W8OxUBClCTfdCIKyvl7tLIb3Ik6suHWB76fJkGNCYj1OKoPt1YcbLcF+wt0y5m3 /0c51VjiQttdpZWUkXfyTplp5Bo4jJXP+A/QN+Nu9+/Q53giWm87jiFdOs/AG/cbBx2J O5hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=GxjnIcgegjLfxAxSKmuJbTRy1sV4eOsyCLMjb4NZ5tk=; b=OFo0JLxS5sSMP62BIjNrwg5VYx2VpuNG24m32rADH8ihjAccVTe4fiFZT3re7xvP84 gZoA9cwyWH4/ysoYBqGIrwhRxguwitxog11DGEYfV4m61iVEbWtEaaknZXpPtYpmzjfx 4seNBxRpfmyxcs2U41fl5zBAy5S6asDN8zhZKOvBBa9KSPtpBEvmEP03gFzSI+vJJvcx hPT2UmIdyMkOu8WUIIzVJ5mK+h6bAEX7zFS7ylWKfo8ldclZ2/bKPCaNxi1H4qlPNknx qAkCZIYwU3N+X5cbJ3usZnixWitiUOc7A8UUoL5VLv+xf0fzFOTPfEmcc9zUTPwHlfgp 4TlA== X-Gm-Message-State: ABUngvdJMv2Mjeducs5p239hNQAxWr5C0cmgSC6yBFGoSBaGpKzHsmgH9jEj7mW4/9sMgw== X-Received: by 10.28.91.143 with SMTP id p137mr8878919wmb.51.1479286556971; Wed, 16 Nov 2016 00:55:56 -0800 (PST) Received: from t460p.intel ([2a02:c7d:9bd6:b000:f37e:1e07:a7d8:46cd]) by smtp.gmail.com with ESMTPSA id l187sm8885201wml.6.2016.11.16.00.55.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Nov 2016 00:55:56 -0800 (PST) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: Intel-gfx@lists.freedesktop.org Date: Wed, 16 Nov 2016 08:55:36 +0000 Message-Id: <1479286545-15020-7-git-send-email-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1479286545-15020-1-git-send-email-tvrtko.ursulin@linux.intel.com> References: <1479286545-15020-1-git-send-email-tvrtko.ursulin@linux.intel.com> Subject: [Intel-gfx] [PATCH 06/15] drm/i915: dev_priv cleanup in i915_gem_tiling.c 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 From: Tvrtko Ursulin And a little bit of cascaded function prototype changes. Signed-off-by: Tvrtko Ursulin --- drivers/gpu/drm/i915/i915_gem_tiling.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem_tiling.c b/drivers/gpu/drm/i915/i915_gem_tiling.c index 251d51b01174..c85e7b06bdba 100644 --- a/drivers/gpu/drm/i915/i915_gem_tiling.c +++ b/drivers/gpu/drm/i915/i915_gem_tiling.c @@ -60,9 +60,9 @@ /* Check pitch constriants for all chips & tiling formats */ static bool -i915_tiling_ok(struct drm_device *dev, int stride, int size, int tiling_mode) +i915_tiling_ok(struct drm_i915_private *dev_priv, + int stride, int size, int tiling_mode) { - struct drm_i915_private *dev_priv = to_i915(dev); int tile_width; /* Linear is always fine */ @@ -81,10 +81,10 @@ i915_tiling_ok(struct drm_device *dev, int stride, int size, int tiling_mode) /* check maximum stride & object size */ /* i965+ stores the end address of the gtt mapping in the fence * reg, so dont bother to check the size */ - if (INTEL_INFO(dev)->gen >= 7) { + if (INTEL_GEN(dev_priv) >= 7) { if (stride / 128 > GEN7_FENCE_MAX_PITCH_VAL) return false; - } else if (INTEL_INFO(dev)->gen >= 4) { + } else if (INTEL_GEN(dev_priv) >= 4) { if (stride / 128 > I965_FENCE_MAX_PITCH_VAL) return false; } else { @@ -104,7 +104,7 @@ i915_tiling_ok(struct drm_device *dev, int stride, int size, int tiling_mode) return false; /* 965+ just needs multiples of tile width */ - if (INTEL_INFO(dev)->gen >= 4) { + if (INTEL_GEN(dev_priv) >= 4) { if (stride & (tile_width - 1)) return false; return true; @@ -199,7 +199,7 @@ i915_gem_set_tiling(struct drm_device *dev, void *data, if (!obj) return -ENOENT; - if (!i915_tiling_ok(dev, + if (!i915_tiling_ok(dev_priv, args->stride, obj->base.size, args->tiling_mode)) { i915_gem_object_put(obj); return -EINVAL;