Back to index

libdrm  2.4.37
internal.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 INTERNAL_H_
00030 #define INTERNAL_H_
00031 
00032 #include "libkms.h"
00033 
00034 struct kms_driver
00035 {
00036        int (*get_prop)(struct kms_driver *kms, const unsigned key,
00037                      unsigned *out);
00038        int (*destroy)(struct kms_driver *kms);
00039 
00040        int (*bo_create)(struct kms_driver *kms,
00041                       unsigned width,
00042                       unsigned height,
00043                       enum kms_bo_type type,
00044                       const unsigned *attr,
00045                       struct kms_bo **out);
00046        int (*bo_get_prop)(struct kms_bo *bo, const unsigned key,
00047                         unsigned *out);
00048        int (*bo_map)(struct kms_bo *bo, void **out);
00049        int (*bo_unmap)(struct kms_bo *bo);
00050        int (*bo_destroy)(struct kms_bo *bo);
00051 
00052        int fd;
00053 };
00054 
00055 struct kms_bo
00056 {
00057        struct kms_driver *kms;
00058        void *ptr;
00059        size_t size;
00060        size_t offset;
00061        size_t pitch;
00062        unsigned handle;
00063 };
00064 
00065 int linux_create(int fd, struct kms_driver **out);
00066 
00067 int vmwgfx_create(int fd, struct kms_driver **out);
00068 
00069 int intel_create(int fd, struct kms_driver **out);
00070 
00071 int dumb_create(int fd, struct kms_driver **out);
00072 
00073 int nouveau_create(int fd, struct kms_driver **out);
00074 
00075 int radeon_create(int fd, struct kms_driver **out);
00076 
00077 #endif