summarylogtreecommitdiffstats
path: root/0007-gl-renderer-Add-EGLDevice-enumeration-support.patch
diff options
context:
space:
mode:
Diffstat (limited to '0007-gl-renderer-Add-EGLDevice-enumeration-support.patch')
-rw-r--r--0007-gl-renderer-Add-EGLDevice-enumeration-support.patch54
1 files changed, 27 insertions, 27 deletions
diff --git a/0007-gl-renderer-Add-EGLDevice-enumeration-support.patch b/0007-gl-renderer-Add-EGLDevice-enumeration-support.patch
index 322e011e16a..59597b09ebb 100644
--- a/0007-gl-renderer-Add-EGLDevice-enumeration-support.patch
+++ b/0007-gl-renderer-Add-EGLDevice-enumeration-support.patch
@@ -1,7 +1,7 @@
-From 21f53facea84443ed09fbd400530a58e3695906b Mon Sep 17 00:00:00 2001
+From e57c601797288a2391a3ef177cb3681f2f6ca167 Mon Sep 17 00:00:00 2001
From: "Miguel A. Vico" <mvicomoya@nvidia.com>
Date: Mon, 2 May 2016 15:56:37 +0200
-Subject: [PATCH 07/11] gl-renderer: Add EGLDevice enumeration support
+Subject: [PATCH 07/12] gl-renderer: Add EGLDevice enumeration support
X-NVConfidentiality: public
EGLDevice provides means to enumerate native devices.
@@ -16,24 +16,22 @@ Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com>
Reviewed-by: Andy Ritger <aritger@nvidia.com>
Reviewed-by: Adam Cheney <acheney@nvidia.com>
Reviewed-by: James Jones <jajones@nvidia.com>
-
-[aplattner@nvidia.com: rebased on top of Weston 1.12.0]
---
- libweston/gl-renderer.c | 87 ++++++++++++++++++++++++++++++++++++++++++++++++-
+ libweston/gl-renderer.c | 89 ++++++++++++++++++++++++++++++++++++++++++++++++-
libweston/gl-renderer.h | 7 ++++
- 2 files changed, 93 insertions(+), 1 deletion(-)
+ 2 files changed, 95 insertions(+), 1 deletion(-)
diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c
-index 067e677f8a7b..b5d93531c944 100644
+index 508f8b92797e..9ef115ae092f 100644
--- a/libweston/gl-renderer.c
+++ b/libweston/gl-renderer.c
-@@ -3208,6 +3208,88 @@ gl_renderer_setup(struct weston_compositor *ec, EGLSurface egl_surface)
+@@ -3208,6 +3208,90 @@ gl_renderer_setup(struct weston_compositor *ec, EGLSurface egl_surface)
return 0;
}
+static int
+gl_renderer_get_devices(EGLint max_devices, EGLDeviceEXT *devices,
-+ EGLint *num_devices)
++ EGLint *num_devices)
+{
+ const char *extensions;
+ PFNEGLQUERYDEVICESEXTPROC query_devices;
@@ -68,42 +66,44 @@ index 067e677f8a7b..b5d93531c944 100644
+
+static int
+gl_renderer_get_drm_device_file(EGLDeviceEXT device,
-+ const char **drm_device_file)
++ const char **drm_device_file)
+{
-+ const char *extensions;
++ const char *exts;
+ PFNEGLQUERYDEVICESTRINGEXTPROC query_device_string;
+
-+ extensions = (const char *)eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
-+ if (!extensions) {
++ exts = (const char *)eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
++ if (!exts) {
+ weston_log("Retrieving EGL extension string failed.\n");
+ return -1;
+ }
+
-+ if (!weston_check_egl_extension(extensions, "EGL_EXT_device_base") &&
-+ (!weston_check_egl_extension(extensions, "EGL_EXT_device_query") ||
-+ !weston_check_egl_extension(extensions, "EGL_EXT_device_enumeration"))) {
++ if (!weston_check_egl_extension(exts, "EGL_EXT_device_base") &&
++ (!weston_check_egl_extension(exts, "EGL_EXT_device_query") ||
++ !weston_check_egl_extension(exts, "EGL_EXT_device_enumeration"))) {
+ weston_log("EGL_EXT_device_base not supported.\n");
+ return -1;
+ }
+
-+ query_device_string = (void *) eglGetProcAddress("eglQueryDeviceStringEXT");
++ query_device_string =
++ (void *) eglGetProcAddress("eglQueryDeviceStringEXT");
+ if (!query_device_string) {
+ weston_log("Failed to get eglQueryDeviceStringEXT function\n");
+ return -1;
+ }
+
-+ extensions = query_device_string(device, EGL_EXTENSIONS);
-+ if (!extensions) {
++ exts = query_device_string(device, EGL_EXTENSIONS);
++ if (!exts) {
+ weston_log("Retrieving EGL extension string failed.\n");
+ return -1;
+ }
+
-+ if (!weston_check_egl_extension(extensions, "EGL_EXT_device_drm")) {
++ if (!weston_check_egl_extension(exts, "EGL_EXT_device_drm")) {
+ weston_log("EGL_EXT_device_drm not supported.\n");
+ return -1;
+ }
+
-+ (*drm_device_file) = query_device_string(device, EGL_DRM_DEVICE_FILE_EXT);
++ (*drm_device_file) = query_device_string(device,
++ EGL_DRM_DEVICE_FILE_EXT);
+ if (*drm_device_file == NULL) {
+ weston_log("Failed to query DRM device name.\n");
+ gl_renderer_print_egl_error_state();
@@ -116,7 +116,7 @@ index 067e677f8a7b..b5d93531c944 100644
WL_EXPORT struct gl_renderer_interface gl_renderer_interface = {
.opaque_attribs = gl_renderer_opaque_attribs,
.alpha_attribs = gl_renderer_alpha_attribs,
-@@ -3218,5 +3300,8 @@ WL_EXPORT struct gl_renderer_interface gl_renderer_interface = {
+@@ -3218,5 +3302,8 @@ WL_EXPORT struct gl_renderer_interface gl_renderer_interface = {
.output_destroy = gl_renderer_output_destroy,
.output_surface = gl_renderer_output_surface,
.output_set_border = gl_renderer_output_set_border,
@@ -127,7 +127,7 @@ index 067e677f8a7b..b5d93531c944 100644
+ .get_drm_device_file = gl_renderer_get_drm_device_file
};
diff --git a/libweston/gl-renderer.h b/libweston/gl-renderer.h
-index 02f8011247db..871aa6589b01 100644
+index b47ea07feaf0..2840ee5bea28 100644
--- a/libweston/gl-renderer.h
+++ b/libweston/gl-renderer.h
@@ -114,5 +114,12 @@ struct gl_renderer_interface {
@@ -136,13 +136,13 @@ index 02f8011247db..871aa6589b01 100644
void (*print_egl_error_state)(void);
+
+ int (*get_devices)(EGLint max_devices,
-+ EGLDeviceEXT *devices,
-+ EGLint *num_devices);
++ EGLDeviceEXT *devices,
++ EGLint *num_devices);
+
+ int (*get_drm_device_file)(EGLDeviceEXT device,
-+ const char **drm_device_file);
++ const char **drm_device_file);
};
--
-2.10.0
+2.10.2