diff --git a/src/backends/native/meta-gpu-kms.c b/src/backends/native/meta-gpu-kms.c index 57582f699..b651a70e5 100644 --- a/src/backends/native/meta-gpu-kms.c +++ b/src/backends/native/meta-gpu-kms.c @@ -59,6 +59,7 @@ struct _MetaGpuKms { MetaGpu parent; + uint32_t id; int fd; char *file_path; GSource *source; @@ -378,6 +379,12 @@ meta_gpu_kms_get_fd (MetaGpuKms *gpu_kms) return gpu_kms->fd; } +uint32_t +meta_gpu_kms_get_id (MetaGpuKms *gpu_kms) +{ + return gpu_kms->id; +} + const char * meta_gpu_kms_get_file_path (MetaGpuKms *gpu_kms) { @@ -889,7 +896,10 @@ meta_gpu_kms_finalize (GObject *object) static void meta_gpu_kms_init (MetaGpuKms *gpu_kms) { + static uint32_t id = 0; + gpu_kms->fd = -1; + gpu_kms->id = ++id; } static void diff --git a/src/backends/native/meta-gpu-kms.h b/src/backends/native/meta-gpu-kms.h index 5f77f191a..349db2990 100644 --- a/src/backends/native/meta-gpu-kms.h +++ b/src/backends/native/meta-gpu-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 @@ -71,6 +72,8 @@ gboolean meta_gpu_kms_wait_for_flip (MetaGpuKms *gpu_kms, int meta_gpu_kms_get_fd (MetaGpuKms *gpu_kms); +uint32_t meta_gpu_kms_get_id (MetaGpuKms *gpu_kms); + const char * meta_gpu_kms_get_file_path (MetaGpuKms *gpu_kms); void meta_gpu_kms_get_max_buffer_size (MetaGpuKms *gpu_kms,