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