aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'exynos/exynos_drm.c')
-rw-r--r--exynos/exynos_drm.c37
1 files changed, 20 insertions, 17 deletions
diff --git a/exynos/exynos_drm.c b/exynos/exynos_drm.c
index 5fff2597..4c7dd13e 100644
--- a/exynos/exynos_drm.c
+++ b/exynos/exynos_drm.c
@@ -38,6 +38,7 @@
38 38
39#include <xf86drm.h> 39#include <xf86drm.h>
40 40
41#include "libdrm.h"
41#include "exynos_drm.h" 42#include "exynos_drm.h"
42#include "exynos_drmif.h" 43#include "exynos_drmif.h"
43 44
@@ -48,7 +49,7 @@
48 * 49 *
49 * if true, return the device object else NULL. 50 * if true, return the device object else NULL.
50 */ 51 */
51struct exynos_device * exynos_device_create(int fd) 52drm_public struct exynos_device * exynos_device_create(int fd)
52{ 53{
53 struct exynos_device *dev; 54 struct exynos_device *dev;
54 55
@@ -69,7 +70,7 @@ struct exynos_device * exynos_device_create(int fd)
69 * 70 *
70 * @dev: exynos drm device object. 71 * @dev: exynos drm device object.
71 */ 72 */
72void exynos_device_destroy(struct exynos_device *dev) 73drm_public void exynos_device_destroy(struct exynos_device *dev)
73{ 74{
74 free(dev); 75 free(dev);
75} 76}
@@ -87,8 +88,8 @@ void exynos_device_destroy(struct exynos_device *dev)
87 * 88 *
88 * if true, return a exynos buffer object else NULL. 89 * if true, return a exynos buffer object else NULL.
89 */ 90 */
90struct exynos_bo * exynos_bo_create(struct exynos_device *dev, 91drm_public struct exynos_bo * exynos_bo_create(struct exynos_device *dev,
91 size_t size, uint32_t flags) 92 size_t size, uint32_t flags)
92{ 93{
93 struct exynos_bo *bo; 94 struct exynos_bo *bo;
94 struct drm_exynos_gem_create req = { 95 struct drm_exynos_gem_create req = {
@@ -141,8 +142,8 @@ fail:
141 * 142 *
142 * if true, return 0 else negative. 143 * if true, return 0 else negative.
143 */ 144 */
144int exynos_bo_get_info(struct exynos_device *dev, uint32_t handle, 145drm_public int exynos_bo_get_info(struct exynos_device *dev, uint32_t handle,
145 size_t *size, uint32_t *flags) 146 size_t *size, uint32_t *flags)
146{ 147{
147 int ret; 148 int ret;
148 struct drm_exynos_gem_info req = { 149 struct drm_exynos_gem_info req = {
@@ -167,7 +168,7 @@ int exynos_bo_get_info(struct exynos_device *dev, uint32_t handle,
167 * 168 *
168 * @bo: a exynos buffer object to be destroyed. 169 * @bo: a exynos buffer object to be destroyed.
169 */ 170 */
170void exynos_bo_destroy(struct exynos_bo *bo) 171drm_public void exynos_bo_destroy(struct exynos_bo *bo)
171{ 172{
172 if (!bo) 173 if (!bo)
173 return; 174 return;
@@ -199,7 +200,8 @@ void exynos_bo_destroy(struct exynos_bo *bo)
199 * if true, return a exynos buffer object else NULL. 200 * if true, return a exynos buffer object else NULL.
200 * 201 *
201 */ 202 */
202struct exynos_bo * exynos_bo_from_name(struct exynos_device *dev, uint32_t name) 203drm_public struct exynos_bo *
204exynos_bo_from_name(struct exynos_device *dev, uint32_t name)
203{ 205{
204 struct exynos_bo *bo; 206 struct exynos_bo *bo;
205 struct drm_gem_open req = { 207 struct drm_gem_open req = {
@@ -241,7 +243,7 @@ err_free_bo:
241 * 243 *
242 * if true, return 0 else negative. 244 * if true, return 0 else negative.
243 */ 245 */
244int exynos_bo_get_name(struct exynos_bo *bo, uint32_t *name) 246drm_public int exynos_bo_get_name(struct exynos_bo *bo, uint32_t *name)
245{ 247{
246 if (!bo->name) { 248 if (!bo->name) {
247 struct drm_gem_flink req = { 249 struct drm_gem_flink req = {
@@ -264,7 +266,7 @@ int exynos_bo_get_name(struct exynos_bo *bo, uint32_t *name)
264 return 0; 266 return 0;
265} 267}
266 268
267uint32_t exynos_bo_handle(struct exynos_bo *bo) 269drm_public uint32_t exynos_bo_handle(struct exynos_bo *bo)
268{ 270{
269 return bo->handle; 271 return bo->handle;
270} 272}
@@ -277,7 +279,7 @@ uint32_t exynos_bo_handle(struct exynos_bo *bo)
277 * 279 *
278 * if true, user pointer mmaped else NULL. 280 * if true, user pointer mmaped else NULL.
279 */ 281 */
280void *exynos_bo_map(struct exynos_bo *bo) 282drm_public void *exynos_bo_map(struct exynos_bo *bo)
281{ 283{
282 if (!bo->vaddr) { 284 if (!bo->vaddr) {
283 struct exynos_device *dev = bo->dev; 285 struct exynos_device *dev = bo->dev;
@@ -309,8 +311,8 @@ void *exynos_bo_map(struct exynos_bo *bo)
309 * 311 *
310 * @return: 0 on success, -1 on error, and errno will be set 312 * @return: 0 on success, -1 on error, and errno will be set
311 */ 313 */
312int exynos_prime_handle_to_fd(struct exynos_device *dev, uint32_t handle, 314drm_public int
313 int *fd) 315exynos_prime_handle_to_fd(struct exynos_device *dev, uint32_t handle, int *fd)
314{ 316{
315 return drmPrimeHandleToFD(dev->fd, handle, 0, fd); 317 return drmPrimeHandleToFD(dev->fd, handle, 0, fd);
316} 318}
@@ -324,8 +326,8 @@ int exynos_prime_handle_to_fd(struct exynos_device *dev, uint32_t handle,
324 * 326 *
325 * @return: 0 on success, -1 on error, and errno will be set 327 * @return: 0 on success, -1 on error, and errno will be set
326 */ 328 */
327int exynos_prime_fd_to_handle(struct exynos_device *dev, int fd, 329drm_public int
328 uint32_t *handle) 330exynos_prime_fd_to_handle(struct exynos_device *dev, int fd, uint32_t *handle)
329{ 331{
330 return drmPrimeFDToHandle(dev->fd, fd, handle); 332 return drmPrimeFDToHandle(dev->fd, fd, handle);
331} 333}
@@ -347,8 +349,9 @@ int exynos_prime_fd_to_handle(struct exynos_device *dev, int fd,
347 * 349 *
348 * if true, return 0 else negative. 350 * if true, return 0 else negative.
349 */ 351 */
350int exynos_vidi_connection(struct exynos_device *dev, uint32_t connect, 352drm_public int
351 uint32_t ext, void *edid) 353exynos_vidi_connection(struct exynos_device *dev, uint32_t connect,
354 uint32_t ext, void *edid)
352{ 355{
353 struct drm_exynos_vidi_connection req = { 356 struct drm_exynos_vidi_connection req = {
354 .connection = connect, 357 .connection = connect,