From patchwork Tue Dec 23 12:35:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Zanoni X-Patchwork-Id: 5533091 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D6C20BEEA8 for ; Tue, 23 Dec 2014 12:36:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0D48F201BB for ; Tue, 23 Dec 2014 12:36:43 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 34BF32011D for ; Tue, 23 Dec 2014 12:36:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C41C26E3FE; Tue, 23 Dec 2014 04:36:38 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by gabe.freedesktop.org (Postfix) with ESMTP id D31AB6E3FE for ; Tue, 23 Dec 2014 04:36:36 -0800 (PST) Received: by mail-vc0-f177.google.com with SMTP id ij19so2277119vcb.36 for ; Tue, 23 Dec 2014 04:36:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=TZ1HycfDFIA3l00qsMIHAOy2Nki5sWv+Bo06cNAM22U=; b=Dkzzk3YRVcBdzsj488UfhaBnQTS+OJ9prC9KB/qezKy4Er/0wbebule9uFfIXyt7/J Qp9voQxJCgx1AW4thCe/pGCcvVKd+zS586uZHhIpK1DejbYW7dqL0YBJnpCjLbskoVXo W3+ZQKVmM2APA9B6Bv84hSUx474FeaiaoJJ1jmmBmvjUU650pxRtFgP4PASVTILYTgVv ne1GNNz/KCIPpg5jkt7YsmnwlHjVgByUT51G9OQryIqqqeUXrVeEEOVJDdto1p+pYgcE gUdxX5yBYjmH4mOSz7zWeGahJPdzMbDgsdh47lV5L/wfk7A24Qe7+u/IF7wbQhJ39qrm DEJA== X-Received: by 10.220.17.144 with SMTP id s16mr6131494vca.10.1419338196483; Tue, 23 Dec 2014 04:36:36 -0800 (PST) Received: from localhost.localdomain ([177.92.19.202]) by mx.google.com with ESMTPSA id at12sm4915045vdc.15.2014.12.23.04.36.35 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 23 Dec 2014 04:36:35 -0800 (PST) From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Tue, 23 Dec 2014 10:35:37 -0200 Message-Id: <1419338145-1912-2-git-send-email-przanoni@gmail.com> X-Mailer: git-send-email 2.1.3 In-Reply-To: <1419338145-1912-1-git-send-email-przanoni@gmail.com> References: <1419338145-1912-1-git-send-email-przanoni@gmail.com> Cc: Paulo Zanoni Subject: [Intel-gfx] [PATCH 1/9] drm/i915: don't reallocate the compressed FB at every frame 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.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, 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 From: Paulo Zanoni With the current code we just reallocate the compressed FB at every FBC update: we have X in one frame, then in the other frame we need X again, but we check "needed < have" instead of "needed <= have". There are still other problems with this code: we don't take the threshold into consideration and we also have cases where we reallocate the CFB while FBC is enabled, but let's leave these for later patches. Signed-off-by: Paulo Zanoni --- drivers/gpu/drm/i915/i915_gem_stolen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c index a204584..4797138 100644 --- a/drivers/gpu/drm/i915/i915_gem_stolen.c +++ b/drivers/gpu/drm/i915/i915_gem_stolen.c @@ -253,7 +253,7 @@ int i915_gem_stolen_setup_compression(struct drm_device *dev, int size, int fb_c if (!drm_mm_initialized(&dev_priv->mm.stolen)) return -ENODEV; - if (size < dev_priv->fbc.size) + if (size <= dev_priv->fbc.size) return 0; /* Release any current block */