Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp2288277ybx; Sat, 2 Nov 2019 16:13:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqyegItikol2gVtDWr0j8gQi0bIQcVi06wmjvrMLdXlauCnrgo1BbL+ur/MJu3uNuS0Gx5t4 X-Received: by 2002:a17:906:9418:: with SMTP id q24mr16517634ejx.28.1572736387694; Sat, 02 Nov 2019 16:13:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572736387; cv=none; d=google.com; s=arc-20160816; b=0/bGrsW7AVmTUkpJdjgA76kWhtwsWbRKNQKKf7TChKnfmLp4FVotVqDhQG5N45AEaV IRbbBO0U9N6e/igb51AwuJ36Xxscz9ITfxZuIbjvRa0GkZDx/AJbdbxLP5uLy8ivzsUX msISJ7kCvBsyFamDNxZ9oQUFSV6G76hITdBXxfWm3cKybiksRb90U03XYs0DyBgDYRVJ jwxVy1gLRgfjXjD3UA633qVNeXBPDuPqCWrVNk4ZtdYxgVVK9M1AdjkntbhZTYlD9hrs VOEWJjugU5KP0cp3+NPiK7SiHepkQv8ApQ2LZFZ4/lQXby/Q3M+vi5csw2IAORIcGmsB oVZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=WhCdznOj6/CiJO2ZBCw5MTKrC7FAnR3U/9q/Xf0fYOs=; b=p9r6dhCKk+7PrTW7UgVsSjfb+nfAZisgR6hyptiqbV8kTdSOdMqLIR+UyBLuEG1RJO VOQYF+p7PTYD/eaKcwltXO59mqG0tXyCUqBpwUsPNlqkrc4V9BXeB5MqhIuTiEL1Roxw q8cThkMsDSElEGmkURtg1vURDClOMz8UfI1thuaeYsRARcs2Z8Ey85PUrXhquiBtgCOn AVVSjAAmEG/i09QpyQBQugzzBSjLXoJcshHnwnck9lM4X4uQQ+VEbUR9TeUWVl7knDMJ gHFwMfH9HnUR//aGVm1aGImJc9dFvO+2YW9eGQP2/MImDQibFGbXli3+yHQGRFjxLB3U cv1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@vanguardiasur-com-ar.20150623.gappssmtp.com header.s=20150623 header.b=kPUhMy2b; 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 l10si4578023edk.212.2019.11.02.16.12.44; Sat, 02 Nov 2019 16:13:07 -0700 (PDT) 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=@vanguardiasur-com-ar.20150623.gappssmtp.com header.s=20150623 header.b=kPUhMy2b; 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 S1727453AbfKBXLN (ORCPT + 99 others); Sat, 2 Nov 2019 19:11:13 -0400 Received: from mail-vk1-f194.google.com ([209.85.221.194]:39340 "EHLO mail-vk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727431AbfKBXLN (ORCPT ); Sat, 2 Nov 2019 19:11:13 -0400 Received: by mail-vk1-f194.google.com with SMTP id j84so3006045vkj.6 for ; Sat, 02 Nov 2019 16:11:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vanguardiasur-com-ar.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=WhCdznOj6/CiJO2ZBCw5MTKrC7FAnR3U/9q/Xf0fYOs=; b=kPUhMy2b6zicwiCWrkHkenmU0jmo3gGF9Bs0Rmn4DTL1JrEavSguW0xAkZu7JYTk9d ek8IxOBEjODgpTz1wIDnSHvaHaYUg2acex+4pJ64rJ2OrsvwI2ydLGnxtEupPtUw1+Op NHeebKZLXWzDwgz8vud03b/98T/DrLKeDYY0V1bxaGpxgT4K+ee0JK5Z8DSnDGxp+/Mr 5tt+07jMW35wji3rbSAxYpL7GQxqhd0NjK0YBdE4VDw6LYdM2hjOrYGRD7h+PTYte0bA 7X0LiXwU+ZHiOa6xm09fMo8Up/hOYKjdmaNSoJ0nlDpVunAzKaGDXruwrcQr9vK9fn2M H/2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WhCdznOj6/CiJO2ZBCw5MTKrC7FAnR3U/9q/Xf0fYOs=; b=apN3PspZG077tk1OaLFAlbA3ToJ3UCxseKHUAzUtEkUlYHvyQSLsQLKOhwrYWiApXK YpXvm7u7a9Dv6ANdJfH1ClLYGj6UtrRtg/gx9ViOCQUqDWvKs4RHD6Y8KJnYY2lbr/t1 N1C+s7zi0sDPrxSj1+xjO1GPczk5C6gkm/+SLzMedWmE0Yyr72g2xBRFtV/ZOwt6nuN1 kve7TN3DJwKGCGSFcS8ldRd1JCbFbcpSUXAq179/SFfjHgiJir5pta0znc1mjyjl/UXA H4oTjVMNBNZFOd9OcqtXMUTgv0APiv/U6sAJxmIbd21Nx5mxsflOuuaYaZ25Pt17QTkA nFAw== X-Gm-Message-State: APjAAAXppWmQ0RO3X55/oAyoZbEY9CrfQKaqQjfzZTqDPlbtQfBHerOx RaPWVVIyeZpoSX97hEbw9MV0to6HcPRqTSyVjA4IZA== X-Received: by 2002:a1f:2f51:: with SMTP id v78mr8770374vkv.101.1572736270640; Sat, 02 Nov 2019 16:11:10 -0700 (PDT) MIME-Version: 1.0 References: <20191029012430.24566-1-jonas@kwiboo.se> In-Reply-To: From: Ezequiel Garcia Date: Sun, 3 Nov 2019 00:10:59 +0100 Message-ID: Subject: Re: [PATCH v2 02/10] media: hantro: Fix motion vectors usage condition To: Jonas Karlman Cc: Mauro Carvalho Chehab , Ezequiel Garcia , Francois Buergisser , Hans Verkuil , Boris Brezillon , Tomasz Figa , Philipp Zabel , "linux-media@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 3 Nov 2019 at 00:09, Ezequiel Garcia wrote: > > On Tue, 29 Oct 2019 at 02:25, Jonas Karlman wrote: > > > > From: Francois Buergisser > > > > The setting of the motion vectors usage and the setting of motion > > vectors address are currently done under different conditions. > > > > When decoding pre-recorded videos, this results of leaving the motion > > vectors address unset, resulting in faulty memory accesses. Fix it > > by using the same condition everywhere, which matches the profiles > > that support motion vectors. > > > > Fixes: dea0a82f3d22 ("media: hantro: Add support for H264 decoding on G1") > > Signed-off-by: Francois Buergisser > > Signed-off-by: Ezequiel Garcia > > Signed-off-by: Jonas Karlman > > --- > > 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 29130946dea4..a1cb18680200 100644 > > --- a/drivers/staging/media/hantro/hantro_g1_h264_dec.c > > +++ b/drivers/staging/media/hantro/hantro_g1_h264_dec.c > > @@ -35,7 +35,7 @@ static void set_params(struct hantro_ctx *ctx) > > if (sps->flags & V4L2_H264_SPS_FLAG_MB_ADAPTIVE_FRAME_FIELD) > > reg |= G1_REG_DEC_CTRL0_SEQ_MBAFF_E; > > reg |= G1_REG_DEC_CTRL0_PICORD_COUNT_E; > > - if (dec_param->nal_ref_idc) > > + if (sps->profile_idc > 66 && dec_param->nal_ref_idc) > > reg |= G1_REG_DEC_CTRL0_WRITE_MVS_E; > > > > if (!(sps->flags & V4L2_H264_SPS_FLAG_FRAME_MBS_ONLY) && > > @@ -245,7 +245,7 @@ static void set_buffers(struct hantro_ctx *ctx) > > vdpu_write_relaxed(vpu, dst_dma, G1_REG_ADDR_DST); > > > > /* Higher profiles require DMV buffer appended to reference frames. */ > > - if (ctrls->sps->profile_idc > 66) { > > + if (ctrls->sps->profile_idc > 66 && ctrls->decode->nal_ref_idc) { > > How about a one-line function (purposely not a macro, > to have type-checking) ? I think this should emphasize the fact that > the condition > needs to be the same. > Oops, just saw the next patch. Nevermind.