gl-renderer: use gl_renderer_get_egl_config() for display_create

Replace a direct call to egl_choose_config() with a higher level function
gl_renderer_get_egl_config(). This will make follow-up work easier when
attribute lists will be generated inside gl_renderer_get_egl_config() instead
of passed in as is.

We explicitly replace visual_id with drm_formats, because that is what they
really are. Only the DRM backend passes in other than NULL/0, and if other
backends start caring about the actual pixel format, drm_format is the lingua
franca.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This commit is contained in:
Pekka Paalanen
2019-09-13 16:14:19 +03:00
parent 8e42af02a6
commit d8e851899a
3 changed files with 10 additions and 8 deletions
+6 -4
View File
@@ -3388,8 +3388,8 @@ gl_renderer_display_create(struct weston_compositor *ec,
EGLenum platform,
void *native_display,
const EGLint *config_attribs,
const EGLint *visual_id,
int n_ids)
const uint32_t *drm_formats,
unsigned drm_formats_count)
{
struct gl_renderer *gr;
EGLint major, minor;
@@ -3454,8 +3454,10 @@ gl_renderer_display_create(struct weston_compositor *ec,
log_egl_info(gr->egl_display);
if (egl_choose_config(gr, config_attribs, visual_id,
n_ids, &gr->egl_config) < 0) {
gr->egl_config = gl_renderer_get_egl_config(gr, config_attribs,
drm_formats,
drm_formats_count);
if (gr->egl_config == EGL_NO_CONFIG_KHR) {
weston_log("failed to choose EGL config\n");
goto fail_terminate;
}
+2 -2
View File
@@ -64,8 +64,8 @@ struct gl_renderer_interface {
EGLenum platform,
void *native_display,
const EGLint *config_attribs,
const EGLint *visual_id,
const int n_ids);
const uint32_t *drm_formats,
unsigned drm_formats_count);
int (*output_window_create)(struct weston_output *output,
EGLNativeWindowType window_for_legacy,