summarylogtreecommitdiffstats
path: root/0008-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch
diff options
context:
space:
mode:
Diffstat (limited to '0008-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch')
-rw-r--r--0008-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch109
1 files changed, 50 insertions, 59 deletions
diff --git a/0008-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch b/0008-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch
index 72d9ef25c95..7309529cda4 100644
--- a/0008-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch
+++ b/0008-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch
@@ -1,4 +1,4 @@
-From 13ffa3ad89037a8e686633468b762fb9b92c95c8 Mon Sep 17 00:00:00 2001
+From 4a84caec21fa650c8919db504dea94b3ad352a71 Mon Sep 17 00:00:00 2001
From: "Miguel A. Vico" <mvicomoya@nvidia.com>
Date: Mon, 2 May 2016 16:34:01 +0200
Subject: [PATCH 08/11] gl-renderer: Add support for EGLDevice composited frame
@@ -41,17 +41,19 @@ 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]
---
- src/gl-renderer.c | 251 ++++++++++++++++++++++++++++++++++++++++++++++++++-
- src/gl-renderer.h | 19 ++++
- src/weston-egl-ext.h | 18 ++++
- 3 files changed, 285 insertions(+), 3 deletions(-)
+ libweston/gl-renderer.c | 251 ++++++++++++++++++++++++++++++++++++++++++++-
+ libweston/gl-renderer.h | 15 +++
+ libweston/weston-egl-ext.h | 18 ++++
+ 3 files changed, 281 insertions(+), 3 deletions(-)
-diff --git a/src/gl-renderer.c b/src/gl-renderer.c
-index 098440ce30a2..764bd880d743 100644
---- a/src/gl-renderer.c
-+++ b/src/gl-renderer.c
-@@ -84,6 +84,8 @@ struct gl_output_state {
+diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c
+index b5d93531c944..01c5933966ca 100644
+--- a/libweston/gl-renderer.c
++++ b/libweston/gl-renderer.c
+@@ -86,6 +86,8 @@ struct gl_output_state {
struct gl_border_image borders[4];
enum gl_border_status border_status;
@@ -60,9 +62,9 @@ index 098440ce30a2..764bd880d743 100644
struct weston_matrix output_matrix;
};
-@@ -202,6 +204,27 @@ struct gl_renderer {
+@@ -204,6 +206,27 @@ struct gl_renderer {
- int has_configless_context;
+ int has_surfaceless_context;
+ PFNEGLGETOUTPUTLAYERSEXTPROC get_output_layers;
+ PFNEGLQUERYOUTPUTLAYERATTRIBEXTPROC query_output_layer_attrib;
@@ -88,7 +90,7 @@ index 098440ce30a2..764bd880d743 100644
int has_dmabuf_import;
struct wl_list dmabuf_images;
-@@ -1193,6 +1216,37 @@ gl_renderer_repaint_output(struct weston_output *output,
+@@ -1189,6 +1212,37 @@ gl_renderer_repaint_output(struct weston_output *output,
}
static int
@@ -126,7 +128,7 @@ index 098440ce30a2..764bd880d743 100644
gl_renderer_read_pixels(struct weston_output *output,
pixman_format_code_t format, void *pixels,
uint32_t x, uint32_t y,
-@@ -2587,9 +2641,92 @@ gl_renderer_create_window_surface(struct gl_renderer *gr,
+@@ -2584,9 +2638,92 @@ gl_renderer_create_window_surface(struct gl_renderer *gr,
return egl_surface;
}
@@ -218,9 +220,9 @@ index 098440ce30a2..764bd880d743 100644
+ EGLSurface surface,
+ EGLStreamKHR stream)
{
- struct weston_compositor *ec = output->compositor;
- struct gl_renderer *gr = get_renderer(ec);
-@@ -2606,6 +2743,7 @@ gl_renderer_output_create(struct weston_output *output,
+ struct gl_output_state *go;
+ int i;
+@@ -2596,6 +2733,7 @@ gl_renderer_output_create(struct weston_output *output,
return -1;
go->egl_surface = surface;
@@ -228,7 +230,7 @@ index 098440ce30a2..764bd880d743 100644
for (i = 0; i < BUFFER_DAMAGE_COUNT; i++)
pixman_region32_init(&go->buffer_damage[i]);
-@@ -2638,13 +2776,41 @@ gl_renderer_output_window_create(struct weston_output *output,
+@@ -2628,13 +2766,41 @@ gl_renderer_output_window_create(struct weston_output *output,
return -1;
}
@@ -271,7 +273,7 @@ index 098440ce30a2..764bd880d743 100644
static void
gl_renderer_output_destroy(struct weston_output *output)
{
-@@ -2657,6 +2823,9 @@ gl_renderer_output_destroy(struct weston_output *output)
+@@ -2647,6 +2813,9 @@ gl_renderer_output_destroy(struct weston_output *output)
eglDestroySurface(gr->egl_display, go->egl_surface);
@@ -281,7 +283,7 @@ index 098440ce30a2..764bd880d743 100644
free(go);
}
-@@ -2761,6 +2930,19 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec)
+@@ -2728,6 +2897,19 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec)
(void *) eglGetProcAddress("eglUnbindWaylandDisplayWL");
gr->query_buffer =
(void *) eglGetProcAddress("eglQueryWaylandBufferWL");
@@ -301,35 +303,35 @@ index 098440ce30a2..764bd880d743 100644
extensions =
(const char *) eglQueryString(gr->egl_display, EGL_EXTENSIONS);
-@@ -2802,6 +2984,27 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec)
+@@ -2766,6 +2948,27 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec)
+ if (weston_check_egl_extension(extensions, "EGL_EXT_image_dma_buf_import"))
gr->has_dmabuf_import = 1;
- #endif
-+ if (check_extension(extensions, "EGL_EXT_output_base"))
++ if (weston_check_egl_extension(extensions, "EGL_EXT_output_base"))
+ gr->has_egl_output_base = 1;
+
-+ if (check_extension(extensions, "EGL_EXT_output_drm"))
++ if (weston_check_egl_extension(extensions, "EGL_EXT_output_drm"))
+ gr->has_egl_output_drm = 1;
+
-+ if (check_extension(extensions, "EGL_NV_output_drm_flip_event"))
++ if (weston_check_egl_extension(extensions, "EGL_NV_output_drm_flip_event"))
+ gr->has_egl_output_drm_flip_event = 1;
+
-+ if (check_extension(extensions, "EGL_KHR_stream"))
++ if (weston_check_egl_extension(extensions, "EGL_KHR_stream"))
+ gr->has_egl_stream = 1;
+
-+ if (check_extension(extensions, "EGL_KHR_stream_producer_eglsurface"))
++ if (weston_check_egl_extension(extensions, "EGL_KHR_stream_producer_eglsurface"))
+ gr->has_egl_stream_producer_eglsurface = 1;
+
-+ if (check_extension(extensions, "EGL_EXT_stream_consumer_egloutput"))
++ if (weston_check_egl_extension(extensions, "EGL_EXT_stream_consumer_egloutput"))
+ gr->has_egl_stream_consumer_egloutput = 1;
+
-+ if (check_extension(extensions, "EGL_EXT_stream_acquire_mode"))
++ if (weston_check_egl_extension(extensions, "EGL_EXT_stream_acquire_mode"))
+ gr->has_egl_stream_acquire_mode = 1;
+
renderer_setup_egl_client_extensions(gr);
return 0;
-@@ -2827,6 +3030,16 @@ static const EGLint gl_renderer_alpha_attribs[] = {
+@@ -2791,6 +2994,16 @@ static const EGLint gl_renderer_alpha_attribs[] = {
EGL_NONE
};
@@ -343,10 +345,10 @@ index 098440ce30a2..764bd880d743 100644
+ EGL_NONE
+};
+
+
/** Checks whether a platform EGL client extension is supported
*
- * \param ec The weston compositor
-@@ -2899,6 +3112,8 @@ platform_to_extension(EGLenum platform)
+@@ -2864,6 +3077,8 @@ platform_to_extension(EGLenum platform)
return "wayland";
case EGL_PLATFORM_X11_KHR:
return "x11";
@@ -355,7 +357,7 @@ index 098440ce30a2..764bd880d743 100644
default:
assert(0 && "bad EGL platform enum");
}
-@@ -2984,6 +3199,32 @@ gl_renderer_display_create(struct weston_compositor *ec, EGLenum platform,
+@@ -3000,6 +3215,32 @@ gl_renderer_display_create(struct weston_compositor *ec, EGLenum platform,
if (gl_renderer_setup_egl_extensions(ec) < 0)
goto fail_with_error;
@@ -388,7 +390,7 @@ index 098440ce30a2..764bd880d743 100644
wl_list_init(&gr->dmabuf_images);
if (gr->has_dmabuf_import)
gr->base.import_dmabuf = gl_renderer_import_dmabuf;
-@@ -3260,15 +3501,19 @@ gl_renderer_get_drm_device_file(EGLDeviceEXT device,
+@@ -3293,15 +3534,19 @@ gl_renderer_get_drm_device_file(EGLDeviceEXT device,
WL_EXPORT struct gl_renderer_interface gl_renderer_interface = {
.opaque_attribs = gl_renderer_opaque_attribs,
.alpha_attribs = gl_renderer_alpha_attribs,
@@ -409,22 +411,11 @@ index 098440ce30a2..764bd880d743 100644
+
+ .output_stream_flip = gl_renderer_output_stream_flip
};
-diff --git a/src/gl-renderer.h b/src/gl-renderer.h
-index f376edd80106..958caa19e38b 100644
---- a/src/gl-renderer.h
-+++ b/src/gl-renderer.h
-@@ -62,6 +62,10 @@ typedef EGLSurface (*PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC) (EGLDisplay dpy,
- #define EGL_PLATFORM_X11_KHR 0x31D5
- #endif
-
-+#ifndef EGL_PLATFORM_DEVICE_EXT
-+#define EGL_PLATFORM_DEVICE_EXT 0x313F
-+#endif
-+
- #define NO_EGL_PLATFORM 0
-
- enum gl_renderer_border_side {
-@@ -74,6 +78,7 @@ enum gl_renderer_border_side {
+diff --git a/libweston/gl-renderer.h b/libweston/gl-renderer.h
+index 871aa6589b01..02c79c355b47 100644
+--- a/libweston/gl-renderer.h
++++ b/libweston/gl-renderer.h
+@@ -59,6 +59,7 @@ enum gl_renderer_border_side {
struct gl_renderer_interface {
const EGLint *opaque_attribs;
const EGLint *alpha_attribs;
@@ -432,7 +423,7 @@ index f376edd80106..958caa19e38b 100644
int (*display_create)(struct weston_compositor *ec,
EGLenum platform,
-@@ -92,6 +97,9 @@ struct gl_renderer_interface {
+@@ -77,6 +78,9 @@ struct gl_renderer_interface {
const EGLint *visual_id,
const int n_ids);
@@ -442,7 +433,7 @@ index f376edd80106..958caa19e38b 100644
void (*output_destroy)(struct weston_output *output);
EGLSurface (*output_surface)(struct weston_output *output);
-@@ -136,5 +144,16 @@ struct gl_renderer_interface {
+@@ -121,5 +125,16 @@ struct gl_renderer_interface {
int (*get_drm_device_file)(EGLDeviceEXT device,
const char **drm_device_file);
@@ -459,12 +450,12 @@ index f376edd80106..958caa19e38b 100644
+ int (*output_stream_flip)(struct weston_output *output, void *flip_data);
};
-diff --git a/src/weston-egl-ext.h b/src/weston-egl-ext.h
-index 32f6108fbb83..6597e1143fea 100644
---- a/src/weston-egl-ext.h
-+++ b/src/weston-egl-ext.h
-@@ -116,5 +116,23 @@ typedef struct wl_buffer * (EGLAPIENTRYP PFNEGLCREATEWAYLANDBUFFERFROMIMAGEWL) (
- #define EGL_DMA_BUF_PLANE2_PITCH_EXT 0x327A
+diff --git a/libweston/weston-egl-ext.h b/libweston/weston-egl-ext.h
+index 6e3699602b5b..79aa2de2b09f 100644
+--- a/libweston/weston-egl-ext.h
++++ b/libweston/weston-egl-ext.h
+@@ -152,5 +152,23 @@ typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMPIXMAPSURFACEEXTPROC) (EGLD
+ #define EGL_PLATFORM_X11_KHR 0x31D5
#endif
+/*
@@ -488,5 +479,5 @@ index 32f6108fbb83..6597e1143fea 100644
#endif
--
-2.8.3
+2.10.0