From patchwork Thu Sep 29 15:35:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 9356597 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 8CF25600C8 for ; Thu, 29 Sep 2016 15:36:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E73829B74 for ; Thu, 29 Sep 2016 15:36:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7376629B7B; Thu, 29 Sep 2016 15:36:33 +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 1D70D29B7A for ; Thu, 29 Sep 2016 15:36:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 192326E885; Thu, 29 Sep 2016 15:36:29 +0000 (UTC) X-Original-To: Intel-gfx@lists.freedesktop.org Delivered-To: Intel-gfx@lists.freedesktop.org Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id D41B36E87B for ; Thu, 29 Sep 2016 15:36:15 +0000 (UTC) Received: by mail-wm0-x243.google.com with SMTP id b4so11348185wmb.2 for ; Thu, 29 Sep 2016 08:36:15 -0700 (PDT) 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=4dhRZbdWGjhPsEinqhOjwKUw7swn3J06wZmAXypP0zE=; b=GZ/FjvajaQH/9wwJud0bzbmF12EACMpnzZotDul4hjPkVSawwZQYoc940v7cLXN0Rf GTLSfmNmcuZAM2cKQfaPMDj65gjo6wzu/Ybyl00IsbpZWfqCVyuZhcNbgf7uPPmxGEwi MPPstiHVQfSoYvU73EyFintYJhAxccvqZdijLH4+U9h6abSJNdIk0AuaX+jNRPfIlInV BwmaT+KPf7WBp+Z5+yop9Qi5MLojp3lippO022yitE0EWYF1wzfV2oDnGElgy4r6Htxg 7rCrSZi+17UsmF5AFAWkSFC0pUWl0dFIc9h/bg5DCzCu8i6wWWG11ranu7lvzKkxxTCz bmsg== 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=4dhRZbdWGjhPsEinqhOjwKUw7swn3J06wZmAXypP0zE=; b=G5zAL7oDv07mwd4KxJZEiH1aCMhQRCb3hvHMOYUQmK1MMNAxJvlXgMpv/gNvdSEEXA 1ZqOw6NMqR9BM8d3L5Lni5GSl8HAD2CQeL6x3JM87TvO/dH85zpjXUWvKeRO3eN2+/a/ pwr6o1b8BZBnb4kzTiA0Gu9HkMqeoMs8pMFjqk274QQw0Q0kzNCKIrMiYGiQ3LrHKYGD 9WyrJ1ptyt66ZVbaVAj5GVW0fO8khojvtEZfRL8s+WL6gxzv+Tz0dsRhI2yCfKPnTrlp /1U9iQPQdnfRz7k3zjnJw/H5f5DAiauhZJzE3RADAp27XLUIShB3WQCtfylWyI0OSotp pTFQ== X-Gm-Message-State: AA6/9Rksa5DztfgX/r1Drd82XvVwyVOquBOMS/eup5cMK/Psd68eqeC//whqMEOpA0hdOA== X-Received: by 10.194.119.100 with SMTP id kt4mr2079712wjb.84.1475163374470; Thu, 29 Sep 2016 08:36:14 -0700 (PDT) Received: from localhost.localdomain ([2a02:c7d:9b6d:e300:916a:6cab:ac67:71c2]) by smtp.gmail.com with ESMTPSA id s7sm14781924wjc.34.2016.09.29.08.36.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Sep 2016 08:36:14 -0700 (PDT) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: Intel-gfx@lists.freedesktop.org Date: Thu, 29 Sep 2016 16:35:52 +0100 Message-Id: <1475163356-3463-10-git-send-email-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1475163356-3463-1-git-send-email-tvrtko.ursulin@linux.intel.com> References: <1475163356-3463-1-git-send-email-tvrtko.ursulin@linux.intel.com> Subject: [Intel-gfx] [PATCH 09/13] drm/i915: Remove identical macros 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 Remove some macros which are now obviously identical. Signed-off-by: Tvrtko Ursulin Reviewed-by: Joonas Lahtinen --- drivers/gpu/drm/i915/intel_uncore.c | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c index 2197c0a43dda..a4ce3576f8d4 100644 --- a/drivers/gpu/drm/i915/intel_uncore.c +++ b/drivers/gpu/drm/i915/intel_uncore.c @@ -648,7 +648,7 @@ static const struct intel_forcewake_range __vlv_fw_ranges[] = { GEN_FW_RANGE(0x30000, 0x3ffff, FORCEWAKE_MEDIA), }; -#define __vlv_reg_read_fw_domains(offset) \ +#define __fwtable_reg_read_fw_domains(offset) \ ({ \ enum forcewake_domains __fwd = 0; \ if (NEEDS_FORCE_WAKE((offset))) \ @@ -706,14 +706,6 @@ static const struct intel_forcewake_range __chv_fw_ranges[] = { GEN_FW_RANGE(0x30000, 0x37fff, FORCEWAKE_MEDIA), }; -#define __chv_reg_read_fw_domains(offset) \ -({ \ - enum forcewake_domains __fwd = 0; \ - if (NEEDS_FORCE_WAKE((offset))) \ - __fwd = find_fw_domain(dev_priv, offset); \ - __fwd; \ -}) - #define __chv_reg_write_fw_domains(offset) \ ({ \ enum forcewake_domains __fwd = 0; \ @@ -758,14 +750,6 @@ static const struct intel_forcewake_range __gen9_fw_ranges[] = { GEN_FW_RANGE(0x30000, 0x3ffff, FORCEWAKE_MEDIA), }; -#define __gen9_reg_read_fw_domains(offset) \ -({ \ - enum forcewake_domains __fwd = 0; \ - if (NEEDS_FORCE_WAKE((offset))) \ - __fwd = find_fw_domain(dev_priv, offset); \ - __fwd; \ -}) - static const i915_reg_t gen9_shadowed_regs[] = { RING_TAIL(RENDER_RING_BASE), RING_TAIL(GEN6_BSD_RING_BASE), @@ -926,7 +910,7 @@ static u##x \ vlv_read##x(struct drm_i915_private *dev_priv, i915_reg_t reg, bool trace) { \ enum forcewake_domains fw_engine; \ GEN6_READ_HEADER(x); \ - fw_engine = __vlv_reg_read_fw_domains(offset); \ + fw_engine = __fwtable_reg_read_fw_domains(offset); \ if (fw_engine) \ __force_wake_auto(dev_priv, fw_engine); \ val = __raw_i915_read##x(dev_priv, reg); \ @@ -938,7 +922,7 @@ static u##x \ chv_read##x(struct drm_i915_private *dev_priv, i915_reg_t reg, bool trace) { \ enum forcewake_domains fw_engine; \ GEN6_READ_HEADER(x); \ - fw_engine = __chv_reg_read_fw_domains(offset); \ + fw_engine = __fwtable_reg_read_fw_domains(offset); \ if (fw_engine) \ __force_wake_auto(dev_priv, fw_engine); \ val = __raw_i915_read##x(dev_priv, reg); \ @@ -950,7 +934,7 @@ static u##x \ gen9_read##x(struct drm_i915_private *dev_priv, i915_reg_t reg, bool trace) { \ enum forcewake_domains fw_engine; \ GEN6_READ_HEADER(x); \ - fw_engine = __gen9_reg_read_fw_domains(offset); \ + fw_engine = __fwtable_reg_read_fw_domains(offset); \ if (fw_engine) \ __force_wake_auto(dev_priv, fw_engine); \ val = __raw_i915_read##x(dev_priv, reg); \ @@ -1829,18 +1813,18 @@ intel_uncore_forcewake_for_read(struct drm_i915_private *dev_priv, switch (INTEL_GEN(dev_priv)) { case 9: - fw_domains = __gen9_reg_read_fw_domains(i915_mmio_reg_offset(reg)); + fw_domains = __fwtable_reg_read_fw_domains(i915_mmio_reg_offset(reg)); break; case 8: if (IS_CHERRYVIEW(dev_priv)) - fw_domains = __chv_reg_read_fw_domains(i915_mmio_reg_offset(reg)); + fw_domains = __fwtable_reg_read_fw_domains(i915_mmio_reg_offset(reg)); else fw_domains = __gen6_reg_read_fw_domains(i915_mmio_reg_offset(reg)); break; case 7: case 6: if (IS_VALLEYVIEW(dev_priv)) - fw_domains = __vlv_reg_read_fw_domains(i915_mmio_reg_offset(reg)); + fw_domains = __fwtable_reg_read_fw_domains(i915_mmio_reg_offset(reg)); else fw_domains = __gen6_reg_read_fw_domains(i915_mmio_reg_offset(reg)); break;