GSoC proposal for a DRM video backend

Hello!

I?m a French student who was thinking about applying for this Google
Summer of Code under the umbrella of SDL this year.

I was thinking about writing a DRM/GBM video backend during this
summer. For those who never heard of them, Direct Rendering Manager[1]
is the interface exposed by the kernel to allow userland access to the
GPU, and Graphics Buffer Manager[2] is the bridge between the platform
framebuffer, KMS[3] (the Kernel Mode Settings) and EGL[4] (the Native
Platform Interface).

This project would enable people to use an OpenGL- and OpenGLES-
accelerated SDL?2.0 on any platform supporting the modern UNIX graphic
stack without requiring an heavy and often useless X11 or Wayland
server.

I have a bit of experience on SDL?2.0, OpenGL and the whole Linux
graphic infrastructure, mainly thanks to a game I?m slowly working on,
PyTouhou[5] which I ported to SDL?2.0/OpenGL{,ES}.

I will write a more formal proposal tomorrow^Wtoday (I left time flee a
bit too much this time?), but I?m open to critics and suggestions
concerning that project, and I hope you will find it useful. :slight_smile:

[1] http://dri.sourceforge.net/doc/drm_low_level.html
[2] http://lists.freedesktop.org/archives/mesa-dev/2011-June/008726.html
[3] http://www.x.org/wiki/ModeSetting
[4] http://www.khronos.org/egl
[5] http://pytouhou.linkmauve.fr/--
Emmanuel Gil Peyrot
XMPP: <@Emmanuel_Gil_Peyrot>
OpenPGP: 24B1D609
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20130502/7b88fb30/attachment.pgp

That’s a rather unfortunate name!? When I first saw the title, I thought you
were talking about video with DRM (so-called Digital Rights Management,
a class of copy protection schemes that is universally regarded as pure
evil by pretty much everyone in the software industry, except for several
of the larger and sleazier publishers.)

Glad to see that’s not the case.

Mason________________________________
From: Emmanuel Gil Peyrot
To: sdl at lists.libsdl.org
Sent: Wednesday, May 1, 2013 5:18 PM
Subject: [SDL] GSoC proposal for a DRM video backend

Hello!

I?m a French student who was thinking about applying for this Google
Summer of Code under the umbrella of SDL this year.

I was thinking about writing a DRM/GBM video backend during this
summer.? For those who never heard of them, Direct Rendering Manager[1]
is the interface exposed by the kernel to allow userland access to the
GPU, and Graphics Buffer Manager[2] is the bridge between the platform
framebuffer, KMS[3] (the Kernel Mode Settings) and EGL[4] (the Native
Platform Interface).

This project would enable people to use an OpenGL- and OpenGLES-
accelerated SDL?2.0 on any platform supporting the modern UNIX graphic
stack without requiring an heavy and often useless X11 or Wayland
server.

I have a bit of experience on SDL?2.0, OpenGL and the whole Linux
graphic infrastructure, mainly thanks to a game I?m slowly working on,
PyTouhou[5] which I ported to SDL?2.0/OpenGL{,ES}.

I will write a more formal proposal tomorrow^Wtoday (I left time flee a
bit too much this time?), but I?m open to critics and suggestions
concerning that project, and I hope you will find it useful. :slight_smile:

[1] http://dri.sourceforge.net/doc/drm_low_level.html
[2] http://lists.freedesktop.org/archives/mesa-dev/2011-June/008726.html
[3] http://www.x.org/wiki/ModeSetting
[4] http://www.khronos.org/egl
[5] http://pytouhou.linkmauve.fr/


Emmanuel Gil Peyrot
XMPP:
OpenPGP: 24B1D609


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I swear, we should change the name from DRM to something else, it
causes more confusion than it should :stuck_out_tongue:

2013/5/1, Emmanuel Gil Peyrot :> Hello!

I?m a French student who was thinking about applying for this Google
Summer of Code under the umbrella of SDL this year.

I was thinking about writing a DRM/GBM video backend during this
summer. For those who never heard of them, Direct Rendering Manager[1]
is the interface exposed by the kernel to allow userland access to the
GPU, and Graphics Buffer Manager[2] is the bridge between the platform
framebuffer, KMS[3] (the Kernel Mode Settings) and EGL[4] (the Native
Platform Interface).

This project would enable people to use an OpenGL- and OpenGLES-
accelerated SDL?2.0 on any platform supporting the modern UNIX graphic
stack without requiring an heavy and often useless X11 or Wayland
server.

I have a bit of experience on SDL?2.0, OpenGL and the whole Linux
graphic infrastructure, mainly thanks to a game I?m slowly working on,
PyTouhou[5] which I ported to SDL?2.0/OpenGL{,ES}.

I will write a more formal proposal tomorrow^Wtoday (I left time flee a
bit too much this time?), but I?m open to critics and suggestions
concerning that project, and I hope you will find it useful. :slight_smile:

[1] http://dri.sourceforge.net/doc/drm_low_level.html
[2] http://lists.freedesktop.org/archives/mesa-dev/2011-June/008726.html
[3] http://www.x.org/wiki/ModeSetting
[4] http://www.khronos.org/egl
[5] http://pytouhou.linkmauve.fr/


Emmanuel Gil Peyrot
XMPP:
OpenPGP: 24B1D609

2013/5/1 Emmanuel Gil Peyrot

Hello!

I?m a French student who was thinking about applying for this Google
Summer of Code under the umbrella of SDL this year.

I was thinking about writing a DRM/GBM video backend during this
summer. For those who never heard of them, Direct Rendering Manager[1]
is the interface exposed by the kernel to allow userland access to the
GPU, and Graphics Buffer Manager[2] is the bridge between the platform
framebuffer, KMS[3] (the Kernel Mode Settings) and EGL[4] (the Native
Platform Interface).

This project would enable people to use an OpenGL- and OpenGLES-
accelerated SDL 2.0 on any platform supporting the modern UNIX graphic
stack without requiring an heavy and often useless X11 or Wayland
server.

I have a bit of experience on SDL 2.0, OpenGL and the whole Linux
graphic infrastructure, mainly thanks to a game I?m slowly working on,
PyTouhou[5] which I ported to SDL 2.0/OpenGL{,ES}.

I will write a more formal proposal tomorrow^Wtoday (I left time flee a
bit too much this time?), but I?m open to critics and suggestions
concerning that project, and I hope you will find it useful. :slight_smile:

[1] http://dri.sourceforge.net/doc/drm_low_level.html
[2] http://lists.freedesktop.org/archives/mesa-dev/2011-June/008726.html
[3] http://www.x.org/wiki/ModeSetting
[4] http://www.khronos.org/egl
[5] http://pytouhou.linkmauve.fr/

Hey, I’m one of the mentors for SDL this year, your proposal looks very
interesting. Two things I’d like to mention:

  1. With SDL nearing the 2.0 release, the focus this year is stabilization.
    Have you looked at our ideas page? (http://www.libsdl.org/gsoc.php) Do any
    of those project interest you?
  2. SDL has a DirectFB backend that I’ve been meaning to try in a non X11
    configuration since forever (specially in a Raspberry Pi), but I’ve never
    been able to. I suppose there’s going to be bugs and such, so I wonder if
    you have tried it. In any case, why do you think building a video backend
    from the ground up as you mentioned has more merit than improving/fixing
    the DirectFB backend? (It’s hard to convey a tone properly via email, so
    please let me assure your I’m not trying to shoot down the idea, I want
    your input as to the pros/cons of each alternative).

Thanks for taking the time answering these questions.–
Gabriel.

Hi Emmanuel,

yes - please apply with this project. Sounds quite interesting…

When you apply on the GSoC site [1], you’ll get an application template
with information to fill in. Mentors will provide feedback and you can
iterate over the proposal until the weekend deadline.

–Andreas

[1] http://www.google-melange.com/gsoc/homepage/google/gsoc2013On 5/1/2013 5:18 PM, Emmanuel Gil Peyrot wrote:

Hello!

I’m a French student who was thinking about applying for this Google
Summer of Code under the umbrella of SDL this year.

I was thinking about writing a DRM/GBM video backend during this
summer. For those who never heard of them, Direct Rendering Manager[1]
is the interface exposed by the kernel to allow userland access to the
GPU, and Graphics Buffer Manager[2] is the bridge between the platform
framebuffer, KMS[3] (the Kernel Mode Settings) and EGL[4] (the Native
Platform Interface).

This project would enable people to use an OpenGL- and OpenGLES-
accelerated SDL 2.0 on any platform supporting the modern UNIX graphic
stack without requiring an heavy and often useless X11 or Wayland
server.

I have a bit of experience on SDL 2.0, OpenGL and the whole Linux
graphic infrastructure, mainly thanks to a game I’m slowly working on,
PyTouhou[5] which I ported to SDL 2.0/OpenGL{,ES}.

I will write a more formal proposal tomorrow^Wtoday (I left time flee a
bit too much this time…), but I’m open to critics and suggestions
concerning that project, and I hope you will find it useful. :slight_smile:

[1] http://dri.sourceforge.net/doc/drm_low_level.html
[2] http://lists.freedesktop.org/archives/mesa-dev/2011-June/008726.html
[3] http://www.x.org/wiki/ModeSetting
[4] http://www.khronos.org/egl
[5] http://pytouhou.linkmauve.fr/


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

2013/5/1 Emmanuel Gil Peyrot <@Emmanuel_Gil_Peyrot>

Hello!

I?m a French student who was thinking about applying for this Google
Summer of Code under the umbrella of SDL this year.

I was thinking about writing a DRM/GBM video backend during this
summer. For those who never heard of them, Direct Rendering Manager[1]
is the interface exposed by the kernel to allow userland access to the
GPU, and Graphics Buffer Manager[2] is the bridge between the platform
framebuffer, KMS[3] (the Kernel Mode Settings) and EGL[4] (the Native
Platform Interface).

This project would enable people to use an OpenGL- and OpenGLES-
accelerated SDL 2.0 on any platform supporting the modern UNIX graphic
stack without requiring an heavy and often useless X11 or Wayland
server.

I have a bit of experience on SDL 2.0, OpenGL and the whole Linux
graphic infrastructure, mainly thanks to a game I?m slowly working on,
PyTouhou[5] which I ported to SDL 2.0/OpenGL{,ES}.

I will write a more formal proposal tomorrow^Wtoday (I left time flee a
bit too much this time?), but I?m open to critics and suggestions
concerning that project, and I hope you will find it useful. :slight_smile:

[1] http://dri.sourceforge.net/doc/drm_low_level.html
[2] http://lists.freedesktop.org/archives/mesa-dev/2011-June/008726.html
[3] http://www.x.org/wiki/ModeSetting
[4] http://www.khronos.org/egl
[5] http://pytouhou.linkmauve.fr/

Hey, I’m one of the mentors for SDL this year, your proposal looks very
interesting. Two things I’d like to mention:

  1. With SDL nearing the 2.0 release, the focus this year is stabilization.
    Have you looked at our ideas page? (http://www.libsdl.org/gsoc.php) Do any
    of those project interest you?

I have looked at it before starting my proposal, and even if I?m sure
that?d help the project a lot, I don?t think I could be of much help on
those. I don?t use or even have a license for proprietary or mobile
operating systems, and I?m not that good at testing (but I will write
the DRM-related ones if my proposal gets accepted!).

  1. SDL has a DirectFB backend that I’ve been meaning to try in a non X11
    configuration since forever (specially in a Raspberry Pi), but I’ve never
    been able to. I suppose there’s going to be bugs and such, so I wonder if
    you have tried it. In any case, why do you think building a video backend
    from the ground up as you mentioned has more merit than improving/fixing
    the DirectFB backend? (It’s hard to convey a tone properly via email, so
    please let me assure your I’m not trying to shoot down the idea, I want
    your input as to the pros/cons of each alternative).

I used to use it a lot on my old laptop, it is very nice to be able to
run most programs in a framebuffer just by changing an environment
variable. The downside is that on Linux, DirectFB uses the fbdev API
which has been deprecated and support almost no modern features, like
OpenGL acceleration, resolution changes, etc.

I guess I could also add a DRM backend to DirectFB, but then I don?t
know that library at all while I?m starting to have quite a good
overview of SDL and its subsystems. I will look in that library to
evaluate which one would be the best to improve, thanks for the hint.

Thanks for taking the time answering these questions.

Thanks to you for taking the time to help me for that proposal. ^^On Wed, May 01, 2013 at 09:42:27PM -0300, Gabriel Jacobo wrote:


Emmanuel Gil Peyrot
XMPP: <@Emmanuel_Gil_Peyrot>
OpenPGP: 24B1D609
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20130502/f254373c/attachment.pgp

Not to be picked, but you may want to change it to DRM Graphics, to avoid
confusion with digital rights management - I think this was touched on with
the other thread.On Thu, May 2, 2013 at 1:42 PM, Emmanuel Gil Peyrot wrote:

On Wed, May 01, 2013 at 09:42:27PM -0300, Gabriel Jacobo wrote:

2013/5/1 Emmanuel Gil Peyrot

Hello!

I?m a French student who was thinking about applying for this Google
Summer of Code under the umbrella of SDL this year.

I was thinking about writing a DRM/GBM video backend during this
summer. For those who never heard of them, Direct Rendering Manager[1]
is the interface exposed by the kernel to allow userland access to the
GPU, and Graphics Buffer Manager[2] is the bridge between the platform
framebuffer, KMS[3] (the Kernel Mode Settings) and EGL[4] (the Native
Platform Interface).

This project would enable people to use an OpenGL- and OpenGLES-
accelerated SDL 2.0 on any platform supporting the modern UNIX graphic
stack without requiring an heavy and often useless X11 or Wayland
server.

I have a bit of experience on SDL 2.0, OpenGL and the whole Linux
graphic infrastructure, mainly thanks to a game I?m slowly working on,
PyTouhou[5] which I ported to SDL 2.0/OpenGL{,ES}.

I will write a more formal proposal tomorrow^Wtoday (I left time flee a
bit too much this time?), but I?m open to critics and suggestions
concerning that project, and I hope you will find it useful. :slight_smile:

[1] http://dri.sourceforge.net/doc/drm_low_level.html
[2]
http://lists.freedesktop.org/archives/mesa-dev/2011-June/008726.html

[3] http://www.x.org/wiki/ModeSetting
[4] http://www.khronos.org/egl
[5] http://pytouhou.linkmauve.fr/

Hey, I’m one of the mentors for SDL this year, your proposal looks very
interesting. Two things I’d like to mention:

  1. With SDL nearing the 2.0 release, the focus this year is
    stabilization.
    Have you looked at our ideas page? (http://www.libsdl.org/gsoc.php) Do
    any
    of those project interest you?

I have looked at it before starting my proposal, and even if I?m sure
that?d help the project a lot, I don?t think I could be of much help on
those. I don?t use or even have a license for proprietary or mobile
operating systems, and I?m not that good at testing (but I will write
the DRM-related ones if my proposal gets accepted!).

  1. SDL has a DirectFB backend that I’ve been meaning to try in a non X11
    configuration since forever (specially in a Raspberry Pi), but I’ve never
    been able to. I suppose there’s going to be bugs and such, so I wonder if
    you have tried it. In any case, why do you think building a video backend
    from the ground up as you mentioned has more merit than improving/fixing
    the DirectFB backend? (It’s hard to convey a tone properly via email, so
    please let me assure your I’m not trying to shoot down the idea, I want
    your input as to the pros/cons of each alternative).

I used to use it a lot on my old laptop, it is very nice to be able to
run most programs in a framebuffer just by changing an environment
variable. The downside is that on Linux, DirectFB uses the fbdev API
which has been deprecated and support almost no modern features, like
OpenGL acceleration, resolution changes, etc.

I guess I could also add a DRM backend to DirectFB, but then I don?t
know that library at all while I?m starting to have quite a good
overview of SDL and its subsystems. I will look in that library to
evaluate which one would be the best to improve, thanks for the hint.

Thanks for taking the time answering these questions.

Thanks to you for taking the time to help me for that proposal. ^^


Emmanuel Gil Peyrot
XMPP:
OpenPGP: 24B1D609


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

True, I?ll use DRM/GBM everywhere now. I?m writing my proposal, and
will submit it shortly after.On Thu, May 02, 2013 at 01:45:17PM -0400, Alex Barry wrote:

Not to be picked, but you may want to change it to DRM Graphics, to avoid
confusion with digital rights management - I think this was touched on with
the other thread.


Emmanuel Gil Peyrot
XMPP: <@Emmanuel_Gil_Peyrot>
OpenPGP: 24B1D609
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20130502/03b4f585/attachment.pgp

You could also just not abbreviate it.

2013/5/2, Emmanuel Gil Peyrot :> On Thu, May 02, 2013 at 01:45:17PM -0400, Alex Barry wrote:

Not to be picked, but you may want to change it to DRM Graphics, to avoid
confusion with digital rights management - I think this was touched on
with
the other thread.

True, I?ll use DRM/GBM everywhere now. I?m writing my proposal, and
will submit it shortly after.


Emmanuel Gil Peyrot
XMPP:
OpenPGP: 24B1D609

Hello!

I?m a French student who was thinking about applying for this Google
Summer of Code under the umbrella of SDL this year.

I was thinking about writing a DRM/GBM video backend during this
summer. For those who never heard of them, Direct Rendering Manager[1]
is the interface exposed by the kernel to allow userland access to the
GPU, and Graphics Buffer Manager[2] is the bridge between the platform
framebuffer, KMS[3] (the Kernel Mode Settings) and EGL[4] (the Native
Platform Interface).

Out of curiosity, how would you do this in a portable way? With a portable
layer hiding card-specific glue?

St?phaneOn Wed, May 1, 2013 at 5:18 PM, Emmanuel Gil Peyrot wrote:

This project would enable people to use an OpenGL- and OpenGLES-
accelerated SDL 2.0 on any platform supporting the modern UNIX graphic
stack without requiring an heavy and often useless X11 or Wayland
server.

I have a bit of experience on SDL 2.0, OpenGL and the whole Linux
graphic infrastructure, mainly thanks to a game I?m slowly working on,
PyTouhou[5] which I ported to SDL 2.0/OpenGL{,ES}.

I will write a more formal proposal tomorrow^Wtoday (I left time flee a
bit too much this time?), but I?m open to critics and suggestions
concerning that project, and I hope you will find it useful. :slight_smile:

[1] http://dri.sourceforge.net/doc/drm_low_level.html
[2] http://lists.freedesktop.org/archives/mesa-dev/2011-June/008726.html
[3] http://www.x.org/wiki/ModeSetting
[4] http://www.khronos.org/egl
[5] http://pytouhou.linkmauve.fr/


Emmanuel Gil Peyrot
XMPP:
OpenPGP: 24B1D609


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Hello!

I?m a French student who was thinking about applying for this Google
Summer of Code under the umbrella of SDL this year.

I was thinking about writing a DRM/GBM video backend during this
summer. For those who never heard of them, Direct Rendering Manager[1]
is the interface exposed by the kernel to allow userland access to the
GPU, and Graphics Buffer Manager[2] is the bridge between the platform
framebuffer, KMS[3] (the Kernel Mode Settings) and EGL[4] (the Native
Platform Interface).

Out of curiosity, how would you do this in a portable way? With a portable
layer hiding card-specific glue?

Direct Rendering Manager is already that portable layer: you give the
name of a potential driver to drmOpen(), and if it succeeds it returns
a file descriptor. That?s how I?ve seen it used elsewhere.

St?phane

[snip]On Wed, May 01, 2013 at 05:42:46PM -0700, St?phane Marchesin wrote:

On Wed, May 1, 2013 at 5:18 PM, Emmanuel Gil Peyrot <@Emmanuel_Gil_Peyrot>wrote:


Emmanuel Gil Peyrot
XMPP: <@Emmanuel_Gil_Peyrot>
OpenPGP: 24B1D609
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20130503/ec4702f7/attachment.pgp

Hello!

I?m a French student who was thinking about applying for this Google
Summer of Code under the umbrella of SDL this year.

I was thinking about writing a DRM/GBM video backend during this
summer. For those who never heard of them, Direct Rendering Manager[1]
is the interface exposed by the kernel to allow userland access to the
GPU, and Graphics Buffer Manager[2] is the bridge between the platform
framebuffer, KMS[3] (the Kernel Mode Settings) and EGL[4] (the Native
Platform Interface).

Out of curiosity, how would you do this in a portable way? With a
portable
layer hiding card-specific glue?

Direct Rendering Manager is already that portable layer: you give the
name of a potential driver to drmOpen(), and if it succeeds it returns
a file descriptor. That?s how I?ve seen it used elsewhere.

Ah I missed initially that you were planning to use GBM, sorry :slight_smile:

St?phaneOn Thu, May 2, 2013 at 4:14 PM, Emmanuel Gil Peyrot wrote:

On Wed, May 01, 2013 at 05:42:46PM -0700, St?phane Marchesin wrote:

On Wed, May 1, 2013 at 5:18 PM, Emmanuel Gil Peyrot wrote:

2013/5/1 Emmanuel Gil Peyrot <@Emmanuel_Gil_Peyrot>
[snip]
2) SDL has a DirectFB backend that I’ve been meaning to try in a non X11
configuration since forever (specially in a Raspberry Pi), but I’ve never
been able to. I suppose there’s going to be bugs and such, so I wonder if
you have tried it. In any case, why do you think building a video backend
from the ground up as you mentioned has more merit than improving/fixing
the DirectFB backend? (It’s hard to convey a tone properly via email, so
please let me assure your I’m not trying to shoot down the idea, I want
your input as to the pros/cons of each alternative).

I?ve had a more throughout look into DirectFB and I think this is
definitely the way to go. This library already has an --enable-drmkms
option in its future 1.7 version (which I wasn?t able to get to work
yet, but the code is there).

I think that improving both the DirectFB backend of SDL and the DRM/KMS
backend of DirectFB is the way to go, and am proceeding to update my
proposal while taking into account the various remarks.On Wed, May 01, 2013 at 09:42:27PM -0300, Gabriel Jacobo wrote:


Emmanuel Gil Peyrot
XMPP: <@Emmanuel_Gil_Peyrot>
OpenPGP: 24B1D609
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20130503/f19a83c5/attachment.pgp