From patchwork Fri May 8 14:47:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lespiau, Damien" X-Patchwork-Id: 6366011 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 51705BEEE1 for ; Fri, 8 May 2015 14:47:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8F9A220219 for ; Fri, 8 May 2015 14:47:25 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id B3C7C201EF for ; Fri, 8 May 2015 14:47:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F395D6E955; Fri, 8 May 2015 07:47:23 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTP id 930E16E955 for ; Fri, 8 May 2015 07:47:22 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP; 08 May 2015 07:47:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,391,1427785200"; d="scan'208";a="725999733" Received: from arielfel-mobl1.ger.corp.intel.com (HELO strange.ger.corp.intel.com) ([10.252.15.62]) by orsmga002.jf.intel.com with ESMTP; 08 May 2015 07:47:20 -0700 From: Damien Lespiau To: intel-gfx@lists.freedesktop.org Date: Fri, 8 May 2015 15:47:19 +0100 Message-Id: <1431096439-18701-1-git-send-email-damien.lespiau@intel.com> X-Mailer: git-send-email 2.1.0 Subject: [Intel-gfx] [PATCH] drm/i915/skl: Fix a stale comment in the DDB allocation code 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-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 'available' was the name for a variable in the previous version of that code. Also add the reason why being < alloc_size is important: it's because the result will indeed fit into plane_blocks. Signed-off-by: Damien Lespiau Tested-By: Intel Graphics QA PRTS (Patch Regression Test System Contact: shuang.he@intel.com) --- drivers/gpu/drm/i915/intel_pm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index a7516ed..e7f72e0 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c @@ -2735,7 +2735,8 @@ skl_allocate_pipe_ddb(struct drm_crtc *crtc, /* * promote the expression to 64 bits to avoid overflowing, the - * result is < available as data_rate / total_data_rate < 1 + * result is < alloc_size as data_rate / total_data_rate < 1 + * and so fits into plane_blocks (a uint16_t). */ plane_blocks = minimum[plane]; plane_blocks += div_u64((uint64_t)alloc_size * data_rate,