diff --git a/src/backends/native/meta-gpu-kms.c b/src/backends/native/meta-gpu-kms.c index b651a70e5..0f6ae87d3 100644 --- a/src/backends/native/meta-gpu-kms.c +++ b/src/backends/native/meta-gpu-kms.c @@ -119,7 +119,12 @@ get_crtc_drm_connectors (MetaGpu *gpu, assigned_crtc = meta_output_get_assigned_crtc (output); if (assigned_crtc == crtc) - g_array_append_val (connectors_array, output->winsys_id); + { + uint32_t connector_id; + + connector_id = meta_output_kms_get_connector_id (output); + g_array_append_val (connectors_array, connector_id); + } } *n_connectors = connectors_array->len; @@ -529,8 +534,8 @@ create_mode (const drmModeModeInfo *drm_mode, } static MetaOutput * -find_output_by_id (GList *outputs, - glong id) +find_output_by_connector_id (GList *outputs, + glong id) { GList *l; @@ -538,7 +543,7 @@ find_output_by_id (GList *outputs, { MetaOutput *output = l->data; - if (output->winsys_id == id) + if (meta_output_kms_get_connector_id (output) == id) return output; } @@ -715,7 +720,8 @@ init_outputs (MetaGpuKms *gpu_kms, MetaOutput *old_output; GError *error = NULL; - old_output = find_output_by_id (old_outputs, connector->connector_id); + old_output = find_output_by_connector_id (old_outputs, + connector->connector_id); output = meta_create_kms_output (gpu_kms, connector, resources, old_output, &error); diff --git a/src/backends/native/meta-output-kms.c b/src/backends/native/meta-output-kms.c index 2e870658c..8688320a5 100644 --- a/src/backends/native/meta-output-kms.c +++ b/src/backends/native/meta-output-kms.c @@ -2,6 +2,7 @@ /* * Copyright (C) 2013-2017 Red Hat + * Copyright (C) 2018 DisplayLink (UK) Ltd. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -74,6 +75,14 @@ meta_output_kms_set_underscan (MetaOutput *output) meta_crtc_kms_set_underscan (crtc, output->is_underscanning); } +uint32_t +meta_output_kms_get_connector_id (MetaOutput *output) +{ + MetaOutputKms *output_kms = output->driver_private; + + return output_kms->connector->connector_id; +} + void meta_output_kms_set_power_save_mode (MetaOutput *output, uint64_t state) @@ -87,7 +96,7 @@ meta_output_kms_set_power_save_mode (MetaOutput *output, int fd; fd = meta_gpu_kms_get_fd (gpu_kms); - if (drmModeObjectSetProperty (fd, output->winsys_id, + if (drmModeObjectSetProperty (fd, output_kms->connector->connector_id, DRM_MODE_OBJECT_CONNECTOR, output_kms->dpms_prop_id, state) < 0) g_warning ("Failed to set power save mode for output %s: %s", diff --git a/src/backends/native/meta-output-kms.h b/src/backends/native/meta-output-kms.h index cbca02ef5..58385de0a 100644 --- a/src/backends/native/meta-output-kms.h +++ b/src/backends/native/meta-output-kms.h @@ -2,6 +2,7 @@ /* * Copyright (C) 2017 Red Hat + * Copyright (C) 2018 DisplayLink (UK) Ltd. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -33,6 +34,8 @@ void meta_output_kms_set_power_save_mode (MetaOutput *output, gboolean meta_output_kms_can_clone (MetaOutput *output, MetaOutput *other_output); +uint32_t meta_output_kms_get_connector_id (MetaOutput *output); + GBytes * meta_output_kms_read_edid (MetaOutput *output); MetaOutput * meta_create_kms_output (MetaGpuKms *gpu_kms,