Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp3471205ybf; Tue, 3 Mar 2020 06:37:58 -0800 (PST) X-Google-Smtp-Source: ADFU+vvs+EwZBw97LD1o5HcIUj7Teg7/KVMwDpm3nfHf24qrdFqopT6Z4YFBUezUP26VBB3Emqmj X-Received: by 2002:a05:6808:610:: with SMTP id y16mr2666129oih.89.1583246278080; Tue, 03 Mar 2020 06:37:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583246278; cv=none; d=google.com; s=arc-20160816; b=0V5zTo6BocVvszLTiWaFnSBcN5Ek5DGTRBes3VKvL52T1PeH3I2YwtHDG4zxIQTCZy UmFlnsplV0rK1Etd7Yw9iWVNGwwf8ziXhAADcfjsLqL9MPx0OvRXPq5+O7nUlpf4n1CR 8aI5cczV70zVtyo/vQ0i+CW+VNRBWtuUwlODRt3JBwxaMG4sovSwVdUMYSyr399CvZu1 iztVanZhjtTk76fYdqWI1WL01tkPR6271OYfMPcs9ynp41+iGQnMldWX8nGQNYOSjUeq vERDbHO6L7g1Ev9BTNO5aMlAhc7NFrsGFxRgx2MxRCk9+f6C8ub99ws+7FLUDCvvrR7D QEgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=K5hjg1G3VFJLeuZ62RXxBnJp53DPSao1yCpZ+ZBtBN8=; b=YIsaxr7nu+pE1obvBbI7CIBUYNOYyY8l4xlLBEEUUBW4vR7gHHMSXINb2ak/Dur1NM E7xuOcpnYjgYyYjTFN3Gs4CuM5VgI/HBsT1qxX6u1nA1ncsUE9/+SonqyMTsNl6IIWRE kRbKVYOKc2HJDJ9w4Vry99CUja+qfNGLPF4ZTzqFg9z35sUeg/haMrpTF/SGQ2UVxPw7 ETVV3emMab0Yzte081vyxlJ65+hv1+KHGof4BtH4j8SqmW4KUxl2CHTZ4fn2sIMso4Ne w1cU/WrN0pNHfdDSOOX3jnLD11/YSPeYRLiPAUvX7xjA/epZMZqpXRWxsjo2sHi73wD7 hOsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=iNrm0CI9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u23si4495474otg.70.2020.03.03.06.37.45; Tue, 03 Mar 2020 06:37:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=iNrm0CI9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729481AbgCCOhi (ORCPT + 99 others); Tue, 3 Mar 2020 09:37:38 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:39764 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728560AbgCCOhh (ORCPT ); Tue, 3 Mar 2020 09:37:37 -0500 Received: by mail-wr1-f68.google.com with SMTP id y17so4634444wrn.6 for ; Tue, 03 Mar 2020 06:37:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=K5hjg1G3VFJLeuZ62RXxBnJp53DPSao1yCpZ+ZBtBN8=; b=iNrm0CI9XnahfkY1GKdbv7m82hqORspH2rHCweh+wIBudNC2ZqFrcVAnaaXt7uDpCy eOWYuWZdiQ8nxSKtcUSXqN5o/NCkO70fo22VX8gYL63tV53T+rWuSE9e6mLiaevS0Ff4 6M2FGsxXj3GoRVu27Q/2kIYiT4RKTrcngLYpiHQvNDqhyEWatZMzY35QMk8rOBe7Wc4Z an2h2ylpm7D3382SDTEw7p7Ia3K2fERXdyabba14Lsi+KMozLek0GLJ2GArlVQm9HUYI BeI+g3eiumyugaCfnPNyWzZ/uvi0ouNBGZPILG3gzL59aIjyao9pf6rXzpkOGg4NGTMo YqYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=K5hjg1G3VFJLeuZ62RXxBnJp53DPSao1yCpZ+ZBtBN8=; b=dv4J0zcrqu5yEhMyAK48Tsa5Zno+A034/QbDW7bNn8GNIW5xSuVBZuqd1JIdbJe/mj u3JtJUOdgf9JPekH8e8WctGjAAATC5H36jIHJE06Ya5td4wB7pjuk7ivqIlkZSCg5zeG G0HES7Y7UevM4gqZOkrOc3xcpm1UqgDrqecQwcyRgI7r41/kaD+JlTyvmpO8aYI+D0eO UwpzPsjxEF6BXVfvCvitkArv3clbs1CNz71NNK9MRw51NAODTXOnMm7+Z2H52ANCcFF4 KQ/f735kCb4i4yn3BFK+IVXINUc+QpERINN4owTqJa4yW4+uKMUXIi6T7jZaZbvFsVKp TvVg== X-Gm-Message-State: ANhLgQ37154R3ptnq6LrplMVFU2/ViKMsp5WNooOur9RKAsL+QR6pbXu jXxN08k6srAnPoqyLwyUSnwXhg== X-Received: by 2002:a5d:67c7:: with SMTP id n7mr5635176wrw.319.1583246254899; Tue, 03 Mar 2020 06:37:34 -0800 (PST) Received: from bender.baylibre.local (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id l4sm4652779wmf.38.2020.03.03.06.37.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Mar 2020 06:37:34 -0800 (PST) From: Neil Armstrong To: mchehab@kernel.org, hans.verkuil@cisco.com Cc: Neil Armstrong , linux-media@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Kevin Hilman Subject: [PATCH v6 1/5] media: meson: vdec: align stride on 32 bytes Date: Tue, 3 Mar 2020 15:37:28 +0100 Message-Id: <20200303143732.762-2-narmstrong@baylibre.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20200303143732.762-1-narmstrong@baylibre.com> References: <20200303143732.762-1-narmstrong@baylibre.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The HEVC/VP9 aligns the plane stride on 32, so align the planes stride for all codecs to 32 to satisfy HEVC/VP9 decoding using the "HEVC" HW. This fixes VP9 decoding of streams with following (not limited) widths: - 264 -288 - 350 - 352 - 472 - 480 - 528 - 600 - 720 - 800 - 848 - 1440 Signed-off-by: Neil Armstrong Tested-by: Kevin Hilman --- drivers/staging/media/meson/vdec/vdec.c | 10 +++++----- drivers/staging/media/meson/vdec/vdec_helpers.c | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/media/meson/vdec/vdec.c b/drivers/staging/media/meson/vdec/vdec.c index 92f0258868b1..bfca4c82aa56 100644 --- a/drivers/staging/media/meson/vdec/vdec.c +++ b/drivers/staging/media/meson/vdec/vdec.c @@ -528,20 +528,20 @@ vdec_try_fmt_common(struct amvdec_session *sess, u32 size, memset(pfmt[1].reserved, 0, sizeof(pfmt[1].reserved)); if (pixmp->pixelformat == V4L2_PIX_FMT_NV12M) { pfmt[0].sizeimage = output_size; - pfmt[0].bytesperline = ALIGN(pixmp->width, 64); + pfmt[0].bytesperline = ALIGN(pixmp->width, 32); pfmt[1].sizeimage = output_size / 2; - pfmt[1].bytesperline = ALIGN(pixmp->width, 64); + pfmt[1].bytesperline = ALIGN(pixmp->width, 32); pixmp->num_planes = 2; } else if (pixmp->pixelformat == V4L2_PIX_FMT_YUV420M) { pfmt[0].sizeimage = output_size; - pfmt[0].bytesperline = ALIGN(pixmp->width, 64); + pfmt[0].bytesperline = ALIGN(pixmp->width, 32); pfmt[1].sizeimage = output_size / 4; - pfmt[1].bytesperline = ALIGN(pixmp->width, 64) / 2; + pfmt[1].bytesperline = ALIGN(pixmp->width, 32) / 2; pfmt[2].sizeimage = output_size / 2; - pfmt[2].bytesperline = ALIGN(pixmp->width, 64) / 2; + pfmt[2].bytesperline = ALIGN(pixmp->width, 32) / 2; pixmp->num_planes = 3; } } diff --git a/drivers/staging/media/meson/vdec/vdec_helpers.c b/drivers/staging/media/meson/vdec/vdec_helpers.c index a4970ec1bf2e..3f7929c54dc6 100644 --- a/drivers/staging/media/meson/vdec/vdec_helpers.c +++ b/drivers/staging/media/meson/vdec/vdec_helpers.c @@ -154,8 +154,8 @@ int amvdec_set_canvases(struct amvdec_session *sess, { struct v4l2_m2m_buffer *buf; u32 pixfmt = sess->pixfmt_cap; - u32 width = ALIGN(sess->width, 64); - u32 height = ALIGN(sess->height, 64); + u32 width = ALIGN(sess->width, 32); + u32 height = ALIGN(sess->height, 32); u32 reg_cur = reg_base[0]; u32 reg_num_cur = 0; u32 reg_base_cur = 0; -- 2.22.0