Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add vivante backend #1514

Closed
wants to merge 16 commits into from
Closed

[WIP] Add vivante backend #1514

wants to merge 16 commits into from

Conversation

YarikTH
Copy link

@YarikTH YarikTH commented Jun 20, 2019

This adds interface to graphics application to create i.MX Framebuffer to initialize graphics context without any window subsystems. Also provides input using /dev/input devices like linux_joystick.c does.

Modifies in GLFW library to add vivante backend.

This includes modifying a few existing files and creating five new files which are
specific to the backend that we are adding. For eg. in our case these are
vivante_platform.h, vivante_init.c, vivante_window.c, evdev.c, evdev.h .

Files "evdev.c", "evdev.h" can be used for other embended linux platforms.

Files "egl_context.h" and "internal.h" has minor changes to include the header files.
Also there are changes in CMake code files to include the newly created files.

Funtion glfwCreatePositionedWindow added and some platform code was adjusted to use it. It was done because window creation api in vivante doesn't support window position change nor window resize, both position and size set on creation time.

Example "gears-gles2.c" added because all examples use opengl 1.0 api, while my target board doesn't support OpenGL api, but supports GLES 2.0 api. This example is optional and can be removed.

Links to the api description:
https://www.nxp.com/docs/en/user-guide/i.MX_Graphics_User's_Guide_Linux.pdf
Chapter 4 i.MX Framebuffer API

P.S. SDL2 already supports this backed since 2.0.5

[![Build status](https://travis-ci.org/glfw/glfw.svg?branch=master)](https://travis-ci.org/glfw/glfw)
[![Build status](https://ci.appveyor.com/api/projects/status/0kf0ct9831i5l6sp/branch/master?svg=true)](https://ci.appveyor.com/project/elmindreda/glfw)
[![Coverity Scan](https://scan.coverity.com/projects/4884/badge.svg)](https://scan.coverity.com/projects/glfw-glfw)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea why it changes. Need to revert

*
* @ingroup window
*/
GLFWAPI GLFWwindow* glfwCreatePositionedWindow(int xpos, int ypos, int width, int height, const char* title, GLFWmonitor* monitor, GLFWwindow* share);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added to allow to create window in given position on vivante backend. But should be implemented for all other platforms. I implemented it for win, x11 and vivante platforms. Tested only on linux and vivante. Don't forget to update version in "since" tag.

@@ -255,6 +257,8 @@ struct _GLFWwndconfig
{
int width;
int height;
int xpos;
int ypos;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added to support positioned windows creation

if (xpos == GLFW_DONT_CARE)
xpos = CW_USEDEFAULT;
if (ypos == GLFW_DONT_CARE)
ypos = CW_USEDEFAULT;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

win32 positioned windows creation

src/x11_window.c Outdated
xpos = 0;
if (ypos == GLFW_DONT_CARE)
ypos = 0;
glfwSetWindowPos(window, xpos, ypos);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

x11 positioned windows creation

@YarikTH
Copy link
Author

YarikTH commented Jun 20, 2019

Maybe I should add separate pull request for glfwCreatePositionedWindow. Because it is severe change and doesn't directly connected with vivante backend

@linkmauve
Copy link
Member

Hello, and thanks for your work!

Are you aware of the Etnaviv driver though? It is a driver for Vivante GPUs which doesn’t require the use of proprietary APIs, which otherwise make it very hard for us to test. Etnaviv provides standard Linux APIs instead, such as DRM, Wayland, X11, etc., and lets you use the existing backends without any modification.

Just like the Nvidia proprietary backend, I really don’t think the costs of an additional backend for very specific hardware is justified, especially since a free driver exists.

@linkmauve linkmauve added enhancement Feature suggestions and PRs Linux Linux specific (any window system) labels Sep 16, 2019
@YarikTH YarikTH closed this Dec 17, 2020
@elmindreda elmindreda added this to the None milestone Feb 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature suggestions and PRs Linux Linux specific (any window system)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants