From patchwork Fri Feb 13 19:23:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Zanoni X-Patchwork-Id: 5827001 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 00F1ABF440 for ; Fri, 13 Feb 2015 19:24:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 400D520254 for ; Fri, 13 Feb 2015 19:24:56 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 65B4920138 for ; Fri, 13 Feb 2015 19:24:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CF67D6E7FC; Fri, 13 Feb 2015 11:24:54 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-qa0-f48.google.com (mail-qa0-f48.google.com [209.85.216.48]) by gabe.freedesktop.org (Postfix) with ESMTP id 3A3CE720DF for ; Fri, 13 Feb 2015 11:24:51 -0800 (PST) Received: by mail-qa0-f48.google.com with SMTP id dc16so8445337qab.7 for ; Fri, 13 Feb 2015 11:24:50 -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=iQRZjdngg0qZCyqUYp1HMf8zkP1PltsURrRKAcgsuBw=; b=k4dFfKdFMm2BpSnSab605bGgO5loeytVNtwcMlpWyABr1US2PHUAj8IlV2DbYIY2Si L1sLhrfHcBZ6Rz/hDRGaJ1UBbwufV3XQMx2qIE9frQuxu7SQ4Yi7CR13td+NKg4DjiGK fpawP/cjmOWVi1eLdSnyQ+FtG4Fb1zb7lS2gQ0ys62KC+iavRevA0CMVhEctUmAv9BLm DdxUpaldwbUAhGBXzPF8Kty7ki3VkWfwOGFsU3GqwLQcfLE+MXrkgIwRHopPPBJ1rRzt w+5Pqvwc/UT4uIOdu4gfGqmK/vbJHycvjKmmp/73xEBqS5sTDBfQHDQCqrYAb/fluW5N dTLA== X-Received: by 10.140.202.213 with SMTP id x204mr4704527qha.95.1423855490922; Fri, 13 Feb 2015 11:24:50 -0800 (PST) Received: from localhost.localdomain ([177.220.182.131]) by mx.google.com with ESMTPSA id m5sm3525590qay.2.2015.02.13.11.24.49 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Feb 2015 11:24:50 -0800 (PST) From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Fri, 13 Feb 2015 17:23:47 -0200 Message-Id: <1423855427-2098-8-git-send-email-przanoni@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1423855427-2098-1-git-send-email-przanoni@gmail.com> References: <1423855427-2098-1-git-send-email-przanoni@gmail.com> Cc: Jani Nikula , Paulo Zanoni Subject: [Intel-gfx] [PATCH 7/7] 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". v2: Rebase after Jani addressed the other problems described in v1. Cc: Jani Nikula Signed-off-by: Paulo Zanoni Tested-By: PRC QA PRTS (Patch Regression Test System Contact: shuang.he@intel.com) Reviewed-by: Jani Nikula --- 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 59401f3..f1de95f 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.uncompressed_size) + if (size <= dev_priv->fbc.uncompressed_size) return 0; /* Release any current block */