Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1217084pxx; Tue, 27 Oct 2020 10:58:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPOenDHHzGsbB+AZjLA+fWJdd/yj7ZX//N5m2W0neCH7+nQfxuR4OkvibHhue4Blo4O9Pv X-Received: by 2002:aa7:d1cc:: with SMTP id g12mr3556467edp.195.1603821498803; Tue, 27 Oct 2020 10:58:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603821498; cv=none; d=google.com; s=arc-20160816; b=R+0qG1BPAp6P1w5RtT/G0I4h1/D9J+G8QvK9Id3UOGZCT3mcYlfiW+6Td6SJ3bkqE2 St4TcL0seRBplTLYjHAn5NotQp6LUX9q54xV+4nesqyFLK53uaCxgxs4pY1qIN3M0no5 g41h4SJz/9ohinESrEpTuBg5qdYjzHPSZpOH3g+3QICDsJQrsABFqdkOEh4z/HJbfAPU 8tsxKrf/c2wxRdy86UAt+0RC6D4+ihtISpWrWUBbKi84qaFq8etmUxPk2uqbcC4n4cyP ANaPB2F19xGlZu0a6e06p1XKFT7x+oKon9FRIu/anE4GVV2ScIo+4xFbG0x7z3svNzUy HFug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=BgKn/yd0uh0tz3v+R2uYfo2OUGitoaJHztFz2Qas4XM=; b=uoLy4RlJsuCCLL2gq2MpdOfy9amwGPK8eMo7sXBZ2PqyCC7dK42XJPAso3tjKlgYOn uJfvc8zebvt2UYSe0/J/dX9iPbN/b5XXAqPpBx8nrBB5sZWzLa9/nc2C+t876s157G6n qhhrhLqyB2jd+GKf14bh9EKIDvF0qtdRdppwWSyUJjRVdEIf+Eo7TRLrtsJPa1d8LKhh hOGohQX9yNulqLS65fWBJK16JjR0GtWk4Lek7zEz+H2Rl9TteS9FOgD25w4Gg9jl7w57 cFkJbFqBwh3kcDX8fGVDUv/lkxhlkmhgAITjN/o4zxJ8NuHcoW2lcJt80xKQxO96EXpu YgOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ItANVXKm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bh4si1976963ejb.551.2020.10.27.10.57.56; Tue, 27 Oct 2020 10:58:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ItANVXKm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S369877AbgJ0R0u (ORCPT + 99 others); Tue, 27 Oct 2020 13:26:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:54348 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1780199AbgJ0Ox5 (ORCPT ); Tue, 27 Oct 2020 10:53:57 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 343C522265; Tue, 27 Oct 2020 14:53:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603810436; bh=09+5vYYQ4VIhQpcPJ4r5qDo7EYsbc7Nl1ZKk6wAVCkY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ItANVXKmGiWRa8fywvB1wG2GtrY8vgOTKLBflTIFsPp4+tnTjoTJuQiaAvl5fGWnW 2ybqwbrXnYKUfn+K99f2GqwqOZpglf9lDmuy7tlhEur4sl3jxnizW7umF5dDiDfJF+ MC+QdO0UlCZ7CemWWlbsdjOLwQzeYyc4k1sR6axM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ezequiel Garcia , Philipp Zabel , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.8 111/633] media: hantro: postproc: Fix motion vector space allocation Date: Tue, 27 Oct 2020 14:47:34 +0100 Message-Id: <20201027135527.898730908@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ezequiel Garcia [ Upstream commit 669ccf19ed2059b9d517664a2dbbf6bde87e1414 ] When the post-processor is enabled, the driver allocates "shadow buffers" which are used for the decoder core, and exposes the post-processed buffers to userspace. For this reason, extra motion vector space has to be allocated on the shadow buffers, which the driver wasn't doing. Fix it. This fix should address artifacts on high profile bitstreams. Fixes: 8c2d66b036c77 ("media: hantro: Support color conversion via post-processing") Signed-off-by: Ezequiel Garcia Reviewed-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/staging/media/hantro/hantro_postproc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/media/hantro/hantro_postproc.c b/drivers/staging/media/hantro/hantro_postproc.c index 44062ffceaea7..6d2a8f2a8f0bb 100644 --- a/drivers/staging/media/hantro/hantro_postproc.c +++ b/drivers/staging/media/hantro/hantro_postproc.c @@ -118,7 +118,9 @@ int hantro_postproc_alloc(struct hantro_ctx *ctx) unsigned int num_buffers = cap_queue->num_buffers; unsigned int i, buf_size; - buf_size = ctx->dst_fmt.plane_fmt[0].sizeimage; + buf_size = ctx->dst_fmt.plane_fmt[0].sizeimage + + hantro_h264_mv_size(ctx->dst_fmt.width, + ctx->dst_fmt.height); for (i = 0; i < num_buffers; ++i) { struct hantro_aux_buf *priv = &ctx->postproc.dec_q[i]; -- 2.25.1