gpu/kms: Add identifier

We need a device unique id in order to uniquely identify an output,
which will use a (device, connector) pair.
This commit is contained in:
Emilio Pozuelo Monfort 2018-10-11 16:12:53 +02:00 committed by Emilio Pozuelo Monfort
parent c585b214b8
commit 91d4f30ebd
2 changed files with 13 additions and 0 deletions

View File

@ -59,6 +59,7 @@ struct _MetaGpuKms
{ {
MetaGpu parent; MetaGpu parent;
uint32_t id;
int fd; int fd;
char *file_path; char *file_path;
GSource *source; GSource *source;
@ -378,6 +379,12 @@ meta_gpu_kms_get_fd (MetaGpuKms *gpu_kms)
return gpu_kms->fd; return gpu_kms->fd;
} }
uint32_t
meta_gpu_kms_get_id (MetaGpuKms *gpu_kms)
{
return gpu_kms->id;
}
const char * const char *
meta_gpu_kms_get_file_path (MetaGpuKms *gpu_kms) meta_gpu_kms_get_file_path (MetaGpuKms *gpu_kms)
{ {
@ -889,7 +896,10 @@ meta_gpu_kms_finalize (GObject *object)
static void static void
meta_gpu_kms_init (MetaGpuKms *gpu_kms) meta_gpu_kms_init (MetaGpuKms *gpu_kms)
{ {
static uint32_t id = 0;
gpu_kms->fd = -1; gpu_kms->fd = -1;
gpu_kms->id = ++id;
} }
static void static void

View File

@ -2,6 +2,7 @@
/* /*
* Copyright (C) 2017 Red Hat * Copyright (C) 2017 Red Hat
* Copyright (C) 2018 DisplayLink (UK) Ltd.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * 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); 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); const char * meta_gpu_kms_get_file_path (MetaGpuKms *gpu_kms);
void meta_gpu_kms_get_max_buffer_size (MetaGpuKms *gpu_kms, void meta_gpu_kms_get_max_buffer_size (MetaGpuKms *gpu_kms,