xref: /aosp_15_r20/external/libdrm/tests/kms/libkms-test-crtc.c (revision 7688df22e49036ff52a766b7101da3a49edadb8c)
1*7688df22SAndroid Build Coastguard Worker /*
2*7688df22SAndroid Build Coastguard Worker  * Copyright © 2014 NVIDIA Corporation
3*7688df22SAndroid Build Coastguard Worker  *
4*7688df22SAndroid Build Coastguard Worker  * Permission is hereby granted, free of charge, to any person obtaining a
5*7688df22SAndroid Build Coastguard Worker  * copy of this software and associated documentation files (the "Software"),
6*7688df22SAndroid Build Coastguard Worker  * to deal in the Software without restriction, including without limitation
7*7688df22SAndroid Build Coastguard Worker  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8*7688df22SAndroid Build Coastguard Worker  * and/or sell copies of the Software, and to permit persons to whom the
9*7688df22SAndroid Build Coastguard Worker  * Software is furnished to do so, subject to the following conditions:
10*7688df22SAndroid Build Coastguard Worker  *
11*7688df22SAndroid Build Coastguard Worker  * The above copyright notice and this permission notice (including the next
12*7688df22SAndroid Build Coastguard Worker  * paragraph) shall be included in all copies or substantial portions of the
13*7688df22SAndroid Build Coastguard Worker  * Software.
14*7688df22SAndroid Build Coastguard Worker  *
15*7688df22SAndroid Build Coastguard Worker  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16*7688df22SAndroid Build Coastguard Worker  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17*7688df22SAndroid Build Coastguard Worker  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
18*7688df22SAndroid Build Coastguard Worker  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19*7688df22SAndroid Build Coastguard Worker  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20*7688df22SAndroid Build Coastguard Worker  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21*7688df22SAndroid Build Coastguard Worker  * IN THE SOFTWARE.
22*7688df22SAndroid Build Coastguard Worker  */
23*7688df22SAndroid Build Coastguard Worker 
24*7688df22SAndroid Build Coastguard Worker #include "libkms-test.h"
25*7688df22SAndroid Build Coastguard Worker 
kms_crtc_create(struct kms_device * device,uint32_t id)26*7688df22SAndroid Build Coastguard Worker struct kms_crtc *kms_crtc_create(struct kms_device *device, uint32_t id)
27*7688df22SAndroid Build Coastguard Worker {
28*7688df22SAndroid Build Coastguard Worker 	struct kms_crtc *crtc;
29*7688df22SAndroid Build Coastguard Worker 
30*7688df22SAndroid Build Coastguard Worker 	crtc = calloc(1, sizeof(*crtc));
31*7688df22SAndroid Build Coastguard Worker 	if (!crtc)
32*7688df22SAndroid Build Coastguard Worker 		return NULL;
33*7688df22SAndroid Build Coastguard Worker 
34*7688df22SAndroid Build Coastguard Worker 	crtc->device = device;
35*7688df22SAndroid Build Coastguard Worker 	crtc->id = id;
36*7688df22SAndroid Build Coastguard Worker 
37*7688df22SAndroid Build Coastguard Worker 	return crtc;
38*7688df22SAndroid Build Coastguard Worker }
39*7688df22SAndroid Build Coastguard Worker 
kms_crtc_free(struct kms_crtc * crtc)40*7688df22SAndroid Build Coastguard Worker void kms_crtc_free(struct kms_crtc *crtc)
41*7688df22SAndroid Build Coastguard Worker {
42*7688df22SAndroid Build Coastguard Worker 	free(crtc);
43*7688df22SAndroid Build Coastguard Worker }
44