<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Hi Yiwei,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Looks like this thread is closed.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><a href="https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26038#note_2243187">https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26038#note_2243187</a><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Can we collaborate on this?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
<p class="MsoNormal">Srinivas<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Yiwei Zhang <zzyiwei@chromium.org> <br>
<b>Sent:</b> Monday, November 20, 2023 4:38 AM<br>
<b>To:</b> Srinivas Pullakavi (QUIC) <quic_spullaka@quicinc.com><br>
<b>Cc:</b> Rob Clark <robdclark@gmail.com>; mesa-dev@lists.freedesktop.org<br>
<b>Subject:</b> Re: GBM as standalone buffer allocator<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">There’s <o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal"><a href="https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26038">https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26038</a>. It is quite appealing to me considering a VK only scenario.<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Thu, Nov 2, 2023 at 5:50 AM Srinivas Pullakavi (QUIC) <<a href="mailto:quic_spullaka@quicinc.com">quic_spullaka@quicinc.com</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">Hi Rob,<br>
<br>
Thanks for your inputs.<br>
<br>
We are planning to use DMA-Buf for GBM backend. DMA-buf supported heaps are listed in /dev/dma_heap/<br>
Gbm backend selects the best heap based on usage. For example: Secure buffers will be allocated from secure heap.<br>
<br>
Sample output: <br>
# ls /dev/dma_heap<br>
reserved system<br>
<br>
Sample code to allocate a buffer from system heap:<br>
int heap_fd = open(/dev/dma_heap/system, O_RDONLY | O_CLOEXEC))<br>
struct dma_heap_allocation_data heap_data {<br>
.len = size, // length of data to be allocated in bytes<br>
.fd_flags = O_RDWR | O_CLOEXEC, // permissions for the memory to be allocated<br>
};<br>
int status = ioctl(heap_fd, DMA_HEAP_IOCTL_ALLOC, &heap_data)<br>
if (status == 0) {<br>
int buffer_fd = heap_data.fd;<br>
}<br>
<br>
In this case, there is no dependency on display / Graphics driver. But still GBM create device expects a device fd to be passed.<br>
<br>
Can we make it optional to pass device fd ?<br>
<br>
Thanks,<br>
Srinivas<br>
<br>
-----Original Message-----<br>
From: Rob Clark <<a href="mailto:robdclark@gmail.com" target="_blank">robdclark@gmail.com</a>>
<br>
Sent: Tuesday, October 24, 2023 1:06 AM<br>
To: Srinivas Pullakavi (QUIC) <<a href="mailto:quic_spullaka@quicinc.com" target="_blank">quic_spullaka@quicinc.com</a>><br>
Cc: <a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
Subject: Re: GBM as standalone buffer allocator<br>
<br>
On Mon, Oct 23, 2023 at 6:22 AM Srinivas Pullakavi (QUIC) <<a href="mailto:quic_spullaka@quicinc.com" target="_blank">quic_spullaka@quicinc.com</a>> wrote:<br>
><br>
> Hi,<br>
><br>
><br>
><br>
> We are planning to enhance GBM as a standalone buffer allocator, which <br>
> can be used for all multi-media clients. Ex: video, camera, display <br>
> etc;<br>
><br>
><br>
><br>
> GBM create device expects a file descriptor to be passed, which points to drm node. This brings in a dependency on display for buffer allocation. On headless devices where display driver is not present, GBM cannot be used for buffer allocations. E.g. Recording
cases where pipeline is setup between Camera, Video, Graphics.<br>
><br>
<br>
Note that you need some sort of device to allocate buffers from. With mesa and upstream kernel, that would be the drm device. (However as Adam points out, a drm device does not necessarily need a display..<br>
for example, several vendors have compute-only GPUs (pci) which have no display outputs.)<br>
<br>
You might want to look at ChromeOS's minigbm. It already handles these cases (buffer sharing across display/gpu/video/camera).<br>
<br>
BR,<br>
-R<br>
<br>
[1] <a href="https://chromium.googlesource.com/chromiumos/platform/minigbm/" target="_blank">
https://chromium.googlesource.com/chromiumos/platform/minigbm/</a><br>
<br>
><br>
> Could you please share your comments on what will be a good design to make GBM flexible for above?<br>
><br>
><br>
><br>
> Thanks,<br>
><br>
> Srinivas<br>
><br>
><o:p></o:p></p>
</blockquote>
</div>
</div>
</div>
</body>
</html>