Re: [Mesa-dev] Dmabuf based render buffers!?

2021-01-15 Thread Blueroom
Hi and thanks for your replies!

Note though that I want to get hold of the image/pixels after they have
been processed by shader(s).
So not the raw texture being fed in.

So maybe it would be the contents of a FBO or similar.

Cheers
Fred

On Fri, Jan 15, 2021 at 3:59 AM Christian König <
ckoenig.leichtzumer...@gmail.com> wrote:

> Am 15.01.21 um 11:26 schrieb Michel Dänzer:
> > On 2021-01-14 8:02 p.m., Blueroom wrote:
> >>
> >> Hi Everyone!
> >>
> >> I have a program that’s using dmabuf’s to create a zero copy
> >> camera->GL texture pipeline and it’s working great on my RPi4.
> >>
> >> Now as a last step I want to access the pixels that Iv’e processed in
> >> gl with shaders, on the cpu.
> >>
> >> Iv’e been told that on the Raspberry Pi OpenGL is sharing the same
> >> memory as the cpu so I’m hoping it would be possible to do something
> >> like a dmabuf on the ‘way out’ too?
> >>
> >> Does anyone have any pointers in how this could work?
> >
> > I'd recommend using glGetTexImage or other similar GL APIs for getting
> > the data out of the GL texture.
> >
> > While mmap of a dma-buf file descriptor works in theory, direct CPU
> > reads from GPU accessible memory can be very slow on some platforms.
> >
>
> Yeah, agree. Additional to that you don't know the format of the DMA-buf
> of the texture.
>
> The input image is most likely linear, but the output might be tiled.
>
> Christian.
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] Dmabuf based render buffers!?

2021-01-15 Thread Christian König

Am 15.01.21 um 11:26 schrieb Michel Dänzer:

On 2021-01-14 8:02 p.m., Blueroom wrote:


Hi Everyone!

I have a program that’s using dmabuf’s to create a zero copy 
camera->GL texture pipeline and it’s working great on my RPi4.


Now as a last step I want to access the pixels that Iv’e processed in 
gl with shaders, on the cpu.


Iv’e been told that on the Raspberry Pi OpenGL is sharing the same 
memory as the cpu so I’m hoping it would be possible to do something 
like a dmabuf on the ‘way out’ too?


Does anyone have any pointers in how this could work?


I'd recommend using glGetTexImage or other similar GL APIs for getting 
the data out of the GL texture.


While mmap of a dma-buf file descriptor works in theory, direct CPU 
reads from GPU accessible memory can be very slow on some platforms.




Yeah, agree. Additional to that you don't know the format of the DMA-buf 
of the texture.


The input image is most likely linear, but the output might be tiled.

Christian.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] Dmabuf based render buffers!?

2021-01-15 Thread Michel Dänzer

On 2021-01-14 8:02 p.m., Blueroom wrote:


Hi Everyone!

I have a program that’s using dmabuf’s to create a zero copy camera->GL 
texture pipeline and it’s working great on my RPi4.


Now as a last step I want to access the pixels that Iv’e processed in gl 
with shaders, on the cpu.


Iv’e been told that on the Raspberry Pi OpenGL is sharing the same 
memory as the cpu so I’m hoping it would be possible to do something 
like a dmabuf on the ‘way out’ too?


Does anyone have any pointers in how this could work?


I'd recommend using glGetTexImage or other similar GL APIs for getting 
the data out of the GL texture.


While mmap of a dma-buf file descriptor works in theory, direct CPU 
reads from GPU accessible memory can be very slow on some platforms.



--
Earthling Michel Dänzer   |   https://redhat.com
Libre software enthusiast | Mesa and X developer
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] Supporting macOS / XQuartz on master

2021-01-15 Thread Jeremy Huddleston Sequoia
Hey folks,

I finally had a little bit of time to take a look at mesa and XQuartz for the 
first time in ~4 years.  I am incredibly impressed that there wasn't more 
bitrot.  I was expecting a painful few days since I've never looked at meson, 
but I was able to get it functional relatively quickly.

I have a few pull requests which I'd like to have some eyes on.

These first two are a meson configuration changes to pickup the system libexpat 
and libunwind (plus a build fix due to bad implicit casting in mesa's libunwind 
usage).  I'd appreciate someone with meson-fu to look them over and let me know 
if there's a better way to do this:

https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8501
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8502

This last one is probably a bit more political as it bumps our C language 
version from C99 to C11.  This is being done because we make use of 
timespec_get() which was added to C11.  Using -std=c99 will cause the prototype 
to be omitted from system headers on strictly compliant systems (eg: macOS) 
even when the system supports this function.

https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8496

Thanks in advance for looking these over.

--Jeremy

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] Dmabuf based render buffers!?

2021-01-15 Thread Blueroom
Hi Everyone!

I have a program that’s using dmabuf’s to create a zero copy camera->GL
texture pipeline and it’s working great on my RPi4.

Now as a last step I want to access the pixels that Iv’e processed in gl
with shaders, on the cpu.

Iv’e been told that on the Raspberry Pi OpenGL is sharing the same memory
as the cpu so I’m hoping it would be possible to do something like a dmabuf
on the ‘way out’ too?

Does anyone have any pointers in how this could work?

Cheers
Fred
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev