From patchwork Fri Oct 7 13:34:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 9366105 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 2295260487 for ; Fri, 7 Oct 2016 13:34:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 13B14295AA for ; Fri, 7 Oct 2016 13:34:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 08B4F295F8; Fri, 7 Oct 2016 13:34:35 +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 A0C1C295AA for ; Fri, 7 Oct 2016 13:34:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BCD766EB9E; Fri, 7 Oct 2016 13:34:31 +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 479C66EB9A for ; Fri, 7 Oct 2016 13:34:29 +0000 (UTC) Received: by mail-wm0-x243.google.com with SMTP id b201so3031922wmb.1 for ; Fri, 07 Oct 2016 06:34:29 -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=nhIH8Qk6JOIhZ3ki3hDP8aYgh/oDGQ2c+cSQUWRfBMo=; b=S0x3nhjbrvwyyKB4o6qJxJHMCaxImfrOX8tdGS4z+CDgabXpae5eSTIR0E2Wh18+za Zx61ucxHBhWYxccYpiHTsaSTxogl1O9oSwr57U2x4UZ181cbTg7lywmdj+hFy//xHf8t wc0yOgWIFCgljkp15kcZGOdXcn0kh9DNsoj3cG67clFeKAWaZIDQU9qjL1AhLOy9zntR PHLfhga3rr2jQ8TNvsEMKKy+dV7UjyMHWSNbQ8jJE3ZodwpevCeffIQ9Qtwrvq5orRpk A9X3UF5rNrbxjJqNBDbrOWcaLQhvmKVbZCigPflyLcFqAiEZvzfPMvkS6mpvdsV7dujJ Pfgg== 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=nhIH8Qk6JOIhZ3ki3hDP8aYgh/oDGQ2c+cSQUWRfBMo=; b=bh0Gc+pMD2zFiwbicJAfU1g9vcFUuZcOzilLsHqWnETT43rEpzvl8jFUK0O5NyCYfe Vc9GUYutfbRzl6Oq5W4p8fA6WACgfv1ayIuTGtKr/qWq5J6mlnpgUv4zS9farhez9Lhi E3vZc660qsj5z6X5zJif+uJXH0exDdqRwPUlwfr9ENYU7Bs8YaRW1tj0+oyxOyfP7To4 QRLu59DvdHnrmTA94C+b5eQirGyBoVZFe6HXBTWvVBc19VZ3OQbmX/RBJy9JxiKDurya oeL8+UVIfa/O7ssFQJz6y6OzJgSyIPZamNToOUns4ZWKPsTGQG4R0ES7n4l/As348P/a aE+w== X-Gm-Message-State: AA6/9RknjBiJ7uqMQFUYCQgiI6/7/a2XF2F087vMJn5z65ZjWHrpeXiQe0JMYnUgxz+X/A== X-Received: by 10.194.184.39 with SMTP id er7mr16996751wjc.159.1475847267594; Fri, 07 Oct 2016 06:34:27 -0700 (PDT) Received: from localhost.localdomain ([2a02:c7d:9b6d:e300:916a:6cab:ac67:71c2]) by smtp.gmail.com with ESMTPSA id pj2sm19795081wjb.8.2016.10.07.06.34.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Oct 2016 06:34:27 -0700 (PDT) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: Intel-gfx@lists.freedesktop.org Date: Fri, 7 Oct 2016 14:34:10 +0100 Message-Id: <1475847252-31580-8-git-send-email-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1475847252-31580-1-git-send-email-tvrtko.ursulin@linux.intel.com> References: <1475847252-31580-1-git-send-email-tvrtko.ursulin@linux.intel.com> Subject: [Intel-gfx] [PATCH 7/9] drm/i915: Convert get_fifo_size return from int to unsigned int 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 Unsigned is a more appropriate data type in this case. Signed-off-by: Tvrtko Ursulin Reviewed-by: Joonas Lahtinen --- drivers/gpu/drm/i915/i915_drv.h | 2 +- drivers/gpu/drm/i915/intel_pm.c | 36 ++++++++++++++++++------------------ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index a219a3534750..59a2a9598c4b 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -492,7 +492,7 @@ struct dpll; struct drm_i915_display_funcs { int (*get_display_clock_speed)(struct drm_device *dev); - int (*get_fifo_size)(struct drm_device *dev, int plane); + unsigned int (*get_fifo_size)(struct drm_device *dev, int plane); int (*compute_pipe_wm)(struct intel_crtc_state *cstate); int (*compute_intermediate_wm)(struct drm_device *dev, struct intel_crtc *intel_crtc, diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index 56726777b4d3..faa379e54322 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c @@ -377,11 +377,11 @@ static const unsigned int pessimal_latency_ns = 5000; #define VLV_FIFO_START(dsparb, dsparb2, lo_shift, hi_shift) \ ((((dsparb) >> (lo_shift)) & 0xff) | ((((dsparb2) >> (hi_shift)) & 0x1) << 8)) -static int vlv_get_fifo_size(struct drm_device *dev, - enum pipe pipe, int plane) +static unsigned int vlv_get_fifo_size(struct drm_device *dev, + enum pipe pipe, int plane) { struct drm_i915_private *dev_priv = to_i915(dev); - int sprite0_start, sprite1_start, size; + unsigned int sprite0_start, sprite1_start, size; switch (pipe) { uint32_t dsparb, dsparb2, dsparb3; @@ -421,7 +421,7 @@ static int vlv_get_fifo_size(struct drm_device *dev, return 0; } - DRM_DEBUG_KMS("Pipe %c %s %c FIFO size: %d\n", + DRM_DEBUG_KMS("Pipe %c %s %c FIFO size: %u\n", pipe_name(pipe), plane == 0 ? "primary" : "sprite", plane == 0 ? plane_name(pipe) : sprite_name(pipe, plane - 1), size); @@ -429,49 +429,49 @@ static int vlv_get_fifo_size(struct drm_device *dev, return size; } -static int i9xx_get_fifo_size(struct drm_device *dev, int plane) +static unsigned int i9xx_get_fifo_size(struct drm_device *dev, int plane) { struct drm_i915_private *dev_priv = to_i915(dev); - uint32_t dsparb = I915_READ(DSPARB); - int size; + u32 dsparb = I915_READ(DSPARB); + unsigned int size; size = dsparb & 0x7f; if (plane) size = ((dsparb >> DSPARB_CSTART_SHIFT) & 0x7f) - size; - DRM_DEBUG_KMS("FIFO size - (0x%08x) %s: %d\n", dsparb, + DRM_DEBUG_KMS("FIFO size - (0x%08x) %s: %u\n", dsparb, plane ? "B" : "A", size); return size; } -static int i830_get_fifo_size(struct drm_device *dev, int plane) +static unsigned int i830_get_fifo_size(struct drm_device *dev, int plane) { struct drm_i915_private *dev_priv = to_i915(dev); - uint32_t dsparb = I915_READ(DSPARB); - int size; + u32 dsparb = I915_READ(DSPARB); + unsigned int size; size = dsparb & 0x1ff; if (plane) size = ((dsparb >> DSPARB_BEND_SHIFT) & 0x1ff) - size; size >>= 1; /* Convert to cachelines */ - DRM_DEBUG_KMS("FIFO size - (0x%08x) %s: %d\n", dsparb, + DRM_DEBUG_KMS("FIFO size - (0x%08x) %s: %u\n", dsparb, plane ? "B" : "A", size); return size; } -static int i845_get_fifo_size(struct drm_device *dev, int plane) +static unsigned int i845_get_fifo_size(struct drm_device *dev, int plane) { struct drm_i915_private *dev_priv = to_i915(dev); - uint32_t dsparb = I915_READ(DSPARB); - int size; + u32 dsparb = I915_READ(DSPARB); + unsigned int size; size = dsparb & 0x7f; size >>= 2; /* Convert to cachelines */ - DRM_DEBUG_KMS("FIFO size - (0x%08x) %s: %d\n", dsparb, + DRM_DEBUG_KMS("FIFO size - (0x%08x) %s: %u\n", dsparb, plane ? "B" : "A", size); @@ -584,7 +584,7 @@ static const struct intel_watermark_params i845_wm_info = { */ static unsigned long intel_calculate_wm(unsigned int clock_in_khz, const struct intel_watermark_params *wm, - int fifo_size, int cpp, + unsigned int fifo_size, int cpp, unsigned int latency_ns) { long entries_required, wm_size; @@ -1522,7 +1522,7 @@ static void i9xx_update_wm(struct drm_crtc *unused_crtc) uint32_t fwater_lo; uint32_t fwater_hi; int cwm, srwm = 1; - int fifo_size; + unsigned int fifo_size; int planea_wm, planeb_wm; struct drm_crtc *crtc, *enabled = NULL;