<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>SEOULSARAM</title><link>https://seoulsaram.org/</link><description>Sungjoon Moon's Personal Blog</description><language>en-us</language><copyright>Content licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)</copyright><atom:link href="https://seoulsaram.org/rss.xml" rel="self" type="application/rss+xml"/><item><title>Hardware-accelerated 4K video on RK3588 with Linux 7.0</title><link>https://seoulsaram.org/articles/RK3588/mainline-hwdec/</link><guid>https://seoulsaram.org/articles/RK3588/mainline-hwdec/</guid><pubDate>Mon, 20 Apr 2026 00:00:00 +0900</pubDate><description><![CDATA[<h2 class="heading" id="background">Background</h2>
<p>Collabora team has been doing amazing work. Now you don't need to use vendor BSP to use hardware acceleration.
Now with upstream linux kernel 7.0, you can play 4K 60fps video with hardware acceleration without any vendor kernel patch.</p>
<p>First of all, thank you so much to my friend for lending me Odroid-M2<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup> in this RAMpocalypse.</p>
<h2 class="heading" id="but-how-to-do-it">But how to do it?</h2>
<p>I couldn't find a guide on how to actually run it on an upstream kernel.
That's why I wrote this article.</p>
<p>I could get some hints from Collabora's blog post<sup id="fnref:2"><a href="#fn:2" class="footnote-ref" role="doc-noteref">2</a></sup>.
And this Github discussion<sup id="fnref:3"><a href="#fn:3" class="footnote-ref" role="doc-noteref">3</a></sup> was helpful too.</p>
<h3 class="heading" id="this-is-what-you-need">This is what you need</h3>
<ul>
<li>Upstream Linux kernel 7.0+</li>
<li>Enable <code>CONFIG_VIDEO_ROCKCHIP_VDEC=m</code> in the default kernel config.</li>
<li>linux-firmware (It's for Panthor GPU driver, not for VPU)</li>
<li>gstreamer 1.28+</li>
<li>sway or any wayland compositor that supports dmabuf for zero copy (you may be able to use DRM or X11, but not tested)</li>
</ul>
<blockquote>
<p><strong>NOTE:</strong></p><p>Some of these aren't needed if you just want <code>decoding</code>. It's done by VPU, so you might only need the upstream kernel. I'm focusing on <strong>playing</strong> video, which requires integration with GPU. And GPU needs some configurations.</p></blockquote><p>These were enabled by default for me, but you might need to enable them yourself:</p>
<ul>
<li><code>CONFIG_MEDIA_CONTROLLER=y</code></li>
<li><code>CONFIG_MEDIA_CONTROLLER_REQUEST_API=y</code></li>
<li><code>CONFIG_V4L2_MEM2MEM_DEV=y</code></li>
<li><code>CONFIG_DRM_PANTHOR=m</code></li>
</ul>
<p>Or you can use ffmpeg/mpv instead of gstreamer. These patches add v4l2request support:</p>
<ul>
<li>ffmpeg with this patch<sup id="fnref:4"><a href="#fn:4" class="footnote-ref" role="doc-noteref">4</a></sup> (or you can use this fork<sup id="fnref:5"><a href="#fn:5" class="footnote-ref" role="doc-noteref">5</a></sup>)</li>
<li>mpv with this patch<sup id="fnref:6"><a href="#fn:6" class="footnote-ref" role="doc-noteref">6</a></sup></li>
</ul>
<p>I believe you can do 'hardware decoding' without any patch with ffmpeg even on TTY. But you may be able to use it only for transcoding or whatever you need it for, but not for playing video AFAIK.</p>
<h3 class="heading" id="how-to-play-it">How to play it</h3>
<div class="highlight"><pre tabindex="0" style="color:#e6edf3;background-color:#0d1117;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-sh" data-lang="sh"><span style="display:flex;"><span>v4l2-ctl -d /dev/videoN --list-formats-out
</span></span><span style="display:flex;"><span>v4l2-ctl -d /dev/videoM --list-formats-out
</span></span></code></pre></div><p>With patched ffmpeg + mpv on wayland compositor that supports linux-dmabuf-v1:</p>
<div class="highlight"><pre tabindex="0" style="color:#e6edf3;background-color:#0d1117;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-sh" data-lang="sh"><span style="display:flex;"><span>mpv --hwdec<span style="color:#ff7b72;font-weight:bold">=</span>v4l2request --vo<span style="color:#ff7b72;font-weight:bold">=</span>dmabuf-wayland --hwdec-software-fallback<span style="color:#ff7b72;font-weight:bold">=</span>no bbb_sunflower_2160p_60fps_normal.mp4
</span></span></code></pre></div><p><code>--hwdec-software-fallback=no</code> isn't necessary but it's useful for not making it fallback to software decoding.</p>
<blockquote><p>But how to get board image?</p>
</blockquote><h2 class="heading" id="crossdev-stages">crossdev-stages</h2>
<p>You can build image with <a href="https://github.com/lu-zero/crossdev-stages">crossdev-stages</a>.
Making an image for RISC-V/ARM boards is usually not that convenient.
It removes all the headache when you build an image for boards. It makes a container with <code>hakoniwa</code> and sets up a cross compiler environment with Gentoo Linux.
Then you can build rootfs + linux + uboot + whatever automatically, designed so everything can be defined with config files.</p>
<p>I added multi-board support on top of Luca's original work. It used to only support RISC-V boards, now you can use ARM boards too.</p>
<h2 class="heading" id="voilà">Voilà!</h2>
<video controls preload="metadata" playsinline style="width:100%;height:auto;"><source src="/articles/RK3588/mainline-hwdec/demo.webm" type="video/webm">Your browser does not support the video tag.
</video>

<h2 class="heading" id="upcoming-patches">Upcoming patches?</h2>
<p>There are more works waiting for merge, like 4K 60fps HDMI output. This is really amazing work. You can check details in the resources at the bottom.</p>
<h2 class="heading" id="mini-videobox">Mini VideoBox</h2>
<p>I don't want this to just be playing with my Odroid-M2, I want to make it useful.</p>
<p>For future plan, I'm trying to make a 'Mini-VideoBox' someday. FOSDEM has a streaming device called <code>videobox</code><sup id="fnref:7"><a href="#fn:7" class="footnote-ref" role="doc-noteref">7</a></sup>, it's an amazing thing. I had a great chance to use and analyze it, and they also donated one to us, <a href="https://fossforall.org">FOSS for All</a>.</p>
<p>But it's bit big and it's for huge conferences. I'm more trying to make a streaming+recording device that can work standalone. Since RK3588 has HDMI input (Unfortunately Odroid-M2 uses RK3588S2 which has no HDMI input), this could be a perfect fit.</p>
<p>My plan is to build several mini-videoboxes for small meetups. I'd love to do this as a FOSS for All project, building it openly with the community. So people can record their talk and meetup painlessly. No OBS on their laptop, no capture card.</p>
<p>We need more time before all features land in the upstream kernel, but I believe it can be done someday.</p>
<h2 class="heading" id="thank-you">Thank you!</h2>
<p>Kudos to the Collabora team!
And again, thanks to my friend <code>C</code> who lent me his Odroid-M2.</p>
<h2 class="heading" id="other-useful-resources">Other useful resources</h2>
<ul>
<li><a href="https://gitlab.collabora.com/hardware-enablement/rockchip-3588/notes-for-rockchip-3588/-/blob/main/mainline-status.md">Mainline status of RK3588</a></li>
<li><a href="https://fosdem.org/2026/schedule/event/KLFW73-no-line-like-mainline-rockchip/">No Line Like Mainline: Update On The Fully Mainline Software Stack For Rockchip SoCs</a></li>
<li><a href="https://fosdem.org/2026/schedule/event/WFZJ7U-upstream-video-capture-camera-support-rk35xy/">Upstreaming Progress: Video Capture and Camera Support for Recent Rockchip SoCs</a></li>
<li><a href="https://wiki.odroid.com/odroid-m2/odroid-m2">Odroid-M2 wiki</a></li>
<li><a href="https://blog.brixit.nl/after-fosdem-videobox-updates/">After FOSDEM VideoBox Updates (BrixIT blog)</a></li>
<li><a href="https://fosdem.org/2026/schedule/event/ULTMMY-fosdem_videobox_2026/">FOSDEM VideoBox 2026 (talk)</a></li>
<li><a href="https://github.com/fosdem/video">FOSDEM video tooling source</a></li>
</ul>
<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p><a href="https://wiki.odroid.com/odroid-m2/odroid-m2">Odroid-M2 wiki</a>&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:2">
<p><a href="https://www.collabora.com/news-and-blog/news-and-events/rk3588-and-rk3576-video-decoders-support-merged-in-the-upstream-linux-kernel.html">Collabora's article about merged patch</a>&#160;<a href="#fnref:2" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:3">
<p><a href="https://github.com/blakeblackshear/frigate/discussions/18311">Github discussion about HW acceleration for RK3588 with mainline kernel</a>&#160;<a href="#fnref:3" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:4">
<p><a href="https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20847">FFmpeg PR</a>&#160;<a href="#fnref:4" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:5">
<p><a href="https://gitlab.collabora.com/detlev/ffmpeg">FFmpeg downstream of collabora</a>&#160;<a href="#fnref:5" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:6">
<p><a href="https://github.com/mpv-player/mpv/pull/14690">mpv PR</a>&#160;<a href="#fnref:6" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:7">
<p><a href="https://blog.brixit.nl/after-fosdem-videobox-updates/">After FOSDEM VideoBox Updates (BrixIT blog)</a>&#160;<a href="#fnref:7" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></description></item><item><title>GSoC 2025 Final Report: RVV Optimization for the dav1d AV1 Decoder</title><link>https://seoulsaram.org/articles/GSoC25/final-report/</link><guid>https://seoulsaram.org/articles/GSoC25/final-report/</guid><pubDate>Mon, 01 Sep 2025 00:00:00 +0900</pubDate><description><![CDATA[<h2 class="heading" id="project-overview-and-goals">Project Overview and Goals</h2>
<p><code>dav1d</code><sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup> is an open-source AV1 video decoder that aims for the highest possible performance. The primary goal of this GSoC project was to optimize <code>dav1d</code>'s core video processing functions by implementing hand-written assembly using the <strong>RISC-V Vector (RVV) Extension</strong>. The objective was to maximize performance to enable smooth playback of high-definition AV1 video on low-power RISC-V devices, thereby demonstrating and enhancing the multimedia capabilities of the RISC-V ecosystem.</p>
<h2 class="heading" id="key-activities-and-achievements">Key Activities and Achievements</h2>
<p>During the project, I performed the following key activities:</p>
<ul>
<li><strong>Building a RISC-V Gentoo Development Environment:</strong> To facilitate this project, I first built and stabilized a cutting-edge Gentoo Linux development image. This involved using the crossdev-stages<sup id="fnref:2"><a href="#fn:2" class="footnote-ref" role="doc-noteref">2</a></sup> scripts to cross-compile the entire system for RISC-V with full RVV support, a process during which I identified, debugged, and contributed fixes for numerous upstream bugs in core packages like GCC, crossdev, and Perl</li>
<li><strong>Performance Analysis and Bottleneck Identification:</strong> Using the <code>perf</code> tool, I analyzed <code>dav1d</code>'s performance to identify bottlenecks. The analysis confirmed that functions like <strong><code>prep_8tap</code></strong> and <strong><code>put_8tap</code></strong> were responsible for the most significant computational load.</li>
<li><strong>C-based Code Optimization:</strong>
<ul>
<li><strong>w_mask C Code Improvement (MR !1804):</strong> While implementing the RVV version, I identified an area in the existing C code that could be optimized. By simply pre-calculating and storing frequently used values in variables, I achieved a meaningful <strong>~7% performance improvement</strong> on an x86_64 CPU.</li>
</ul>
</li>
<li><strong>RVV Assembly Optimization:</strong> Based on the analysis, I implemented and contributed RVV assembly optimizations for the following core functions. All code was thoroughly tested on <strong>Spacemit K1 (VLEN=256)</strong> and <strong>K230 (VLEN=128)</strong> hardware.
<ul>
<li><strong>w_mask RVV Implementation (MR !1797):</strong> I implemented RVV assembly for three <code>w_mask</code> functions (<code>444</code>, <code>422</code>, <code>420</code>). By applying various techniques such as loop unrolling and dynamic LMUL selection based on VLEN, I achieved a performance increase of <strong>up to 16x</strong> on Spacemit K1 and <strong>up to 9x</strong> on K230.</li>
<li><strong>emu_edge (MR !1808):</strong> I optimized the <code>emu_edge</code> function with RVV, resulting in a performance increase of <strong>up to 5x</strong>, depending on the input values.</li>
</ul>
</li>
</ul>
<h2 class="heading" id="current-project-status">Current Project Status</h2>
<p>The submitted Merge Requests have successfully accelerated key <code>dav1d</code> functions using RVV. The optimized code has passed all <code>checkasm</code> and <code>argon</code> conformance tests, ensuring its stability. These changes show significant performance gains across various block widths and on different hardware with VLEN=128 and VLEN=256.</p>
<h2 class="heading" id="code-contributions--merge-requests">Code Contributions &amp; Merge Requests</h2>
<p>The following are the main Merge Requests I worked on and submitted during this GSoC period. You can find detailed code changes, benchmark results, and the review process at each link.</p>
<ul>
<li><strong>mc: 8bpc rvv w_mask (v1) (!1797):</strong> <a href="https://code.videolan.org/videolan/dav1d/-/merge_requests/1797">https://code.videolan.org/videolan/dav1d/-/merge_requests/1797</a></li>
<li><strong>mc: 8bpc c w_mask (!1804):</strong> <a href="https://code.videolan.org/videolan/dav1d/-/merge_requests/1804">https://code.videolan.org/videolan/dav1d/-/merge_requests/1804</a></li>
<li><strong>mc: 8bpc rvv emu_edge (!1808):</strong> <a href="https://code.videolan.org/videolan/dav1d/-/merge_requests/1808">https://code.videolan.org/videolan/dav1d/-/merge_requests/1808</a></li>
</ul>
<h2 class="heading" id="future-work">Future Work</h2>
<p>While significant progress was made during GSoC, the RISC-V optimization for <code>dav1d</code> is not yet complete. I plan to remain active in the community after GSoC and will continue contributing by addressing the following tasks:</p>
<ul>
<li><strong>Optimize <code>prep_8tap</code> and <code>put_8tap</code>:</strong> The next goal is to implement RVV assembly for these two functions, which were identified as the biggest bottlenecks by <code>perf</code>.</li>
<li><strong>Further Optimization:</strong> I plan to apply further optimizations, such as eliminating the height-based loop in <code>w_mask</code> for cases where <code>w*h &lt; 64</code> to process it in a single pass.</li>
</ul>
<h2 class="heading" id="challenges-and-key-learnings">Challenges and Key Learnings</h2>
<p>Through this project, I gained a deep understanding of RISC-V vector assembly and experienced solving complex performance issues on real hardware. The initial process of understanding RVV was very challenging, but I finally had a breakthrough during a 15-hour flight to Bulgaria, where I could focus intensely on the documentation.</p>
<p>This entire journey would have been impossible without my excellent mentors, <strong>Nathan</strong> and <strong>Luca</strong>, and the helpful members of the community. I would like to express my sincere gratitude to everyone who helped me.</p>
<h2 class="heading" id="resources">Resources</h2>
<p>The following resources were extremely helpful throughout the project:</p>
<ul>
<li><strong>RISC-V Specifications:</strong>
<ul>
<li><a href="https://five-embeddev.com/riscv-v-spec/v1.0/v-spec.html#">RISC-V Vector Specification v1.0</a></li>
<li><a href="https://five-embeddev.com/riscv-bitmanip/1.0.0/bitmanip.html#insns-max">RISC-V Bit-Manipulation ISA-Extension</a></li>
<li><a href="https://projectf.io/posts/riscv-cheat-sheet/">RISC-V Assembly Programmer's Cheat Sheet</a></li>
</ul>
</li>
<li><strong>RISE Optimization Guide:</strong>
<ul>
<li><a href="https://riscv-optimization-guide-riseproject-c94355ae3e68722524.gitlab.io/">RISE Project - RISC-V Optimization Guide</a></li>
</ul>
</li>
<li><strong>Especially helpful for understanding RVV:</strong>
<ul>
<li><a href="https://eupilot.eu/wp-content/uploads/2022/11/RISC-V-VectorExtension-1-1.pdf">RISC-V Vector Extension by EUPILOT</a></li>
<li><a href="https://0x80.pl/notesen/2024-11-09-riscv-vector-extension.html">A Gentle Introduction to RISC-V Vector Extension by 0x80.pl</a></li>
<li><a href="https://people.videolan.org/~negge/vdd24.pdf">Optimizing Software for RISC-V (VDD24) by Nathan Egge</a></li>
<li><a href="https://people.videolan.org/~unlord/riscv101-2025.pdf">RISC-V 101 (RISC-V Summit EU) by Nathan Egge</a></li>
</ul>
</li>
</ul>
<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p><a href="https://code.videolan.org/videolan/dav1d">dav1d</a>&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:2">
<p><a href="https://github.com/lu-zero/crossdev-stages">crossdev-stages</a>&#160;<a href="#fnref:2" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></description></item><item><title>How to build perf for spacemit x60 and use it with dav1d</title><link>https://seoulsaram.org/articles/GSoC25/perf/</link><guid>https://seoulsaram.org/articles/GSoC25/perf/</guid><pubDate>Fri, 27 Jun 2025 00:00:00 +0900</pubDate><description><![CDATA[<p>This time we are going to explore how to use Perf command.
This allows us to determine which functions have the most significant impact on decoding with dav1d.</p>
<h2 class="heading" id="how-to-build-perf">How to build perf</h2>
<div class="highlight"><pre tabindex="0" style="color:#e6edf3;background-color:#0d1117;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>cd linux/tools/perf/pmu-events
</span></span><span style="display:flex;"><span>./jevents.py riscv spacemit/x60 . pmu-events.c
</span></span></code></pre></div><p>It will fail, so remove the failing codes in jevents.py.</p>
<div class="highlight"><pre tabindex="0" style="color:#e6edf3;background-color:#0d1117;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-python" data-lang="python"><span style="display:flex;"><span><span style="color:#ff7b72">if</span> len(archs) <span style="color:#ff7b72;font-weight:bold">&lt;</span> <span style="color:#a5d6ff">2</span>:
</span></span><span style="display:flex;"><span>  <span style="color:#ff7b72">raise</span> <span style="color:#f0883e;font-weight:bold">IOError</span>(<span style="color:#79c0ff">f</span><span style="color:#a5d6ff">&#39;Missing architecture directory </span><span style="color:#79c0ff">\&#39;</span><span style="color:#a5d6ff">{</span>_args<span style="color:#ff7b72;font-weight:bold">.</span>arch<span style="color:#a5d6ff">}</span><span style="color:#79c0ff">\&#39;</span><span style="color:#a5d6ff">&#39;</span>)
</span></span></code></pre></div><p>Then, (I know some <code>make</code> options are not needed but it just works).</p>
<div class="highlight"><pre tabindex="0" style="color:#e6edf3;background-color:#0d1117;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>cd ..
</span></span><span style="display:flex;"><span>make -j <span style="color:#a5d6ff">8</span> <span style="color:#79c0ff">V</span><span style="color:#ff7b72;font-weight:bold">=</span><span style="color:#a5d6ff">1</span> <span style="color:#79c0ff">VF</span><span style="color:#ff7b72;font-weight:bold">=</span><span style="color:#a5d6ff">1</span> <span style="color:#79c0ff">HOSTCC</span><span style="color:#ff7b72;font-weight:bold">=</span>riscv64-unknown-linux-gnu-gcc <span style="color:#79c0ff">HOSTLD</span><span style="color:#ff7b72;font-weight:bold">=</span>riscv64-unknown-linux-gnu-ld <span style="color:#79c0ff">CC</span><span style="color:#ff7b72;font-weight:bold">=</span>riscv64-unknown-linux-gnu-gcc <span style="color:#79c0ff">CXX</span><span style="color:#ff7b72;font-weight:bold">=</span>riscv64-unknown-linux-gnu-g++ <span style="color:#79c0ff">AR</span><span style="color:#ff7b72;font-weight:bold">=</span>riscv64-unknown-linux-gnu-ar <span style="color:#79c0ff">LD</span><span style="color:#ff7b72;font-weight:bold">=</span>riscv64-unknown-linux-gnu-ld <span style="color:#79c0ff">NM</span><span style="color:#ff7b72;font-weight:bold">=</span>riscv64-unknown-linux-gnu-nm <span style="color:#79c0ff">PKG_CONFIG</span><span style="color:#ff7b72;font-weight:bold">=</span>riscv64-unknown-linux-gnu-pkg-config <span style="color:#79c0ff">prefix</span><span style="color:#ff7b72;font-weight:bold">=</span>/usr <span style="color:#79c0ff">bindir_relative</span><span style="color:#ff7b72;font-weight:bold">=</span>bin <span style="color:#79c0ff">tipdir</span><span style="color:#ff7b72;font-weight:bold">=</span>share/doc/perf-6.8 <span style="color:#a5d6ff">&#39;EXTRA_CFLAGS=-O2 -pipe&#39;</span> <span style="color:#a5d6ff">&#39;EXTRA_LDFLAGS=-Wl,-O1 -Wl,--as-needed&#39;</span> <span style="color:#79c0ff">ARCH</span><span style="color:#ff7b72;font-weight:bold">=</span>riscv <span style="color:#79c0ff">BUILD_BPF_SKEL</span><span style="color:#ff7b72;font-weight:bold">=</span> <span style="color:#79c0ff">BUILD_NONDISTRO</span><span style="color:#ff7b72;font-weight:bold">=</span><span style="color:#a5d6ff">1</span> <span style="color:#79c0ff">JDIR</span><span style="color:#ff7b72;font-weight:bold">=</span> <span style="color:#79c0ff">CORESIGHT</span><span style="color:#ff7b72;font-weight:bold">=</span> <span style="color:#79c0ff">GTK2</span><span style="color:#ff7b72;font-weight:bold">=</span> feature-gtk2-infobar<span style="color:#ff7b72;font-weight:bold">=</span> <span style="color:#79c0ff">NO_AUXTRACE</span><span style="color:#ff7b72;font-weight:bold">=</span> <span style="color:#79c0ff">NO_BACKTRACE</span><span style="color:#ff7b72;font-weight:bold">=</span> <span style="color:#79c0ff">NO_DEMANGLE</span><span style="color:#ff7b72;font-weight:bold">=</span> <span style="color:#79c0ff">NO_JEVENTS</span><span style="color:#ff7b72;font-weight:bold">=</span><span style="color:#a5d6ff">0</span>
</span></span></code></pre></div><p><strong>Note</strong>: Cross compile fails, so just build it on your board. It will take around 10mins on Milk-V jupiter.</p>
<h2 class="heading" id="how-to-run-perf">How to run perf</h2>
<div class="highlight"><pre tabindex="0" style="color:#e6edf3;background-color:#0d1117;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>sudo perf record -e u_mode_cycle ls
</span></span><span style="display:flex;"><span>sudo perf report <span style="color:#8b949e;font-style:italic"># You might not need a root permission</span>
</span></span></code></pre></div><p>There's other <code>-e</code> options you can try, Read lu_zero's article.<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup></p>
<div class="highlight"><pre tabindex="0" style="color:#e6edf3;background-color:#0d1117;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>perf record --group -e u_mode_cycle,m_mode_cycle,s_mode_cycle
</span></span><span style="display:flex;"><span>perf record --group -e alu_inst,amo_inst,atomic_inst,fp_div_inst,fp_inst,fp_load_inst,fp_store_inst,load_inst,lr_inst,mult_inst,sc_inst,store_inst,unaligned_load_inst,unaligned_store_inst
</span></span></code></pre></div><h2 class="heading" id="what-about-dav1d">What about dav1d?</h2>
<p>I used this way:</p>
<div class="highlight"><pre tabindex="0" style="color:#e6edf3;background-color:#0d1117;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>sudo perf record -e u_mode_cycle dav1d -i sample_video.ivf -o /dev/null
</span></span></code></pre></div><h2 class="heading" id="vendors-official-documentation">Vendor's Official documentation</h2>
<p>I found this document<sup id="fnref:2"><a href="#fn:2" class="footnote-ref" role="doc-noteref">2</a></sup> on Internet.</p>
<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p><a href="https://dev.to/luzero/bringing-up-bpi-f3-part-25-27o4">lu_zero's article</a>&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:2">
<p><a href="https://bianbu.spacemit.com/en/development/perf/">Spacemit's Development Guide</a>&#160;<a href="#fnref:2" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></description></item></channel></rss>