wip! renderer/native: pass MetaMonitor instead of MetaLogicalMonitor to meta_renderer_native_create_surface_egl_device

This commit is contained in:
Ray Strode 2018-09-13 14:03:33 -04:00
parent bb33dad473
commit 336cb36d3c

View File

@ -2218,7 +2218,7 @@ meta_renderer_native_create_surface_gbm (CoglOnscreen *onscreen,
#ifdef HAVE_EGL_DEVICE #ifdef HAVE_EGL_DEVICE
static gboolean static gboolean
meta_renderer_native_create_surface_egl_device (CoglOnscreen *onscreen, meta_renderer_native_create_surface_egl_device (CoglOnscreen *onscreen,
MetaLogicalMonitor *logical_monitor, MetaMonitor *monitor,
int width, int width,
int height, int height,
EGLStreamKHR *out_egl_stream, EGLStreamKHR *out_egl_stream,
@ -2235,7 +2235,6 @@ meta_renderer_native_create_surface_egl_device (CoglOnscreen *onscreen,
MetaEgl *egl = MetaEgl *egl =
meta_renderer_native_get_egl (renderer_gpu_data->renderer_native); meta_renderer_native_get_egl (renderer_gpu_data->renderer_native);
EGLDisplay egl_display = renderer_gpu_data->egl_display; EGLDisplay egl_display = renderer_gpu_data->egl_display;
MetaMonitor *monitor;
MetaOutput *output; MetaOutput *output;
MetaCrtc *crtc; MetaCrtc *crtc;
EGLConfig egl_config; EGLConfig egl_config;
@ -2259,15 +2258,9 @@ meta_renderer_native_create_surface_egl_device (CoglOnscreen *onscreen,
if (egl_stream == EGL_NO_STREAM_KHR) if (egl_stream == EGL_NO_STREAM_KHR)
return FALSE; return FALSE;
monitor = meta_logical_monitor_get_monitors (logical_monitor)->data;
output = meta_monitor_get_main_output (monitor); output = meta_monitor_get_main_output (monitor);
crtc = meta_output_get_assigned_crtc (output); crtc = meta_output_get_assigned_crtc (output);
/*
* An "logical_monitor" may have multiple outputs/crtcs in case its tiled,
* but as far as I can tell, EGL only allows you to pass one crtc_id, so
* lets pass the first one.
*/
output_attribs[0] = EGL_DRM_CRTC_EXT; output_attribs[0] = EGL_DRM_CRTC_EXT;
output_attribs[1] = crtc->crtc_id; output_attribs[1] = crtc->crtc_id;
output_attribs[2] = EGL_NONE; output_attribs[2] = EGL_NONE;
@ -2508,6 +2501,7 @@ meta_onscreen_native_allocate (CoglOnscreen *onscreen,
#ifdef HAVE_EGL_DEVICE #ifdef HAVE_EGL_DEVICE
MetaRendererView *view; MetaRendererView *view;
MetaLogicalMonitor *logical_monitor; MetaLogicalMonitor *logical_monitor;
MetaMonitor *monitor;
EGLStreamKHR egl_stream; EGLStreamKHR egl_stream;
#endif #endif
@ -2550,8 +2544,16 @@ meta_onscreen_native_allocate (CoglOnscreen *onscreen,
view = onscreen_native->view; view = onscreen_native->view;
logical_monitor = meta_renderer_view_get_logical_monitor (view); logical_monitor = meta_renderer_view_get_logical_monitor (view);
/*
* An "logical_monitor" may have multiple outputs/crtcs in case its tiled,
* but as far as I can tell, EGL only allows you to pass one crtc_id, so
* lets pass the first one.
*/
monitor = meta_logical_monitor_get_monitors (logical_monitor)->data;
if (!meta_renderer_native_create_surface_egl_device (onscreen, if (!meta_renderer_native_create_surface_egl_device (onscreen,
logical_monitor, monitor,
width, height, width, height,
&egl_stream, &egl_stream,
&egl_surface, &egl_surface,