Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp4206033ybx; Sat, 9 Nov 2019 11:07:40 -0800 (PST) X-Google-Smtp-Source: APXvYqw+PgcRi01nm/WLy68QEsS6NglXkUZLLsup+GCt3IIw81+oJ3C/QkTEmpWHiFzWA5TjHr+1 X-Received: by 2002:a17:906:5251:: with SMTP id y17mr12820975ejm.108.1573326460693; Sat, 09 Nov 2019 11:07:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573326460; cv=none; d=google.com; s=arc-20160816; b=apPK2jeYr+dHV32/jgjAi/sJSIdVaafC6robkJIeVm6Ox8PvogCEJoXTwU5MntcVB6 c5dPGXd07nJjycpjGNMmcQE+jMndu9opWtPcXghuReqqBGfA2cu0S+tK7XCwD4VAQAQh oCpsJ0a1bNU8BS1lzr+NUl78RFD0ylXk1nzhHRoYu9VjeOfxlHYfcvAFzd5wgXh5mJr3 NQVv2a10kgScmmD25F4+q7QfOW6kWCm1UkWsC+19oQJBZ4/wFYDkCsrQZzNRFL8em9C/ 4GtrWZ8e3RFfzG9mBFN0uqj2raLCxVK8uVH0EgTR1JOp8/HAb398R2/sisTn9EG154vO DXaQ== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=dL9q7rqRTa2EvvjvdAgFUzU2weuf60+f3kWrQ5jx4iQ=; b=Q4NSId+CobDuqDGeHY09YB0wXFgV60FGGKE6e4ceOibgk18MqvAqfAQvd1L9ovohC6 EaEDsmkF7amh99OyHguRvuLCWnNAXRrZi0C5PG8fhclNIb64erN8XICQpmKt1itZXVXV ctubS2ROpfqZS5muZ7uaoTMinri4He0rpBNCH3fzdv/pwwe7L0YyYhoNkVFNkFga7oZT A/FkmWs+QluVE7KysuG2ahThR7z9TA4oSYsZ14jCeJ87hLN28MBo8lPjeQ3UZoyi6+Uw y4vTRRk8blHldBsdtXYvIa1GE4EJ3YJKq1vu4EAIkYThQNZpJ6uHkYId/49SA3ckAxnZ F/MA== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n12si962256edi.235.2019.11.09.11.07.17; Sat, 09 Nov 2019 11:07:40 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726470AbfKITEg (ORCPT + 99 others); Sat, 9 Nov 2019 14:04:36 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:47282 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726227AbfKITEg (ORCPT ); Sat, 9 Nov 2019 14:04:36 -0500 Received: from localhost (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 1E1B928E979; Sat, 9 Nov 2019 19:04:34 +0000 (GMT) Date: Sat, 9 Nov 2019 20:04:30 +0100 From: Boris Brezillon To: Jonas Karlman Cc: Mauro Carvalho Chehab , Ezequiel Garcia , Hans Verkuil , Tomasz Figa , Philipp Zabel , "linux-media@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v3 3/5] media: hantro: Use output buffer width and height for H264 decoding Message-ID: <20191109200430.30367d27@collabora.com> In-Reply-To: References: <20191106223408.2176-1-jonas@kwiboo.se> Organization: Collabora X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 6 Nov 2019 22:34:22 +0000 Jonas Karlman wrote: > Calculations for motion vector buffer offset is based on width and height > from the configured output format, lets use the same values for macroblock > width and height hw regs. Still don't see what was the problem with sps->pic_{width,height}_in_mbs_minus1, but okay. Reviewed-by: Boris Brezillon > > Fixes: dea0a82f3d22 ("media: hantro: Add support for H264 decoding on G1") Is this really fixing a bug? Do you have cases where ->pic_{width,height}_in_mbs_minus1 and MB_{WIDTH,HEIGHT}(src_fmt.{width,height}) do not match? > Signed-off-by: Jonas Karlman > --- > Changes in v3: > - change to use src_fmt instead of dst_fmt (Boris) > Changes in v2: > - new patch split from "media: hantro: Fix H264 motion vector buffer offset" > --- > drivers/staging/media/hantro/hantro_g1_h264_dec.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/media/hantro/hantro_g1_h264_dec.c b/drivers/staging/media/hantro/hantro_g1_h264_dec.c > index 30d977c3d529..27d40d8d3728 100644 > --- a/drivers/staging/media/hantro/hantro_g1_h264_dec.c > +++ b/drivers/staging/media/hantro/hantro_g1_h264_dec.c > @@ -51,8 +51,8 @@ static void set_params(struct hantro_ctx *ctx) > vdpu_write_relaxed(vpu, reg, G1_REG_DEC_CTRL0); > > /* Decoder control register 1. */ > - reg = G1_REG_DEC_CTRL1_PIC_MB_WIDTH(sps->pic_width_in_mbs_minus1 + 1) | > - G1_REG_DEC_CTRL1_PIC_MB_HEIGHT_P(sps->pic_height_in_map_units_minus1 + 1) | > + reg = G1_REG_DEC_CTRL1_PIC_MB_WIDTH(MB_WIDTH(ctx->src_fmt.width)) | > + G1_REG_DEC_CTRL1_PIC_MB_HEIGHT_P(MB_HEIGHT(ctx->src_fmt.height)) | > G1_REG_DEC_CTRL1_REF_FRAMES(sps->max_num_ref_frames); > vdpu_write_relaxed(vpu, reg, G1_REG_DEC_CTRL1); >