LWN: Comments on "Vetter: Why no 2D Userspace API in DRM?" https://lwn.net/Articles/763165/ This is a special feed containing comments posted to the individual LWN article titled "Vetter: Why no 2D Userspace API in DRM?". en-us Tue, 16 Sep 2025 13:17:10 +0000 Tue, 16 Sep 2025 13:17:10 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net Vetter: Why no 2D Userspace API in DRM? https://lwn.net/Articles/764467/ https://lwn.net/Articles/764467/ xxiao <div class="FormattedComment"> what about the simple device that has no GPU, i.e. how to support the framebuffer-based SDL2? There are so many low-end devices with no GPU and a simple screen that needs 2D API<br> </div> Sun, 09 Sep 2018 21:35:53 +0000 The future of OpenVG? https://lwn.net/Articles/763995/ https://lwn.net/Articles/763995/ excors <div class="FormattedComment"> I think OpenVG was about as irrelevant in 2017 as it is now. The OpenVG standard was last updated in 2008, and the blog post talks about low-end embedded devices that don't support OpenGL ES 2.0 (released 2007; obligatory for Android since 4.0 in 2011). And specifically it mentions the NXP iMX6 SoloLite and Vybrid VF5xxR, both first released somewhere around 2013.<br> <p> OpenVG was and is obsolete; but obsolete embedded platforms can easily hang around for a decade and some people still want to write new software for them, so it's a niche that it might be worth Qt filling (especially if the work on Qt was funded by some company that decided it was cheaper than updating their hardware). But outside that niche, I don't think it has any significant value.<br> </div> Mon, 03 Sep 2018 09:53:25 +0000 The future of OpenVG? https://lwn.net/Articles/763991/ https://lwn.net/Articles/763991/ ssmith32 <div class="FormattedComment"> I wouldn't call a blog post from early 2017 recent...<br> Maybe OpenVG was more relevant then?<br> </div> Mon, 03 Sep 2018 02:51:04 +0000 Vetter: Why no 2D Userspace API in DRM? https://lwn.net/Articles/763324/ https://lwn.net/Articles/763324/ Sesse <div class="FormattedComment"> I doubt most of these devices accelerate glyph rendering. You just render them once and cache them.<br> <p> They still need to be blit to screen one by one, but then we're back to the “get a rectangle from A to B” land.<br> </div> Thu, 23 Aug 2018 18:27:32 +0000 Vetter: Why no 2D Userspace API in DRM? https://lwn.net/Articles/763304/ https://lwn.net/Articles/763304/ excors <div class="FormattedComment"> I have the impression that OpenVG had some minor popularity for pre-Android mobile devices, when the only alternative for graphics was OpenGL ES 1.1 (fixed-function, no shaders), and mobile GPUs all added support for it in case some potential customers wanted it. But it never really took off, then OpenGL ES 2.0 came along and mobile CPUs/GPUs got fast enough to render UIs with software (like Skia on Android) combined with OpenGL and hardware compositing, and nobody cared about OpenVG any more. Mobile GPUs continued to support it just because it took very little effort to maintain the drivers, especially when nobody was going to use it and care about performance or bugs. Nowadays it's just a dead standard, unless you're trying to support one of those equally dead pre-GLES2 chips that doesn't give you any other options.<br> </div> Thu, 23 Aug 2018 16:15:57 +0000 Vetter: Why no 2D Userspace API in DRM? https://lwn.net/Articles/763299/ https://lwn.net/Articles/763299/ louai <div class="FormattedComment"> Text rendering happens in two stages:<br> <p> 1) Rendering individual glyphs (usually cached)<br> 2) Putting these glyphs on screen<br> <p> Either one of those can be accelerated, but generally speaking you get a lot more bang for your buck by making the second step fast. And that second step is really just blitting to screen.<br> </div> Thu, 23 Aug 2018 15:28:27 +0000 Vetter: Why no 2D Userspace API in DRM? https://lwn.net/Articles/763298/ https://lwn.net/Articles/763298/ ledow <div class="FormattedComment"> Indeed... it looks like OpenVG is the standard we want.<br> <p> But people aren't putting it in hardware, so it's like having a lovely OpenGL standard, but no graphics card on the market supporting it with acceleration.<br> <p> (Don't be fooled by the conformant products page, only some of those appear under the OpenVG filter:<br> <a rel="nofollow" href="https://www.khronos.org/conformance/adopters/conformant-products#openvg">https://www.khronos.org/conformance/adopters/conformant-p...</a><br> )<br> <p> The article dismisses it out of hand because of this (and that it was then removed from Mesa because nobody was using it), but it seems to solution is to make decent OpenVG acceleration drivers for whatever we need until it gains traction.<br> <p> Surely those devices that already have open-source drivers should be quite easy to get onboard?<br> </div> Thu, 23 Aug 2018 15:27:15 +0000 Vetter: Why no 2D Userspace API in DRM? https://lwn.net/Articles/763293/ https://lwn.net/Articles/763293/ jnareb <div class="FormattedComment"> There is 2D rendering standard by Khronos (organization behind OpenGL and Vulcan), namely OpenVG, but I don't think it is popular (as opposed to OpenGL).<br> </div> Thu, 23 Aug 2018 14:24:07 +0000 Vetter: Why no 2D Userspace API in DRM? https://lwn.net/Articles/763288/ https://lwn.net/Articles/763288/ nim-nim <div class="FormattedComment"> Most people will assume 2D includes text. And text is definitely "lines and circles and curves".<br> <p> Text is the 2D rendering deal-breaker, unless you restrict yourself to ASCII-only single-size bitmap fonts, that do not work on hidpi screens, and that users loathe.<br> <p> Even basic video players are increasingly expected to render nice non-pixelated i18n subtitles.<br> </div> Thu, 23 Aug 2018 14:17:36 +0000 Vetter: Why no 2D Userspace API in DRM? https://lwn.net/Articles/763256/ https://lwn.net/Articles/763256/ excors <div class="FormattedComment"> As far as I can tell, what Imagination means by "deferred" in TBDR is that fragment shading is deferred until after visibility is completely determined, specifically using their patented hidden surface removal technique. That's what they claim makes them unique and the best.<br> <p> Other mobile GPUs (which Imagination calls TBR, i.e. not deferred) are basically the same, they just use different (perhaps slightly less optimal) hidden surface removal techniques. They still defer rasterisation until after the entire frame has been submitted and vertex-processed and binned. So the TBR/TBDR distinction is not much more than a marketing tactic, and I think it's sensible to just use the term "tile-based" for all of those GPUs, because their whole pipeline is fundamentally designed around tiles.<br> <p> That's very different from NVIDIA's Maxwell, which still processes draw calls sequentially, and just uses one extra level of tiles when rasterising compared to older GPUs (~256x512 split into 16x16 split into 4x8 split into 2x2). So I'm just quibbling about grouping that together with the other 'tile-based' GPUs because it's not the same at all, except in the trivial sense that every GPU uses some kinds of tiles somewhere.<br> <p> Anyway, I don't mean to disagree with your point, I just think that NVIDIA video/article spread misinformation about Maxwell being much more similar to mobile GPUs than it really is, and I can't resist the urge to try to clarify that whenever it comes up :-)<br> </div> Thu, 23 Aug 2018 12:43:16 +0000 Vetter: Why no 2D Userspace API in DRM? https://lwn.net/Articles/763250/ https://lwn.net/Articles/763250/ daniels <div class="FormattedComment"> Yes, Imagination helpfully conflated the two concepts into the 'tile-based deferred rendering' catchphrase. GPUs can be tiled or not, deferred or immediate. There's a huge mix of both around. The only reason I brought it up is because the original poster conflated the two, and to point out that tiled render targets are not the same thing as using quads rather than triangles as a primitive.<br> </div> Thu, 23 Aug 2018 11:26:58 +0000 Vetter: Why no 2D Userspace API in DRM? https://lwn.net/Articles/763248/ https://lwn.net/Articles/763248/ excors <div class="FormattedComment"> (If I remember correctly, NVIDIA's version is not really that similar to mobile GPUs.<br> <p> Mobile GPUs can render many draw calls and state changes, possibly the entire frame, into one tile before moving onto the next tile. The driver has to be careful to insert pipeline flushes if a pixel depends on the output from an 'earlier' draw call in a different tile, and avoid all unnecessary flushes - ideally it can render the entire frame with zero reads of the framebuffer from RAM.<br> <p> The NVIDIA behaviour described in that video is (when I tested it on a GTX 970) limited to working within a single draw call. That draw call's primitives are rasterised in a tile-based order (over large ~256x512 tiles, subdivided between the GPU's 4 raster engines), but it waits until that draw call is fully rasterised before starting the first tile of the next draw call. And if the draw call generates more than about 64KB of primitive data, the first 64KB gets fully rasterised before moving onto the next chunk of primitives. That means draw calls and other state changes remain fully sequential as before, which makes it simpler and hugely less effective than mobile GPUs at avoiding framebuffer-to/from-(V)RAM traffic, though still somewhat better than earlier NVIDIA GPUs.)<br> </div> Thu, 23 Aug 2018 10:27:19 +0000 Vetter: Why no 2D Userspace API in DRM? https://lwn.net/Articles/763245/ https://lwn.net/Articles/763245/ kusma <div class="FormattedComment"> You can pass the equivalent of DDA initial error as the window-space fractional value. The 3D APIs are all floating-point.<br> </div> Thu, 23 Aug 2018 10:00:00 +0000 Vetter: Why no 2D Userspace API in DRM? https://lwn.net/Articles/763241/ https://lwn.net/Articles/763241/ Sesse <div class="FormattedComment"> I guess we need to talk about what “2D rendering” means first. Nobody really cares about accelerated pretty 2D lines and circles and such these days; it's all about getting an image from A to B, possibly including color conversion and rescaling (it depends a bit).<br> <p> In this understanding of “2D rendering” 3D engines can and do 2D rendering; your composited desktop (even without wobbly windows) is an example. Quads are rendered as two triangles—that's not a problem at all. But they're not suitable for extremely embedded platforms, since they use more area, gates and power than a pure 2D engine would do.<br> </div> Thu, 23 Aug 2018 09:08:06 +0000 Vetter: Why no 2D Userspace API in DRM? https://lwn.net/Articles/763237/ https://lwn.net/Articles/763237/ daniels <p>Tiling is something different. Tiling means that you slice your square buffers up into smaller square regions, e.g. 32x32, and operate on those smaller regions one at a time. A lot of 3D GPUs do this: PowerVR (in the iPhone and Dreamcast as you noted), Arm Mali (in basically every non-Qualcomm mobile device), Qualcomm/freedreno, VC4 (Raspberry Pi), even <a href="https://youtu.be/Nc6R1hwXhL8">NVIDIA does it</a>.</p> <p>This doesn't change the choice of primitive though. Whether tiled/deferred or fully immediate, 3D GPUs still operate on triangles. On the iPhone, you still need to splice two triangles together to make a quad. The only 3D GPU which operated on quads was the extremely early NVIDIA GPUs, which operated on quads rather than triangles. But that didn't last further than the Sega Saturn.</p> <p>Anyway, manipulating 2D images isn't what 3D GPUs are optimised for. It is, on the other hand, what 2D engines are optimised for, and they can make choices about image quality which would be unavailable to a 3D GPU, for reasons of architecture or performance.</p> Thu, 23 Aug 2018 07:20:01 +0000 Vetter: Why no 2D Userspace API in DRM? https://lwn.net/Articles/763234/ https://lwn.net/Articles/763234/ blackwood <div class="FormattedComment"> I guess I wasn't entirely clear in the blog: The problem isn't that there's no standards at all, but that there's no universally adopted 2D rendering standard everyone could aim for (like we have with OpenGL/Vulkan on the 3D side). The list of 2D rendering standard absolutely, each with their own little niche, is extremely long. And a standard without good adoption is useless.<br> </div> Thu, 23 Aug 2018 06:31:26 +0000 Vetter: Why no 2D Userspace API in DRM? https://lwn.net/Articles/763231/ https://lwn.net/Articles/763231/ luya The only reason 2D engine seems to give better image quality is mainly due to familiarity compared to the 3D engine. The key part is the way engine renders object. Tile-based method (or deferred texture if I remember right) is a popular application on mobile device (previous Apple iPhone series and Sega Dreamcast are one notable examples) to due to power efficiency and the fact it only render visible objects thus avoid to use invisible object on screen unless done on purpose. So 3D engine can surpass dedicated 2D version when applied correctly. Thu, 23 Aug 2018 04:48:00 +0000 Vetter: Why no 2D Userspace API in DRM? https://lwn.net/Articles/763220/ https://lwn.net/Articles/763220/ Cyberax <div class="FormattedComment"> Well, these days you'd just use a fragment shader to do it.<br> </div> Wed, 22 Aug 2018 23:01:28 +0000 Vetter: Why no 2D Userspace API in DRM? https://lwn.net/Articles/763217/ https://lwn.net/Articles/763217/ jreiser <div class="FormattedComment"> I have not seen a 3D API than can draw correctly an arbitrary 2D straight line. Hint: a 2D line requires 5 parameters; the 3D APIs take only 4, and do not let you set the initial error value of the DDA (digital difference analyzer). Thus in general you cannot match a clipped line pixel-for-pixel. The NEC 7220 chip did this correctly in 1981 (37 years ago.)<br> </div> Wed, 22 Aug 2018 22:58:34 +0000 Vetter: Why no 2D Userspace API in DRM? https://lwn.net/Articles/763203/ https://lwn.net/Articles/763203/ Cyberax <div class="FormattedComment"> If you have a 2D image and just want to show it on a screen then it's not a problem. You can just use it as a texture on a simple quad. It'll work acceptably well.<br> <p> The next question is, how do you MAKE this 2D image in the first place? <br> <p> And this is the core of the problem. It turns out to be not easy at all. Videocards can certainly render a lot of triangles into a texture very fast, but the quality will not be good for anti-aliased text.<br> <p> Also, it's not quite true that there are no standard 2D APIs. There's Direct2D and DirectWrite in Microsoftland: <a href="https://docs.microsoft.com/en-us/windows/desktop/direct2d/direct2d-overview">https://docs.microsoft.com/en-us/windows/desktop/direct2d...</a> - both are actually well designed and can render stunningly good text.<br> </div> Wed, 22 Aug 2018 20:35:03 +0000 Vetter: Why no 2D Userspace API in DRM? https://lwn.net/Articles/763197/ https://lwn.net/Articles/763197/ daniels One difference is that 2D engines operate on quads whereas 3D engines operate on triangles. 3D engines <em>can</em> certainly do flat 2D rendering, but it's not optimal. 2D engines typically give you better image quality, and what they certainly give you over 3D engines is much, much, lower power usage. Wed, 22 Aug 2018 20:22:26 +0000 Vetter: Why no 2D Userspace API in DRM? https://lwn.net/Articles/763196/ https://lwn.net/Articles/763196/ Beolach Going off on a funny tangent, reminds me of <a href="http://www.bbspot.com/News/2003/02/ati_ascii.html">New ATI Card Pushes Limits of ASCII Gaming</a> linked from nethack.org. <blockquote>"The VT100 standard has been around for years, but there really hasn't been a video card company willing to make a card for it."</blockquote> Wed, 22 Aug 2018 20:13:21 +0000 The future of OpenVG? https://lwn.net/Articles/763192/ https://lwn.net/Articles/763192/ sam.ravnborg <div class="FormattedComment"> First - nice blog post. Thanks! This answers a lot of open questions for me.<br> <p> Qt has recently posted the following blog post:<br> <a href="http://blog.qt.io/blog/2017/03/31/qt-quick-openvg/">http://blog.qt.io/blog/2017/03/31/qt-quick-openvg/</a><br> <p> With no support for OpenVG I wonder how Qt can utilize OpenVG on a Linux platform.<br> And maybe the simple answer is that they cannot, and OpenVG is only supported on simpler platforms.<br> <p> Anyway, it does not look like the effort of Qt using OpenVG has created any push to get OpenVG into mesa again<br> </div> Wed, 22 Aug 2018 19:53:19 +0000 Vetter: Why no 2D Userspace API in DRM? https://lwn.net/Articles/763190/ https://lwn.net/Articles/763190/ Tara_Li <div class="FormattedComment"> So, what do 3D engines do about those 2D faces that come up in their 3D polygons? Any 3D engine should of necessity contain a 2D engine, I would have thought.<br> </div> Wed, 22 Aug 2018 19:35:44 +0000