The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Freescale i.MX6 video driver
mastermind


Joined: 06 Jun 2013
Posts: 10
Hi! I've just done video driver for rendering directly to framebuffer, it should work on any custom board with i.MX6 processor. Supported windows management, both OpenGL ES 1.0 and OpenGL ES 2.0.
You can view the code from https://github.com/mastermind-/SDL-mx6/tree/release-2.0.3-mx6.
What do you think about the code? Have any remarks?
I'd be glad if someone will find it useful. May be it can be pushed to upstream?
Freescale i.MX6 video driver
Sam Lantinga


Joined: 10 Sep 2009
Posts: 1765
Sweet, thanks! Smile


On Mon, Aug 25, 2014 at 6:08 AM, mastermind wrote:
Quote:
Hi! I've just done video driver for rendering directly to framebuffer, it should work on any custom board with i.MX6 processor. Supported windows management, both OpenGL ES 1.0 and OpenGL ES 2.0.
You can view the code from https://github.com/mastermind-/SDL-mx6/tree/release-2.0.3-mx6.
What do you think about the code? Have any remarks?
I'd be glad if someone will find it useful. May be it can be pushed to upstream?


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Freescale i.MX6 video driver
Sam Lantinga


Joined: 10 Sep 2009
Posts: 1765
Do you have a patch or set of patches against SDL in Mercurial?


On Mon, Aug 25, 2014 at 6:08 AM, mastermind wrote:
Quote:
Hi! I've just done video driver for rendering directly to framebuffer, it should work on any custom board with i.MX6 processor. Supported windows management, both OpenGL ES 1.0 and OpenGL ES 2.0.
You can view the code from https://github.com/mastermind-/SDL-mx6/tree/release-2.0.3-mx6.
What do you think about the code? Have any remarks?
I'd be glad if someone will find it useful. May be it can be pushed to upstream?


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Freescale i.MX6 video driver
gabomdq


Joined: 28 Jul 2011
Posts: 495
Location: Argentina
There's another related patch here: https://bugzilla.libsdl.org/show_bug.cgi?id=2386

I think we need to figure out a way to consolidate these under a "SOC" backend, or risk having a ton of 99% similar backends, and that will become a support nightmare.


2014-08-29 10:07 GMT-03:00 mastermind:




--
Gabriel.
Re: Freescale i.MX6 video driver
mastermind


Joined: 06 Jun 2013
Posts: 10
You can get patches from github:
https://github.com/mastermind-/SDL-mx6/commit/e7f55c855d6336d9892d5f811d0a06e5d35b9780.patch - master
https://github.com/mastermind-/SDL-mx6/commit/ebc2901f67ee82ef555845c17f39b9663ab98225.patch - 2.0.3

Sam Lantinga wrote:
Do you have a patch or set of patches against SDL in Mercurial?


On Mon, Aug 25, 2014 at 6:08 AM, mastermind wrote:
Quote:
Hi! I've just done video driver for rendering directly to framebuffer, it should work on any custom board with i.MX6 processor. Supported windows management, both OpenGL ES 1.0 and OpenGL ES 2.0.
You can view the code from https://github.com/mastermind-/SDL-mx6/tree/release-2.0.3-mx6.
What do you think about the code? Have any remarks?
I'd be glad if someone will find it useful. May be it can be pushed to upstream?


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Re: Freescale i.MX6 video driver
mastermind


Joined: 06 Jun 2013
Posts: 10
Didn't know about this patch.
Nice work, but mine is little better Smile
1) Loads EGL library dinamically. In theory it can be compiled with X/directfb/wayland drivers too, they will share EGL native types definitions, which are binary compatible. Ideally, SDL_egl.c should be compiled separately for every driver.
2) Doesn't have code garbage from rpi driver Smile
3) Build using cmake

Btw, it doesn't 100% fit to common "SOC" backend because to load EGL library using SDL_GL_LoadLibrary it should get native display using function from this library Smile That's why I had to reimplement SDL_GL_LoadLibrary.

gabomdq wrote:
There's another related patch here: https://bugzilla.libsdl.org/show_bug.cgi?id=2386

I think we need to figure out a way to consolidate these under a "SOC" backend, or risk having a ton of 99% similar backends, and that will become a support nightmare.


2014-08-29 10:07 GMT-03:00 mastermind:




--
Gabriel.
Freescale i.MX6 video driver
Sam Lantinga


Joined: 10 Sep 2009
Posts: 1765
Okay, this patch is in SDL, thanks!

I added an additional change so the correct desktop video mode is reported.

Cheers!


On Fri, Aug 29, 2014 at 6:52 AM, mastermind wrote:
Quote:
Didn't know about this patch.
Nice work, but mine is little better
1) Loads EGL library dinamically. In theory it can be compiled with X/directfb/wayland drivers too, they will share EGL native types definitions, which are binary compatible. Ideally, SDL_egl.c should be compiled separately for every driver.
2) Doesn't have code garbage from rpi driver
3) Build using cmake

Btw, it doesn't 100% fit to common "SOC" backend because to load EGL library using SDL_GL_LoadLibrary it should get native display using function from this library That's why I had to reimplement SDL_GL_LoadLibrary.




gabomdq wrote:

There's another related patch here: https://bugzilla.libsdl.org/show_bug.cgi?id=2386

I think we need to figure out a way to consolidate these under a "SOC" backend, or risk having a ton of 99% similar backends, and that will become a support nightmare.


2014-08-29 10:07 GMT-03:00 mastermind <>:



Quote:

You can get patches from github:
https://github.com/mastermind-/SDL-mx6/commit/5e64a9fffb73192c0e56fbf300cbbfd7081dc16d.patch - master
https://github.com/mastermind-/SDL-mx6/commit/73681170adcb7330f41044c1b82857f4bcdd6006.patch - 2.0.3


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org








--
Gabriel.





_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Re: Freescale i.MX6 video driver
mastermind


Joined: 06 Jun 2013
Posts: 10
Hi! I've already fixed this issue few days before - https://github.com/mastermind-/SDL-mx6/commit/99ecdd7ecc2ffac300ef8e9b200e2c829cb619e1.patch
I've found error in your patch: in MX6_GLES_LoadLibrary you are calling eglGetDisplay with native_display which is not initialized yet (it will be filled in MX6_UpdateDisplay later) and egl_display will be invalid. Although It may work on some cases when eglGetDisplay(0) returns valid egl_display, but fbGetDisplayByIndex can return non-zero value (in my case).
Please apply my patch, it's tested and now in production Smile


Sam Lantinga wrote:
Okay, this patch is in SDL, thanks!

I added an additional change so the correct desktop video mode is reported.

Cheers!


On Fri, Aug 29, 2014 at 6:52 AM, mastermind wrote:
Quote:
Didn't know about this patch.
Nice work, but mine is little better
1) Loads EGL library dinamically. In theory it can be compiled with X/directfb/wayland drivers too, they will share EGL native types definitions, which are binary compatible. Ideally, SDL_egl.c should be compiled separately for every driver.
2) Doesn't have code garbage from rpi driver
3) Build using cmake

Btw, it doesn't 100% fit to common "SOC" backend because to load EGL library using SDL_GL_LoadLibrary it should get native display using function from this library That's why I had to reimplement SDL_GL_LoadLibrary.




gabomdq wrote:

There's another related patch here: https://bugzilla.libsdl.org/show_bug.cgi?id=2386

I think we need to figure out a way to consolidate these under a "SOC" backend, or risk having a ton of 99% similar backends, and that will become a support nightmare.


2014-08-29 10:07 GMT-03:00 mastermind <>:



Quote:

You can get patches from github:
https://github.com/mastermind-/SDL-mx6/commit/5e64a9fffb73192c0e56fbf300cbbfd7081dc16d.patch - master
https://github.com/mastermind-/SDL-mx6/commit/73681170adcb7330f41044c1b82857f4bcdd6006.patch - 2.0.3


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org








--
Gabriel.





_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Freescale i.MX6 video driver
Sam Lantinga


Joined: 10 Sep 2009
Posts: 1765
Can you provide a patch relative to the current code in Mercurial?

Thanks!



On Thu, Sep 11, 2014 at 5:00 AM, mastermind wrote:
Quote:
Hi! I've already fixed this issue few days before - https://github.com/mastermind-/SDL-mx6/commit/99ecdd7ecc2ffac300ef8e9b200e2c829cb619e1.patch
I've found error in your patch: in MX6_GLES_LoadLibrary you are calling eglGetDisplay with native_display which is not initialized yet (it will be filled in MX6_UpdateDisplay later) and egl_display will be invalid. Although It may work on some cases when eglGetDisplay(0) returns valid egl_display, but fbGetDisplayByIndex can return non-zero value (in my case).
Please apply my patch, it's tested and now in production





Sam Lantinga wrote:

Okay, this patch is in SDL, thanks!

I added an additional change so the correct desktop video mode is reported.

Cheers!


On Fri, Aug 29, 2014 at 6:52 AM, mastermind <> wrote:



Quote:

Didn't know about this patch.
Nice work, but mine is little better
1) Loads EGL library dinamically. In theory it can be compiled with X/directfb/wayland drivers too, they will share EGL native types definitions, which are binary compatible. Ideally, SDL_egl.c should be compiled separately for every driver.
2) Doesn't have code garbage from rpi driver
3) Build using cmake

Btw, it doesn't 100% fit to common "SOC" backend because to load EGL library using SDL_GL_LoadLibrary it should get native display using function from this library That's why I had to reimplement SDL_GL_LoadLibrary.




gabomdq wrote:

There's another related patch here: https://bugzilla.libsdl.org/show_bug.cgi?id=2386

I think we need to figure out a way to consolidate these under a "SOC" backend, or risk having a ton of 99% similar backends, and that will become a support nightmare.


2014-08-29 10:07 GMT-03:00 mastermind <>:



Quote:

You can get patches from github:
https://github.com/mastermind-/SDL-mx6/commit/5e64a9fffb73192c0e56fbf300cbbfd7081dc16d.patch - master
https://github.com/mastermind-/SDL-mx6/commit/73681170adcb7330f41044c1b82857f4bcdd6006.patch - 2.0.3


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org








--
Gabriel.





_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org










_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Freescale i.MX6 video driver
Sam Lantinga


Joined: 10 Sep 2009
Posts: 1765
I think I fixed this, can you confirm?https://hg.libsdl.org/SDL/rev/dbd8fe54ebb9





On Thu, Sep 11, 2014 at 5:00 AM, mastermind wrote:
Quote:
Hi! I've already fixed this issue few days before - https://github.com/mastermind-/SDL-mx6/commit/99ecdd7ecc2ffac300ef8e9b200e2c829cb619e1.patch
I've found error in your patch: in MX6_GLES_LoadLibrary you are calling eglGetDisplay with native_display which is not initialized yet (it will be filled in MX6_UpdateDisplay later) and egl_display will be invalid. Although It may work on some cases when eglGetDisplay(0) returns valid egl_display, but fbGetDisplayByIndex can return non-zero value (in my case).
Please apply my patch, it's tested and now in production





Sam Lantinga wrote:

Okay, this patch is in SDL, thanks!

I added an additional change so the correct desktop video mode is reported.

Cheers!


On Fri, Aug 29, 2014 at 6:52 AM, mastermind <> wrote:



Quote:

Didn't know about this patch.
Nice work, but mine is little better
1) Loads EGL library dinamically. In theory it can be compiled with X/directfb/wayland drivers too, they will share EGL native types definitions, which are binary compatible. Ideally, SDL_egl.c should be compiled separately for every driver.
2) Doesn't have code garbage from rpi driver
3) Build using cmake

Btw, it doesn't 100% fit to common "SOC" backend because to load EGL library using SDL_GL_LoadLibrary it should get native display using function from this library That's why I had to reimplement SDL_GL_LoadLibrary.




gabomdq wrote:

There's another related patch here: https://bugzilla.libsdl.org/show_bug.cgi?id=2386

I think we need to figure out a way to consolidate these under a "SOC" backend, or risk having a ton of 99% similar backends, and that will become a support nightmare.


2014-08-29 10:07 GMT-03:00 mastermind <>:



Quote:

You can get patches from github:
https://github.com/mastermind-/SDL-mx6/commit/5e64a9fffb73192c0e56fbf300cbbfd7081dc16d.patch - master
https://github.com/mastermind-/SDL-mx6/commit/73681170adcb7330f41044c1b82857f4bcdd6006.patch - 2.0.3


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org








--
Gabriel.





_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org










_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Re: Freescale i.MX6 video driver
mastermind


Joined: 06 Jun 2013
Posts: 10
Great! Now it's fixed, thanks Smile

Sam Lantinga wrote:
I think I fixed this, can you confirm?https://hg.libsdl.org/SDL/rev/dbd8fe54ebb9





On Thu, Sep 11, 2014 at 5:00 AM, mastermind wrote:
Quote:
Hi! I've already fixed this issue few days before - https://github.com/mastermind-/SDL-mx6/commit/99ecdd7ecc2ffac300ef8e9b200e2c829cb619e1.patch
I've found error in your patch: in MX6_GLES_LoadLibrary you are calling eglGetDisplay with native_display which is not initialized yet (it will be filled in MX6_UpdateDisplay later) and egl_display will be invalid. Although It may work on some cases when eglGetDisplay(0) returns valid egl_display, but fbGetDisplayByIndex can return non-zero value (in my case).
Please apply my patch, it's tested and now in production





Sam Lantinga wrote:

Okay, this patch is in SDL, thanks!

I added an additional change so the correct desktop video mode is reported.

Cheers!


On Fri, Aug 29, 2014 at 6:52 AM, mastermind <> wrote:



Quote:

Didn't know about this patch.
Nice work, but mine is little better
1) Loads EGL library dinamically. In theory it can be compiled with X/directfb/wayland drivers too, they will share EGL native types definitions, which are binary compatible. Ideally, SDL_egl.c should be compiled separately for every driver.
2) Doesn't have code garbage from rpi driver
3) Build using cmake

Btw, it doesn't 100% fit to common "SOC" backend because to load EGL library using SDL_GL_LoadLibrary it should get native display using function from this library That's why I had to reimplement SDL_GL_LoadLibrary.




gabomdq wrote:

There's another related patch here: https://bugzilla.libsdl.org/show_bug.cgi?id=2386

I think we need to figure out a way to consolidate these under a "SOC" backend, or risk having a ton of 99% similar backends, and that will become a support nightmare.


2014-08-29 10:07 GMT-03:00 mastermind <>:



Quote:

You can get patches from github:
https://github.com/mastermind-/SDL-mx6/commit/5e64a9fffb73192c0e56fbf300cbbfd7081dc16d.patch - master
https://github.com/mastermind-/SDL-mx6/commit/73681170adcb7330f41044c1b82857f4bcdd6006.patch - 2.0.3


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org








--
Gabriel.





_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org










_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Freescale i.MX6 video driver
Sam Lantinga


Joined: 10 Sep 2009
Posts: 1765
Great!

On Fri, Sep 12, 2014 at 9:52 PM, mastermind wrote:
Quote:
Great! Now it's fixed, thanks




Sam Lantinga wrote:

I think I fixed this, can you confirm?https://hg.libsdl.org/SDL/rev/dbd8fe54ebb9





On Thu, Sep 11, 2014 at 5:00 AM, mastermind <> wrote:



Quote:

Hi! I've already fixed this issue few days before - https://github.com/mastermind-/SDL-mx6/commit/99ecdd7ecc2ffac300ef8e9b200e2c829cb619e1.patch
I've found error in your patch: in MX6_GLES_LoadLibrary you are calling eglGetDisplay with native_display which is not initialized yet (it will be filled in MX6_UpdateDisplay later) and egl_display will be invalid. Although It may work on some cases when eglGetDisplay(0) returns valid egl_display, but fbGetDisplayByIndex can return non-zero value (in my case).
Please apply my patch, it's tested and now in production





Sam Lantinga wrote:

Okay, this patch is in SDL, thanks!

I added an additional change so the correct desktop video mode is reported.

Cheers!


On Fri, Aug 29, 2014 at 6:52 AM, mastermind <> wrote:



Quote:

Didn't know about this patch.
Nice work, but mine is little better
1) Loads EGL library dinamically. In theory it can be compiled with X/directfb/wayland drivers too, they will share EGL native types definitions, which are binary compatible. Ideally, SDL_egl.c should be compiled separately for every driver.
2) Doesn't have code garbage from rpi driver
3) Build using cmake

Btw, it doesn't 100% fit to common "SOC" backend because to load EGL library using SDL_GL_LoadLibrary it should get native display using function from this library That's why I had to reimplement SDL_GL_LoadLibrary.




gabomdq wrote:

There's another related patch here: https://bugzilla.libsdl.org/show_bug.cgi?id=2386

I think we need to figure out a way to consolidate these under a "SOC" backend, or risk having a ton of 99% similar backends, and that will become a support nightmare.


2014-08-29 10:07 GMT-03:00 mastermind <>:



Quote:

You can get patches from github:
https://github.com/mastermind-/SDL-mx6/commit/5e64a9fffb73192c0e56fbf300cbbfd7081dc16d.patch - master
https://github.com/mastermind-/SDL-mx6/commit/73681170adcb7330f41044c1b82857f4bcdd6006.patch - 2.0.3


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org








--
Gabriel.





_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org










_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org










_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Freescale i.MX6 video driver
logic bin
Guest

Is this coincidence or what ? lol I just bought RIOT Board Wink 

On Sun, Sep 14, 2014 at 3:43 AM, Sam Lantinga wrote:
Quote:
Great!

On Fri, Sep 12, 2014 at 9:52 PM, mastermind wrote:


Quote:
Great! Now it's fixed, thanks




Sam Lantinga wrote:

I think I fixed this, can you confirm?https://hg.libsdl.org/SDL/rev/dbd8fe54ebb9





On Thu, Sep 11, 2014 at 5:00 AM, mastermind <> wrote:



Quote:

Hi! I've already fixed this issue few days before - https://github.com/mastermind-/SDL-mx6/commit/99ecdd7ecc2ffac300ef8e9b200e2c829cb619e1.patch
I've found error in your patch: in MX6_GLES_LoadLibrary you are calling eglGetDisplay with native_display which is not initialized yet (it will be filled in MX6_UpdateDisplay later) and egl_display will be invalid. Although It may work on some cases when eglGetDisplay(0) returns valid egl_display, but fbGetDisplayByIndex can return non-zero value (in my case).
Please apply my patch, it's tested and now in production





Sam Lantinga wrote:

Okay, this patch is in SDL, thanks!

I added an additional change so the correct desktop video mode is reported.

Cheers!


On Fri, Aug 29, 2014 at 6:52 AM, mastermind <> wrote:



Quote:

Didn't know about this patch.
Nice work, but mine is little better
1) Loads EGL library dinamically. In theory it can be compiled with X/directfb/wayland drivers too, they will share EGL native types definitions, which are binary compatible. Ideally, SDL_egl.c should be compiled separately for every driver.
2) Doesn't have code garbage from rpi driver
3) Build using cmake

Btw, it doesn't 100% fit to common "SOC" backend because to load EGL library using SDL_GL_LoadLibrary it should get native display using function from this library That's why I had to reimplement SDL_GL_LoadLibrary.




gabomdq wrote:

There's another related patch here: https://bugzilla.libsdl.org/show_bug.cgi?id=2386

I think we need to figure out a way to consolidate these under a "SOC" backend, or risk having a ton of 99% similar backends, and that will become a support nightmare.


2014-08-29 10:07 GMT-03:00 mastermind <>:



Quote:

You can get patches from github:
https://github.com/mastermind-/SDL-mx6/commit/5e64a9fffb73192c0e56fbf300cbbfd7081dc16d.patch - master
https://github.com/mastermind-/SDL-mx6/commit/73681170adcb7330f41044c1b82857f4bcdd6006.patch - 2.0.3


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org








--
Gabriel.





_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org










_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org












_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org





_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org





--
|LuD KiLlEr|