[mutter/wip/3-monitors-on-nvidia: 3/10] wip! renderer/native: generalize meta_renderer_native_create_surface_egl_device



commit c861fe55d19e2bf229e436ce6e82cd8b9042f035
Author: Ray Strode <rstrode redhat com>
Date:   Thu Sep 13 07:31:27 2018 -0400

    wip! renderer/native: generalize meta_renderer_native_create_surface_egl_device
    
    Eventually we want to use meta_renderer_native_create_surface_egl_device
    for secondary displays, but it currently implicitly uses the primary
    display and egl context.
    
    This commit changes the function to take a display and a context
    as arguments.

 src/backends/native/meta-renderer-native.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/backends/native/meta-renderer-native.c b/src/backends/native/meta-renderer-native.c
index 83af1fba6..2bed90310 100644
--- a/src/backends/native/meta-renderer-native.c
+++ b/src/backends/native/meta-renderer-native.c
@@ -2100,6 +2100,8 @@ meta_renderer_native_create_surface_gbm (CoglOnscreen        *onscreen,
 static gboolean
 meta_renderer_native_create_surface_egl_device (CoglOnscreen       *onscreen,
                                                 MetaMonitor        *monitor,
+                                                EGLDisplay          egl_display,
+                                                EGLConfig           egl_config,
                                                 int                 width,
                                                 int                 height,
                                                 EGLStreamKHR       *out_egl_stream,
@@ -2109,16 +2111,13 @@ meta_renderer_native_create_surface_egl_device (CoglOnscreen       *onscreen,
   CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen);
   CoglContext *cogl_context = framebuffer->context;
   CoglDisplay *cogl_display = cogl_context->display;
-  CoglDisplayEGL *cogl_display_egl = cogl_display->winsys;
   CoglRenderer *cogl_renderer = cogl_display->renderer;
   CoglRendererEGL *cogl_renderer_egl = cogl_renderer->winsys;
   MetaRendererNativeGpuData *renderer_gpu_data = cogl_renderer_egl->platform;
   MetaEgl *egl =
     meta_renderer_native_get_egl (renderer_gpu_data->renderer_native);
-  EGLDisplay egl_display = renderer_gpu_data->egl_display;
   MetaOutput *output;
   MetaCrtc *crtc;
-  EGLConfig egl_config;
   EGLStreamKHR egl_stream;
   EGLSurface egl_surface;
   EGLint num_layers;
@@ -2172,7 +2171,6 @@ meta_renderer_native_create_surface_egl_device (CoglOnscreen       *onscreen,
       return FALSE;
     }
 
-  egl_config = cogl_display_egl->egl_config;
   egl_surface = meta_egl_create_stream_producer_surface (egl,
                                                          egl_display,
                                                          egl_config,
@@ -2360,6 +2358,9 @@ meta_onscreen_native_allocate (CoglOnscreen *onscreen,
 {
   CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen);
   CoglOnscreenEGL *onscreen_egl = onscreen->winsys;
+  CoglContext *cogl_context = framebuffer->context;
+  CoglDisplay *cogl_display = cogl_context->display;
+  CoglDisplayEGL *cogl_display_egl = cogl_display->winsys;
   MetaOnscreenNative *onscreen_native = onscreen_egl->platform;
   MetaRendererNativeGpuData *renderer_gpu_data;
   struct gbm_surface *gbm_surface;
@@ -2422,6 +2423,8 @@ meta_onscreen_native_allocate (CoglOnscreen *onscreen,
 
       if (!meta_renderer_native_create_surface_egl_device (onscreen,
                                                            monitor,
+                                                           renderer_gpu_data->egl_display,
+                                                           cogl_display_egl->egl_config,
                                                            width, height,
                                                            &egl_stream,
                                                            &egl_surface,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]