diff options
Diffstat (limited to '0002-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch')
-rw-r--r-- | 0002-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/0002-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch b/0002-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch index 516af4bc3312..54c1434006a8 100644 --- a/0002-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch +++ b/0002-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch @@ -1,4 +1,4 @@ -From 75abc9e631667949c2ab8cf46882206d4ed71d0e Mon Sep 17 00:00:00 2001 +From 418000cc187e0ae6c9ab076f0e743cae669e053d 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 2/6] gl-renderer: Add support for EGLDevice composited frame @@ -42,15 +42,15 @@ Reviewed-by: Andy Ritger <aritger@nvidia.com> Reviewed-by: Adam Cheney <acheney@nvidia.com> Reviewed-by: James Jones <jajones@nvidia.com> --- - libweston/gl-renderer.c | 262 +++++++++++++++++++++++++++++++++++++++- - libweston/gl-renderer.h | 16 +++ - shared/weston-egl-ext.h | 40 ++++++ + libweston/renderer-gl/gl-renderer.c | 262 +++++++++++++++++++++++++++- + libweston/renderer-gl/gl-renderer.h | 16 ++ + shared/weston-egl-ext.h | 40 +++++ 3 files changed, 315 insertions(+), 3 deletions(-) -diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c -index 74315347..f3fb2c65 100644 ---- a/libweston/gl-renderer.c -+++ b/libweston/gl-renderer.c +diff --git a/libweston/renderer-gl/gl-renderer.c b/libweston/renderer-gl/gl-renderer.c +index a6be2b7b..215ed9b3 100644 +--- a/libweston/renderer-gl/gl-renderer.c ++++ b/libweston/renderer-gl/gl-renderer.c @@ -101,6 +101,8 @@ struct gl_output_state { struct gl_border_image borders[4]; enum gl_border_status border_status; @@ -60,36 +60,36 @@ index 74315347..f3fb2c65 100644 struct weston_matrix output_matrix; EGLSyncKHR begin_render_sync, end_render_sync; -@@ -238,6 +240,28 @@ struct gl_renderer { - - int has_surfaceless_context; +@@ -243,6 +245,28 @@ struct gl_renderer { + bool has_dmabuf_import; + struct wl_list dmabuf_images; + PFNEGLGETOUTPUTLAYERSEXTPROC get_output_layers; + PFNEGLQUERYOUTPUTLAYERATTRIBEXTPROC query_output_layer_attrib; -+ int has_egl_output_base; -+ int has_egl_output_drm; -+ int has_egl_output_drm_flip_event; ++ bool has_egl_output_base; ++ bool has_egl_output_drm; ++ bool has_egl_output_drm_flip_event; + + PFNEGLCREATESTREAMKHRPROC create_stream; + PFNEGLDESTROYSTREAMKHRPROC destroy_stream; -+ int has_egl_stream; ++ bool has_egl_stream; + + PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC create_stream_producer_surface; -+ int has_egl_stream_producer_eglsurface; ++ bool has_egl_stream_producer_eglsurface; + + PFNEGLSTREAMCONSUMEROUTPUTEXTPROC stream_consumer_output; -+ int has_egl_stream_consumer_egloutput; ++ bool has_egl_stream_consumer_egloutput; + +#ifdef EGL_NV_stream_attrib + PFNEGLSTREAMCONSUMERACQUIREATTRIBNVPROC stream_consumer_acquire_attrib; +#endif -+ int has_egl_stream_attrib; -+ int has_egl_stream_acquire_mode; ++ bool has_egl_stream_attrib; ++ bool has_egl_stream_acquire_mode; + - int has_dmabuf_import; - struct wl_list dmabuf_images; + bool has_gl_texture_rg; -@@ -1503,6 +1527,38 @@ gl_renderer_repaint_output(struct weston_output *output, + struct gl_shader texture_shader_rgba; +@@ -1592,6 +1616,38 @@ gl_renderer_repaint_output(struct weston_output *output, update_buffer_release_fences(compositor, output); } @@ -128,7 +128,7 @@ index 74315347..f3fb2c65 100644 static int gl_renderer_read_pixels(struct weston_output *output, pixman_format_code_t format, void *pixels, -@@ -3195,9 +3251,93 @@ gl_renderer_create_window_surface(struct gl_renderer *gr, +@@ -3284,9 +3340,93 @@ gl_renderer_create_window_surface(struct gl_renderer *gr, return egl_surface; } @@ -223,7 +223,7 @@ index 74315347..f3fb2c65 100644 { struct gl_output_state *go; int i; -@@ -3207,6 +3347,7 @@ gl_renderer_output_create(struct weston_output *output, +@@ -3296,6 +3436,7 @@ gl_renderer_output_create(struct weston_output *output, return -1; go->egl_surface = surface; @@ -231,7 +231,7 @@ index 74315347..f3fb2c65 100644 for (i = 0; i < BUFFER_DAMAGE_COUNT; i++) pixman_region32_init(&go->buffer_damage[i]); -@@ -3244,13 +3385,41 @@ gl_renderer_output_window_create(struct weston_output *output, +@@ -3333,13 +3474,41 @@ gl_renderer_output_window_create(struct weston_output *output, return -1; } @@ -274,7 +274,7 @@ index 74315347..f3fb2c65 100644 static void gl_renderer_output_destroy(struct weston_output *output) { -@@ -3280,6 +3449,9 @@ gl_renderer_output_destroy(struct weston_output *output) +@@ -3369,6 +3538,9 @@ gl_renderer_output_destroy(struct weston_output *output) if (go->end_render_sync != EGL_NO_SYNC_KHR) gr->destroy_sync(gr->egl_display, go->end_render_sync); @@ -284,10 +284,10 @@ index 74315347..f3fb2c65 100644 free(go); } -@@ -3393,6 +3565,19 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec) - (void *) eglGetProcAddress("eglUnbindWaylandDisplayWL"); - gr->query_buffer = +@@ -3484,6 +3656,19 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec) (void *) eglGetProcAddress("eglQueryWaylandBufferWL"); + gr->set_damage_region = + (void *) eglGetProcAddress("eglSetDamageRegionKHR"); + gr->get_output_layers = (void *) eglGetProcAddress("eglGetOutputLayersEXT"); + gr->query_output_layer_attrib = + (void *) eglGetProcAddress("eglQueryOutputLayerAttribEXT"); @@ -304,38 +304,38 @@ index 74315347..f3fb2c65 100644 extensions = (const char *) eglQueryString(gr->egl_display, EGL_EXTENSIONS); -@@ -3467,6 +3652,30 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec) +@@ -3561,6 +3746,30 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec) "to missing EGL_KHR_wait_sync extension\n"); } + if (weston_check_egl_extension(extensions, "EGL_EXT_output_base")) -+ gr->has_egl_output_base = 1; ++ gr->has_egl_output_base = true; + + if (weston_check_egl_extension(extensions, "EGL_EXT_output_drm")) -+ gr->has_egl_output_drm = 1; ++ gr->has_egl_output_drm = true; + + if (weston_check_egl_extension(extensions, "EGL_NV_output_drm_flip_event")) -+ gr->has_egl_output_drm_flip_event = 1; ++ gr->has_egl_output_drm_flip_event = true; + + if (weston_check_egl_extension(extensions, "EGL_KHR_stream")) -+ gr->has_egl_stream = 1; ++ gr->has_egl_stream = true; + + if (weston_check_egl_extension(extensions, "EGL_KHR_stream_producer_eglsurface")) -+ gr->has_egl_stream_producer_eglsurface = 1; ++ gr->has_egl_stream_producer_eglsurface = true; + + if (weston_check_egl_extension(extensions, "EGL_EXT_stream_consumer_egloutput")) -+ gr->has_egl_stream_consumer_egloutput = 1; ++ gr->has_egl_stream_consumer_egloutput = true; + + if (weston_check_egl_extension(extensions, "EGL_NV_stream_attrib")) -+ gr->has_egl_stream_attrib = 1; ++ gr->has_egl_stream_attrib = true; + + if (weston_check_egl_extension(extensions, "EGL_EXT_stream_acquire_mode")) -+ gr->has_egl_stream_acquire_mode = 1; ++ gr->has_egl_stream_acquire_mode = true; + renderer_setup_egl_client_extensions(gr); return 0; -@@ -3492,6 +3701,15 @@ static const EGLint gl_renderer_alpha_attribs[] = { +@@ -3586,6 +3795,15 @@ static const EGLint gl_renderer_alpha_attribs[] = { EGL_NONE }; @@ -351,7 +351,7 @@ index 74315347..f3fb2c65 100644 /** Checks whether a platform EGL client extension is supported * -@@ -3565,6 +3783,8 @@ platform_to_extension(EGLenum platform) +@@ -3659,6 +3877,8 @@ platform_to_extension(EGLenum platform) return "wayland"; case EGL_PLATFORM_X11_KHR: return "x11"; @@ -360,7 +360,7 @@ index 74315347..f3fb2c65 100644 default: assert(0 && "bad EGL platform enum"); } -@@ -3706,6 +3926,38 @@ gl_renderer_display_create(struct weston_compositor *ec, EGLenum platform, +@@ -3800,6 +4020,38 @@ gl_renderer_display_create(struct weston_compositor *ec, EGLenum platform, if (gr->has_native_fence_sync && gr->has_wait_sync) ec->capabilities |= WESTON_CAP_EXPLICIT_SYNC; @@ -399,7 +399,7 @@ index 74315347..f3fb2c65 100644 wl_list_init(&gr->dmabuf_images); if (gr->has_dmabuf_import) { gr->base.import_dmabuf = gl_renderer_import_dmabuf; -@@ -4077,10 +4329,12 @@ gl_renderer_get_drm_device_file(EGLDeviceEXT device, +@@ -4171,10 +4423,12 @@ 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, @@ -412,7 +412,7 @@ index 74315347..f3fb2c65 100644 .output_destroy = gl_renderer_output_destroy, .output_surface = gl_renderer_output_surface, .output_set_border = gl_renderer_output_set_border, -@@ -4088,5 +4342,7 @@ WL_EXPORT struct gl_renderer_interface gl_renderer_interface = { +@@ -4182,5 +4436,7 @@ WL_EXPORT struct gl_renderer_interface gl_renderer_interface = { .print_egl_error_state = gl_renderer_print_egl_error_state, .get_devices = gl_renderer_get_devices, @@ -421,11 +421,11 @@ index 74315347..f3fb2c65 100644 + + .output_stream_flip = gl_renderer_output_stream_flip }; -diff --git a/libweston/gl-renderer.h b/libweston/gl-renderer.h -index 151879da..973097bf 100644 ---- a/libweston/gl-renderer.h -+++ b/libweston/gl-renderer.h -@@ -60,6 +60,7 @@ enum gl_renderer_border_side { +diff --git a/libweston/renderer-gl/gl-renderer.h b/libweston/renderer-gl/gl-renderer.h +index cd330932..c5c3e12b 100644 +--- a/libweston/renderer-gl/gl-renderer.h ++++ b/libweston/renderer-gl/gl-renderer.h +@@ -62,6 +62,7 @@ enum gl_renderer_border_side { struct gl_renderer_interface { const EGLint *opaque_attribs; const EGLint *alpha_attribs; @@ -433,7 +433,7 @@ index 151879da..973097bf 100644 int (*display_create)(struct weston_compositor *ec, EGLenum platform, -@@ -78,6 +79,9 @@ struct gl_renderer_interface { +@@ -80,6 +81,9 @@ struct gl_renderer_interface { const EGLint *visual_id, const int n_ids); @@ -443,7 +443,7 @@ index 151879da..973097bf 100644 void (*output_destroy)(struct weston_output *output); EGLSurface (*output_surface)(struct weston_output *output); -@@ -129,5 +133,17 @@ struct gl_renderer_interface { +@@ -131,5 +135,17 @@ struct gl_renderer_interface { int (*get_drm_device_file)(EGLDeviceEXT device, const char **drm_device_file); |