mirror of
https://github.com/brl/mutter.git
synced 2025-01-13 13:12:28 +00:00
backends/native: Use the connector_id rather than winsys_id
winsys_id needs to be a unique output identifier so it will have to stop being the connector id.
This commit is contained in:
parent
91d4f30ebd
commit
4bc6a64d47
src/backends/native
@ -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);
|
||||
|
@ -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",
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user