Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp2017493ybp; Thu, 10 Oct 2019 00:40:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqzT/1ZcPVh9jcTGEMeRVCtq5AT/7sLhJzlkfsprM1dbs2+8KSq2v1woVcBfxBl0IK3tD2BG X-Received: by 2002:a05:6402:60e:: with SMTP id n14mr6978660edv.147.1570693222934; Thu, 10 Oct 2019 00:40:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570693222; cv=none; d=google.com; s=arc-20160816; b=lbDUeBrB1lYN7yu8YqvDJMPQJM2t2bkOrgFRjc6Zm/hGdxq2jwC0VJld//NeOPfK+d L7QS6Po73iU9Mbevo9obE/yHl2ZNFldt8QLO6OhcBm2UC7a4kwCghUwyGTUHF9XaQ+mA EpN61upv1vahwGwhz3+0e8DVxPcQi5RRJGjkIjyxtZTUnYjnIxpakmU/S3PdjQjyqEN8 h5CRemBuhhsu/TGfI5RnmBo9Kg8YOk4Vq8p6lsNhDSpD82mC/NdmdzvI9IqAixSuf2Dm NkNO8nXWucBCUSQUe4XWfA4a+w7Mwam7n5emGUPAEUNjZn55eU/1+BZYYcXTqz9Hl3n7 +m5A== 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=vJlsoh59oqAW/FaeFtNhF8aeiLWws7tRN/rM3DPOGVk=; b=i+YwNy9lTB3e1v+U2YAFeWT7OAa4ApHyLjO7yTrtNI4XsCbpaHFhapfrPL9zzqvY8i msa2nNIJoikRjedlrE8FuoMGk0nltIA/3nVYJOG32km/8o7wjxVxJfrdYD60zkilg7X3 585kSsei2I+hnORzdB9eCRBp12vrWyPyVku32fGrA78w1u7nsOThnmsfTs73KfrSv7PA ofpj3iRtlIMWBNg89VS57ktd/QYMRbCKavid3tGcQEyG9NP9e37L8rSKLM/7cacm+o1l C5bGNNvDWWzYriBbyTUxJ92GLR3+iTpPxSzMPDt+rSpnb9TYcPVZPIC7XDqUhjZ3Xf9w X/Ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=c456C2yY; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s1si2780551ejf.305.2019.10.10.00.39.59; Thu, 10 Oct 2019 00:40:22 -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=@chromium.org header.s=google header.b=c456C2yY; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733165AbfJJHiM (ORCPT + 99 others); Thu, 10 Oct 2019 03:38:12 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:40141 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732945AbfJJH2N (ORCPT ); Thu, 10 Oct 2019 03:28:13 -0400 Received: by mail-ed1-f68.google.com with SMTP id v38so4495828edm.7 for ; Thu, 10 Oct 2019 00:28:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vJlsoh59oqAW/FaeFtNhF8aeiLWws7tRN/rM3DPOGVk=; b=c456C2yYsszcTskT+OjzXqm9fVBu3NJ5qlbw7ZUpE1S9D86PePnNay+vuANzmvUm92 upiwGqr0jcyA9imn8XkWzMB3rUlysShx8nSJvJZ33ARM0S4QGBjMkBg5Rl/59wXkViik nvCry4o/SQdvSs13kRgdKD0hN8VZvijYv6jQg= 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=vJlsoh59oqAW/FaeFtNhF8aeiLWws7tRN/rM3DPOGVk=; b=see3bW/q/Fr1eTnmf/RguAP9W00rxB7eKiWRrhcsxB4Jv9beT3KSDiexRWGi+dCKtq itrGprq1bJtTaUu1+tBao/5ct8J3tkLnNUBnlO5x6vSJ4UM+hcIjpyrJb0ZjjTFS87l+ r+2HdKDC7TanAVlmpekRC/9RKxvPEw6qTfjzOuywidWDg9BUfFRj9jDLEa/SBkwsOOGN a9E5fGEJg7okIsiPCsiI+Ssvx2sl4Ors31B6k6Oig4hPfFeu4DGDQJVRG+Gu09JL+t3y qjNSYVPzIhXKE49sqUdDOEof8/Tp1UWX74dMEeN9y3Wnxvj8nGD7Cj/OOBRFXJzMlNpf qH0Q== X-Gm-Message-State: APjAAAVjRPvemL2BLyBuS16OJ6mniB6zFL7H2KhvIdpLFave0O7VyyUc gmp/nyYOYj47iJJSmnJ8yI4BP2AaqgN0SQ== X-Received: by 2002:a17:906:7202:: with SMTP id m2mr6634040ejk.138.1570692490671; Thu, 10 Oct 2019 00:28:10 -0700 (PDT) Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com. [209.85.221.52]) by smtp.gmail.com with ESMTPSA id ng5sm589420ejb.9.2019.10.10.00.28.09 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 10 Oct 2019 00:28:09 -0700 (PDT) Received: by mail-wr1-f52.google.com with SMTP id p14so6465056wro.4 for ; Thu, 10 Oct 2019 00:28:09 -0700 (PDT) X-Received: by 2002:adf:fc42:: with SMTP id e2mr7509472wrs.100.1570692489004; Thu, 10 Oct 2019 00:28:09 -0700 (PDT) MIME-Version: 1.0 References: <20191007174505.10681-1-ezequiel@collabora.com> <20191007174505.10681-3-ezequiel@collabora.com> In-Reply-To: From: Tomasz Figa Date: Thu, 10 Oct 2019 16:27:56 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 for 5.4 2/4] media: hantro: Fix H264 max frmsize supported on RK3288 To: Jonas Karlman Cc: "fbuergisser@chromium.org" , "kernel@collabora.com" , Heiko Stuebner , Alexandre Courbot , Linux Kernel Mailing List , Douglas Anderson , "open list:ARM/Rockchip SoC..." , Boris Brezillon , Philipp Zabel , Nicolas Dufresne , Ezequiel Garcia , Linux Media Mailing List 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 Wed, Oct 9, 2019 at 5:39 AM Jonas Karlman wrote: > > On 2019-10-08 16:12, Jonas Karlman wrote: > > On 2019-10-08 15:53, Tomasz Figa wrote: > >> On Tue, Oct 8, 2019 at 10:35 PM Tomasz Figa wrote: > >>> On Tue, Oct 8, 2019 at 7:42 PM Tomasz Figa wrote: > >>>> On Tue, Oct 8, 2019 at 3:31 PM Jonas Karlman wrote: > >>>>> On 2019-10-08 07:27, Tomasz Figa wrote: > >>>>>> Hi Ezequiel, Jonas, > >>>>>> > >>>>>> On Tue, Oct 8, 2019 at 2:46 AM Ezequiel Garcia wrote: > >>>>>>> From: Jonas Karlman > >>>>>>> > >>>>>>> TRM specify supported image size 48x48 to 4096x2304 at step size 16 pixels, > >>>>>>> change frmsize max_width/max_height to match TRM. > >>>>>>> > >>>>>>> Fixes: 760327930e10 ("media: hantro: Enable H264 decoding on rk3288") > >>>>>>> Signed-off-by: Jonas Karlman > >>>>>>> --- > >>>>>>> v2: > >>>>>>> * No changes. > >>>>>>> > >>>>>>> drivers/staging/media/hantro/rk3288_vpu_hw.c | 4 ++-- > >>>>>>> 1 file changed, 2 insertions(+), 2 deletions(-) > >>>>>>> > >>>>>>> diff --git a/drivers/staging/media/hantro/rk3288_vpu_hw.c b/drivers/staging/media/hantro/rk3288_vpu_hw.c > >>>>>>> index 6bfcc47d1e58..ebb017b8a334 100644 > >>>>>>> --- a/drivers/staging/media/hantro/rk3288_vpu_hw.c > >>>>>>> +++ b/drivers/staging/media/hantro/rk3288_vpu_hw.c > >>>>>>> @@ -67,10 +67,10 @@ static const struct hantro_fmt rk3288_vpu_dec_fmts[] = { > >>>>>>> .max_depth = 2, > >>>>>>> .frmsize = { > >>>>>>> .min_width = 48, > >>>>>>> - .max_width = 3840, > >>>>>>> + .max_width = 4096, > >>>>>>> .step_width = H264_MB_DIM, > >>>>>>> .min_height = 48, > >>>>>>> - .max_height = 2160, > >>>>>>> + .max_height = 2304, > >>>>>> This doesn't match the datasheet I have, which is RK3288 Datasheet Rev > >>>>>> 1.4 and which has the values as in current code. What's the one you > >>>>>> got the values from? > >>>>> The RK3288 TRM vcodec chapter from [1], unknown revision and date, lists 48x48 to 4096x2304 step size 16 pixels under 25.5.1 H.264 decoder. > >>>>> > >>>>> I can also confirm that one of my test samples (PUPPIES BATH IN 4K) is 4096x2304 and can be decoded after this patch. > >>>>> However the decoding speed is not optimal at 400Mhz, if I recall correctly you need to set the VPU1 clock to 600Mhz for 4K decoding on RK3288. > >>>>> > >>>>> I am not sure if I should include a v2 of this patch in my v2 series, as-is this patch do not apply on master (H264_MB_DIM has changed to MB_DIM in master). > >>>>> > >>>>> [1] http://www.t-firefly.com/download/firefly-rk3288/docs/TRM/rk3288-chapter-25-video-encoder-decoder-unit-(vcodec).pdf > >>>> I checked the RK3288 TRM V1.1 too and it refers to 3840x2160@24fps as > >>>> the maximum. > >>>> > >>>> As for performance, we've actually been getting around 33 fps at 400 > >>>> MHz with 3840x2160 on our devices (the old RK3288 Asus Chromebook > >>>> Flip). > >>>> > >>>> I guess we might want to check that with Hantro. > >>> Could you check the value of bits 10:0 in register at 0x0c8? That > >>> should be the maximum supported stream width in the units of 16 > >>> pixels. > >> Correction: The unit is 1 pixel and there are additional 2 most > >> significant bits at 0x0d8, 15:14. > > I will check this later tonight when I have access to my devices. > > My Asus Tinker Board S (RK3288-C) is reporting support for 0x780 / 1920 pixels: > > 0x000 (0) = 0x67313688 > 0x0c8 (50) = 0xfbb56f80 > 0x0d8 (54) = 0xe5da0000 > Looks like that register doesn't work very well in Rockchip's implementation... Thanks for checking anyway. I guess we can allow 4096x2304 for the time being and see what happens. Reviewed-by: Tomasz Figa Best regards, Tomasz