From: Dmitry Osipenko <digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Cc: Thierry Reding
<thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Jonathan Hunter
<jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
Greg Kroah-Hartman
<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v1 1/2] staging: Introduce NVIDIA Tegra20 video decoder driver
Date: Thu, 28 Sep 2017 14:37:03 +0300 [thread overview]
Message-ID: <69a019f1-8ce5-6b8b-8eb9-2ce9b8c2759d@gmail.com> (raw)
In-Reply-To: <20170928072308.s7npizjfnhkxh6zb@mwanda>
On 28.09.2017 10:23, Dan Carpenter wrote:
> On Thu, Sep 28, 2017 at 02:28:04AM +0300, Dmitry Osipenko wrote:
>>>> + if (is_baseline_profile)
>>>> + frame->aux_paddr = 0xF4DEAD00;
>>>
>>> The handling of is_baseline_profile is strange to me. It feels like we
>>> should always check it before we use ->aux_paddr but we don't ever do
>>> that.
>>>
>>
>> In a case of baseline profile, aux buffer isn't needed, HW should't use it. Aux
>> phys address is set to a predefined and invalid address, so that in a case of
>> VDE trying to use it, its invalid memory accesses would be reported in KMSG by
>> memory controller driver and the reported invalid addresses would be known to be
>> associated with the aux buffer. I'm not sure what you are meaning.
>
> It's not used perhaps, but we do write it to the hardware, right?
>
That's right. I'm pretty sure HW won't use the aux in a case of baseline
profile, haven't seen an evidence of it. But in order to be on a safe side, the
addresses are initialized to an invalid value, so HW won't have a chance to
silently fetch/trash 'arbitrary' main memory and we will know if it tries to do it.
if (baseline_profile)
frame->aux_paddr = 0xF4DEAD00;
else {
So here ^ all *used* frame entries are being initialized.
> tegra_vde_write_iram_entry(iram_tables, 0, i, value, aux_paddr);
>
> It's just strange.
>
There up to 16 reference video frames (already decoded) that could be used for
decoding of a video frame. Addresses of reference frames that shouldn't be used
for decoding of the current frame are set to an invalid address. Userspace my
supply wrong frames list or frames list setup code may contain an obscure bug
and we will know about it.
} else {
aux_paddr = 0xFADEAD00;
value = 0;
}
Here ^ all *unused* frame entries are being initialized.
tegra_vde_write_iram_entry(iram_tables, 0, i, value, aux_paddr);
And here ^ these entries are written to the tables that are read by HW.
--
Dmitry
next prev parent reply other threads:[~2017-09-28 11:37 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-25 22:15 [PATCH v1 0/2] NVIDIA Tegra20 video decoder driver Dmitry Osipenko
2017-09-25 22:15 ` [PATCH v1 1/2] staging: Introduce " Dmitry Osipenko
[not found] ` <5c8b83775b982e6ee851c127444a8e839f422ad0.1506377430.git.digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-09-25 23:01 ` Stephen Warren
2017-09-25 23:45 ` Dmitry Osipenko
[not found] ` <d19d709b-7451-0cdc-8bd0-913dc9c0a27d-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-09-26 5:11 ` Stephen Warren
[not found] ` <52f5c05f-7060-4d0f-355f-6da372c9ded0-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2017-09-26 12:02 ` Dmitry Osipenko
2017-09-27 9:45 ` Dan Carpenter
2017-09-27 23:28 ` Dmitry Osipenko
2017-09-28 7:23 ` Dan Carpenter
2017-09-28 11:37 ` Dmitry Osipenko [this message]
2017-09-27 23:31 ` Dmitry Osipenko
2017-09-25 22:15 ` [PATCH v1 2/2] ARM: dts: tegra20: Add video decoder node Dmitry Osipenko
[not found] ` <cover.1506377430.git.digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-09-26 6:54 ` [PATCH v1 0/2] NVIDIA Tegra20 video decoder driver Greg Kroah-Hartman
[not found] ` <20170926065447.GC6250-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2017-09-26 12:32 ` Dmitry Osipenko
[not found] ` <d2d4c970-d921-c282-b70e-00247c5de50f-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-09-26 21:35 ` Greg Kroah-Hartman
[not found] ` <20170926213549.GE3418-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2017-09-26 22:17 ` Dmitry Osipenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=69a019f1-8ce5-6b8b-8eb9-2ce9b8c2759d@gmail.com \
--to=digetx-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
--cc=devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
--cc=jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).