From patchwork Fri Oct 5 12:38:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liviu Dudau X-Patchwork-Id: 148173 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp396270lji; Fri, 5 Oct 2018 05:38:38 -0700 (PDT) X-Google-Smtp-Source: ACcGV60UAp4CkFTwGm3KtoKXMfPK4HXT54hSck/X0lOO/DYGcoc1EY0U+gwePVoEXp+CUOR1ggW9 X-Received: by 2002:a63:8e43:: with SMTP id k64-v6mr9798469pge.75.1538743118808; Fri, 05 Oct 2018 05:38:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538743118; cv=none; d=google.com; s=arc-20160816; b=rDVx39jiGRcokpfkUVWSWE+xOI3n988eTwSKzhqiwqBJ61vxXpjlCmZrCvf37AUE/7 eS2JMclTQszLIjXrWMAUX7ygMr/Otr8tMa5wsSVisDwQ3NYqM2xT+a6lgTgSp8xHL618 SdtdJglX1MPMTkooXci9Bdd7BCFQd0+ZybBoQTrf+erSwf3vdhldgSd3nU6VB7TXke8s B0jSm2hTIA8hWdx4+qcpyXxSbH8XxDsrVf4gdSB/SlqOvReerMEKO7q0azQi09tAlYWI 26eLV8Ow7tWG4J8Uet7O5uFhzWDCm8dQBtdMTG+tcH5RiLAt/4XT95uqlsnjCMw3yWHZ MsmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:references:in-reply-to:message-id:date:subject :to:from:delivered-to; bh=x2DyzHHdzy+7Y56LgRQO6KTDGxZ4IR4Ang1NGHPmZ18=; b=bhPZFAHeunU+2RYciEYgdird4teq0h+P9tklxLupyu4Fqx7RT3aKx3ohe1Isk7yiRO 5UDNp6E+Pxk9TJgL6erOr1rGdVpjytp8HyyQ1Js3fzIEyvY76KcB09RXe4VgiKu6ip2m xkjZQljuvyHD9EOVLbLU1hzgNvB79fhS497aMeF0RxaK68V7ka+KuP26gDsDR72eLsGW vK6OicHW5ckbOTTKjZHfHyYX39tUhlO1oyDlgmG+lnD2HEDSacCuZeWbGRmWt8hwKEqN 5IodOneYTIuXV0TlPUwnXjqkljGke+Pqc8YmE9eGEJk9XkWwLyKMjCHCjfJ4RsftbWjH yBOQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id v9-v6si10193710pfj.167.2018.10.05.05.38.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Oct 2018 05:38:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 44D6D6E7D5; Fri, 5 Oct 2018 12:38:37 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from cam-smtp0.cambridge.arm.com (unknown [217.140.106.51]) by gabe.freedesktop.org (Postfix) with ESMTPS id 542F56E7D5 for ; Fri, 5 Oct 2018 12:38:36 +0000 (UTC) Received: from e110455-lin.cambridge.arm.com (e110455-lin.cambridge.arm.com [10.2.131.2]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id w95CcJQE021221; Fri, 5 Oct 2018 13:38:19 +0100 From: Liviu Dudau To: Ayan Kumar Halder Subject: [PATCH] drm: malidp: Add the size of the superblocks when calculating total size for AFBC buffers Date: Fri, 5 Oct 2018 13:38:19 +0100 Message-Id: <20181005123819.8843-1-Liviu.Dudau@arm.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <1538737393-112861-1-git-send-email-yuehaibing@huawei.com> References: <1538737393-112861-1-git-send-email-yuehaibing@huawei.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mali DP Maintainers , Liviu Dudau , YueHaibing , dri-devel@lists.freedesktop.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The size of the superblocks being added to the total AFBC buffer size got lost in the upstreaming process. Add it back. Cc: Ayan Kumar Halder Signed-off-by: Liviu Dudau Reviewed-by: Ayan Kumar Halder --- drivers/gpu/drm/arm/malidp_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c index 90214851637f4..505f316a192ec 100644 --- a/drivers/gpu/drm/arm/malidp_drv.c +++ b/drivers/gpu/drm/arm/malidp_drv.c @@ -38,6 +38,7 @@ #define MALIDP_CONF_VALID_TIMEOUT 250 #define AFBC_HEADER_SIZE 16 +#define AFBC_SUPERBLK_ALIGNMENT 128 static void malidp_write_gamma_table(struct malidp_hw_device *hwdev, u32 data[MALIDP_COEFFTAB_NUM_COEFFS]) @@ -336,7 +337,8 @@ malidp_verify_afbc_framebuffer_size(struct drm_device *dev, afbc_superblock_size = info->cpp[0] * afbc_superblock_width * afbc_superblock_height; - afbc_size = ALIGN(n_superblocks * AFBC_HEADER_SIZE, 128); + afbc_size = ALIGN(n_superblocks * AFBC_HEADER_SIZE, AFBC_SUPERBLK_ALIGNMENT); + afbc_size += n_superblocks * ALIGN(afbc_superblock_size, AFBC_SUPERBLK_ALIGNMENT); if (mode_cmd->width * info->cpp[0] != mode_cmd->pitches[0]) { DRM_DEBUG_KMS("Invalid value of pitch (=%u) should be same as width (=%u) * cpp (=%u)\n",