Back to index

libdrm  2.4.37
libkms.h
Go to the documentation of this file.
00001 /**************************************************************************
00002  *
00003  * Copyright © 2009 VMware, Inc., Palo Alto, CA., USA
00004  * All Rights Reserved.
00005  *
00006  * Permission is hereby granted, free of charge, to any person obtaining a
00007  * copy of this software and associated documentation files (the
00008  * "Software"), to deal in the Software without restriction, including
00009  * without limitation the rights to use, copy, modify, merge, publish,
00010  * distribute, sub license, and/or sell copies of the Software, and to
00011  * permit persons to whom the Software is furnished to do so, subject to
00012  * the following conditions:
00013  *
00014  * The above copyright notice and this permission notice (including the
00015  * next paragraph) shall be included in all copies or substantial portions
00016  * of the Software.
00017  *
00018  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00019  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00020  * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
00021  * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
00022  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
00023  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
00024  * USE OR OTHER DEALINGS IN THE SOFTWARE.
00025  *
00026  **************************************************************************/
00027 
00028 
00029 #ifndef _LIBKMS_H_
00030 #define _LIBKMS_H_
00031 
00037 struct kms_driver;
00038 struct kms_bo;
00039 
00040 enum kms_attrib
00041 {
00042        KMS_TERMINATE_PROP_LIST,
00043 #define KMS_TERMINATE_PROP_LIST KMS_TERMINATE_PROP_LIST
00044        KMS_BO_TYPE,
00045 #define KMS_BO_TYPE KMS_BO_TYPE
00046        KMS_WIDTH,
00047 #define KMS_WIDTH KMS_WIDTH
00048        KMS_HEIGHT,
00049 #define KMS_HEIGHT KMS_HEIGHT
00050        KMS_PITCH,
00051 #define KMS_PITCH KMS_PITCH
00052        KMS_HANDLE,
00053 #define KMS_HANDLE KMS_HANDLE
00054 };
00055 
00056 enum kms_bo_type
00057 {
00058        KMS_BO_TYPE_SCANOUT_X8R8G8B8 = (1 << 0),
00059 #define KMS_BO_TYPE_SCANOUT_X8R8G8B8 KMS_BO_TYPE_SCANOUT_X8R8G8B8
00060        KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8 =  (1 << 1),
00061 #define KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8 KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8
00062 };
00063 
00064 int kms_create(int fd, struct kms_driver **out);
00065 int kms_get_prop(struct kms_driver *kms, unsigned key, unsigned *out);
00066 int kms_destroy(struct kms_driver **kms);
00067 
00068 int kms_bo_create(struct kms_driver *kms, const unsigned *attr, struct kms_bo **out);
00069 int kms_bo_get_prop(struct kms_bo *bo, unsigned key, unsigned *out);
00070 int kms_bo_map(struct kms_bo *bo, void **out);
00071 int kms_bo_unmap(struct kms_bo *bo);
00072 int kms_bo_destroy(struct kms_bo **bo);
00073 
00074 #endif