2 * Copyright © 2018 Broadcom
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24 #ifndef DRM_SHIM_V3D_H
25 #define DRM_SHIM_V3D_H
27 #include "broadcom/common/v3d_device_info.h"
32 struct v3d_shim_device
{
34 struct v3d_device_info
*devinfo
;
36 /* Base virtual address of the heap. */
38 /* Base hardware address of the heap. */
40 /* Size of the heap. */
43 /* Allocator for the GPU virtual addresses. */
44 struct util_vma_heap heap
;
46 extern struct v3d_shim_device v3d
;
55 static inline struct v3d_bo
*
56 v3d_bo(struct shim_bo
*bo
)
58 return (struct v3d_bo
*)bo
;
61 struct v3d_bo
*v3d_bo_lookup(struct shim_fd
*shim_fd
, int handle
);
62 int v3d_ioctl_wait_bo(int fd
, unsigned long request
, void *arg
);
63 int v3d_ioctl_mmap_bo(int fd
, unsigned long request
, void *arg
);
64 int v3d_ioctl_get_bo_offset(int fd
, unsigned long request
, void *arg
);
66 void v3d33_drm_shim_driver_init(void);
67 void v3d41_drm_shim_driver_init(void);
68 void v3d42_drm_shim_driver_init(void);
70 #endif /* DRM_SHIM_V3D_H */