1 /* 2 * Cogl 3 * 4 * A Low Level GPU Graphics and Utilities API 5 * 6 * Copyright (C) 2011 Intel Corporation. 7 * 8 * Permission is hereby granted, free of charge, to any person 9 * obtaining a copy of this software and associated documentation 10 * files (the "Software"), to deal in the Software without 11 * restriction, including without limitation the rights to use, copy, 12 * modify, merge, publish, distribute, sublicense, and/or sell copies 13 * of the Software, and to permit persons to whom the Software is 14 * furnished to do so, subject to the following conditions: 15 * 16 * The above copyright notice and this permission notice shall be 17 * included in all copies or substantial portions of the Software. 18 * 19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 * SOFTWARE. 27 */ 28 29 #if !defined(__COGL_H_INSIDE__) && !defined(COGL_COMPILATION) 30 #error "Only <cogl/cogl.h> can be included directly." 31 #endif 32 33 #ifndef __COGL_KMS_RENDERER_H__ 34 #define __COGL_KMS_RENDERER_H__ 35 36 #include <cogl/cogl-types.h> 37 #include <cogl/cogl-renderer.h> 38 39 COGL_BEGIN_DECLS 40 41 /** 42 * cogl_kms_renderer_set_kms_fd: 43 * @renderer: A #CoglRenderer 44 * @fd: The fd to kms to use 45 * 46 * Sets the file descriptor Cogl should use to communicate 47 * to the kms driver. If -1 (the default), then Cogl will 48 * open its own FD by trying to open "/dev/dri/card0". 49 * 50 * Since: 1.18 51 * Stability: unstable 52 */ 53 void 54 cogl_kms_renderer_set_kms_fd (CoglRenderer *renderer, 55 int fd); 56 57 /** 58 * cogl_kms_renderer_get_kms_fd: 59 * @renderer: A #CoglRenderer 60 * 61 * Queries the file descriptor Cogl is using internally for 62 * communicating with the kms driver. 63 * 64 * Return value: The kms file descriptor or -1 if no kms file 65 * desriptor has been opened by Cogl. 66 * Stability: unstable 67 */ 68 int 69 cogl_kms_renderer_get_kms_fd (CoglRenderer *renderer); 70 71 struct gbm_device * 72 cogl_kms_renderer_get_gbm (CoglRenderer *renderer); 73 COGL_END_DECLS 74 #endif /* __COGL_KMS_RENDERER_H__ */ 75