Back to index

libdrm  2.4.37
exynos_drmif.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2012 Samsung Electronics Co., Ltd.
00003  *
00004  * Permission is hereby granted, free of charge, to any person obtaining a
00005  * copy of this software and associated documentation files (the "Software"),
00006  * to deal in the Software without restriction, including without limitation
00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
00008  * and/or sell copies of the Software, and to permit persons to whom the
00009  * Software is furnished to do so, subject to the following conditions:
00010  *
00011  * The above copyright notice and this permission notice (including the next
00012  * paragraph) shall be included in all copies or substantial portions of the
00013  * Software.
00014  *
00015  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00016  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00017  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
00018  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00019  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
00020  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
00021  * SOFTWARE.
00022  *
00023  * Authors:
00024  *    Inki Dae <inki.dae@samsung.com>
00025  */
00026 
00027 #ifndef EXYNOS_DRMIF_H_
00028 #define EXYNOS_DRMIF_H_
00029 
00030 #include <xf86drm.h>
00031 #include <stdint.h>
00032 #include "exynos_drm.h"
00033 
00034 struct exynos_device {
00035        int fd;
00036 };
00037 
00038 /*
00039  * Exynos Buffer Object structure.
00040  *
00041  * @dev: exynos device object allocated.
00042  * @handle: a gem handle to gem object created.
00043  * @flags: indicate memory allocation and cache attribute types.
00044  * @fd: file descriptor exported into dmabuf.
00045  * @size: size to the buffer created.
00046  * @vaddr: user space address to a gem buffer mmaped.
00047  * @name: a gem global handle from flink request.
00048  */
00049 struct exynos_bo {
00050        struct exynos_device *dev;
00051        uint32_t             handle;
00052        uint32_t             flags;
00053        int                  fd;
00054        size_t               size;
00055        void                 *vaddr;
00056        uint32_t             name;
00057 };
00058 
00059 /*
00060  * device related functions:
00061  */
00062 struct exynos_device * exynos_device_create(int fd);
00063 void exynos_device_destroy(struct exynos_device *dev);
00064 
00065 /*
00066  * buffer-object related functions:
00067  */
00068 struct exynos_bo * exynos_bo_create(struct exynos_device *dev,
00069               size_t size, uint32_t flags);
00070 int exynos_bo_get_info(struct exynos_device *dev, uint32_t handle,
00071                      size_t *size, uint32_t *flags);
00072 void exynos_bo_destroy(struct exynos_bo *bo);
00073 struct exynos_bo * exynos_bo_from_name(struct exynos_device *dev, uint32_t name);
00074 int exynos_bo_get_name(struct exynos_bo *bo, uint32_t *name);
00075 uint32_t exynos_bo_handle(struct exynos_bo *bo);
00076 void * exynos_bo_map(struct exynos_bo *bo);
00077 int exynos_prime_handle_to_fd(struct exynos_device *dev, uint32_t handle,
00078                                    int *fd);
00079 int exynos_prime_fd_to_handle(struct exynos_device *dev, int fd,
00080                                    uint32_t *handle);
00081 
00082 /*
00083  * Virtual Display related functions:
00084  */
00085 int exynos_vidi_connection(struct exynos_device *dev, uint32_t connect,
00086                             uint32_t ext, void *edid);
00087 
00088 #endif /* EXYNOS_DRMIF_H_ */