81 lines
1.8 KiB
C
81 lines
1.8 KiB
C
|
/*
|
||
|
* Copyright (C) 2019 Red Hat
|
||
|
*
|
||
|
* This program is free software; you can redistribute it and/or
|
||
|
* modify it under the terms of the GNU General Public License as
|
||
|
* published by the Free Software Foundation; either version 2 of the
|
||
|
* License, or (at your option) any later version.
|
||
|
*
|
||
|
* This program is distributed in the hope that it will be useful, but
|
||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||
|
* General Public License for more details.
|
||
|
*
|
||
|
* You should have received a copy of the GNU General Public License
|
||
|
* along with this program; if not, write to the Free Software
|
||
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||
|
* 02111-1307, USA.
|
||
|
*/
|
||
|
|
||
|
#include "config.h"
|
||
|
|
||
|
#include "backends/native/meta-kms-crtc.h"
|
||
|
#include "backends/native/meta-kms-crtc-private.h"
|
||
|
|
||
|
#include "backends/native/meta-kms-impl-device.h"
|
||
|
|
||
|
struct _MetaKmsCrtc
|
||
|
{
|
||
|
GObject parent;
|
||
|
|
||
|
MetaKmsDevice *device;
|
||
|
|
||
|
uint32_t id;
|
||
|
int idx;
|
||
|
};
|
||
|
|
||
|
G_DEFINE_TYPE (MetaKmsCrtc, meta_kms_crtc, G_TYPE_OBJECT)
|
||
|
|
||
|
MetaKmsDevice *
|
||
|
meta_kms_crtc_get_device (MetaKmsCrtc *crtc)
|
||
|
{
|
||
|
return crtc->device;
|
||
|
}
|
||
|
|
||
|
uint32_t
|
||
|
meta_kms_crtc_get_id (MetaKmsCrtc *crtc)
|
||
|
{
|
||
|
return crtc->id;
|
||
|
}
|
||
|
|
||
|
int
|
||
|
meta_kms_crtc_get_idx (MetaKmsCrtc *crtc)
|
||
|
{
|
||
|
return crtc->idx;
|
||
|
}
|
||
|
|
||
|
MetaKmsCrtc *
|
||
|
meta_kms_crtc_new (MetaKmsImplDevice *impl_device,
|
||
|
drmModeCrtc *drm_crtc,
|
||
|
int idx)
|
||
|
{
|
||
|
MetaKmsCrtc *crtc;
|
||
|
|
||
|
crtc = g_object_new (META_TYPE_KMS_CRTC, NULL);
|
||
|
crtc->device = meta_kms_impl_device_get_device (impl_device);
|
||
|
crtc->id = drm_crtc->crtc_id;
|
||
|
crtc->idx = idx;
|
||
|
|
||
|
return crtc;
|
||
|
}
|
||
|
|
||
|
static void
|
||
|
meta_kms_crtc_init (MetaKmsCrtc *crtc)
|
||
|
{
|
||
|
}
|
||
|
|
||
|
static void
|
||
|
meta_kms_crtc_class_init (MetaKmsCrtcClass *klass)
|
||
|
{
|
||
|
}
|