limin.tian | 8c5c1e1 | 2023-02-28 03:27:14 +0000 | [diff] [blame] | 1 | /* SPDX-License-Identifier: MIT */
|
| 2 | /*
|
| 3 | * Copyright © 2019-2022 Amlogic Inc.
|
| 4 | */
|
Ao Xu | 0733c43 | 2018-11-02 17:35:02 +0800 | [diff] [blame] | 5 | #ifndef _MESON_DRM_H |
| 6 | #define _MESON_DRM_H |
Yalong Liu | bdcf912 | 2018-01-19 18:35:02 +0800 | [diff] [blame] | 7 | |
Ao Xu | 0733c43 | 2018-11-02 17:35:02 +0800 | [diff] [blame] | 8 | #include <drm/drm.h> |
| 9 | |
| 10 | /* Use flags */ |
| 11 | #define MESON_USE_NONE 0 |
| 12 | #define MESON_USE_SCANOUT (1ull << 0) |
| 13 | #define MESON_USE_CURSOR (1ull << 1) |
| 14 | #define MESON_USE_RENDERING (1ull << 2) |
| 15 | #define MESON_USE_LINEAR (1ull << 3) |
| 16 | #define MESON_USE_PROTECTED (1ull << 11) |
| 17 | #define MESON_USE_HW_VIDEO_ENCODER (1ull << 12) |
| 18 | #define MESON_USE_CAMERA_WRITE (1ull << 13) |
| 19 | #define MESON_USE_CAMERA_READ (1ull << 14) |
| 20 | #define MESON_USE_TEXTURE (1ull << 17) |
Ao Xu | 6fbd032 | 2020-04-14 18:08:22 +0800 | [diff] [blame] | 21 | #define MESON_USE_VIDEO_PLANE (1ull << 18) |
| 22 | #define MESON_USE_VIDEO_AFBC (1ull << 19) |
Ao Xu | 6747bbd | 2020-09-28 20:02:09 +0800 | [diff] [blame] | 23 | #define MESON_USE_VD1 (1ull << 20) |
| 24 | #define MESON_USE_VD2 (1ull << 21) |
Yalong Liu | bdcf912 | 2018-01-19 18:35:02 +0800 | [diff] [blame] | 25 | |
| 26 | /** |
| 27 | * User-desired buffer creation information structure. |
| 28 | * |
| 29 | * @size: user-desired memory allocation size. |
Yalong Liu | bdcf912 | 2018-01-19 18:35:02 +0800 | [diff] [blame] | 30 | * @flags: user request for setting memory type or cache attributes. |
| 31 | * @handle: returned a handle to created gem object. |
Ao Xu | 0733c43 | 2018-11-02 17:35:02 +0800 | [diff] [blame] | 32 | * - this handle will be set by gem module of kernel side. |
Yalong Liu | bdcf912 | 2018-01-19 18:35:02 +0800 | [diff] [blame] | 33 | */ |
Yalong Liu | 22dc0a5 | 2018-02-22 10:27:20 +0800 | [diff] [blame] | 34 | struct drm_meson_gem_create { |
Ao Xu | 0733c43 | 2018-11-02 17:35:02 +0800 | [diff] [blame] | 35 | __u64 size; |
| 36 | __u32 flags; |
| 37 | __u32 handle; |
Yalong Liu | bdcf912 | 2018-01-19 18:35:02 +0800 | [diff] [blame] | 38 | }; |
| 39 | |
linfang.zhao | 374dbdb | 2023-11-03 07:59:47 +0000 | [diff] [blame] | 40 | struct drm_meson_video_zpos_target {
|
chen.wang1 | 33a5c83 | 2023-07-12 04:23:36 +0000 | [diff] [blame] | 41 | __u32 index; |
| 42 | __u32 zpos; |
| 43 | __u32 flag; |
| 44 | }; |
linfang.zhao | 374dbdb | 2023-11-03 07:59:47 +0000 | [diff] [blame] | 45 |
|
| 46 | struct drm_meson_plane_mute {
|
| 47 | int plane_type; /* 0:osd plane, 1:video plane */
|
| 48 | int plane_mute; /* 0:umute plane, 1:mute plane */
|
| 49 | };
|
chen.wang1 | 33a5c83 | 2023-07-12 04:23:36 +0000 | [diff] [blame] | 50 | |
sky zhou | f05ca46 | 2020-10-29 18:07:40 +0800 | [diff] [blame] | 51 | /*Memory related.*/ |
Ao Xu | 0733c43 | 2018-11-02 17:35:02 +0800 | [diff] [blame] | 52 | #define DRM_IOCTL_MESON_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + \ |
sky zhou | f05ca46 | 2020-10-29 18:07:40 +0800 | [diff] [blame] | 53 | 0x00, struct drm_meson_gem_create) |
wenlong.zhang | 7d32ed9 | 2023-04-12 06:08:17 +0000 | [diff] [blame] | 54 | #define DRM_IOCTL_MESON_RMFB DRM_IOWR(DRM_COMMAND_BASE + \ |
| 55 | 0x01, unsigned int) |
sky zhou | f05ca46 | 2020-10-29 18:07:40 +0800 | [diff] [blame] | 56 | |
| 57 | /*KMS related.*/ |
| 58 | #define DRM_IOCTL_MESON_ASYNC_ATOMIC DRM_IOWR(DRM_COMMAND_BASE + \ |
| 59 | 0x10, struct drm_mode_atomic) |
linfang.zhao | 374dbdb | 2023-11-03 07:59:47 +0000 | [diff] [blame] | 60 |
|
chen.wang1 | 33a5c83 | 2023-07-12 04:23:36 +0000 | [diff] [blame] | 61 | #define DRM_IOCTL_MESON_SET_VIDEO_ZPOS DRM_IOWR(DRM_COMMAND_BASE + \ |
| 62 | 0x11, struct drm_meson_video_zpos_target) |
linfang.zhao | 374dbdb | 2023-11-03 07:59:47 +0000 | [diff] [blame] | 63 | #define DRM_IOCTL_MESON_MUTE_PLANE DRM_IOWR(DRM_COMMAND_BASE + \
|
| 64 | 0x12, struct drm_meson_plane_mute)
|
chen.wang1 | 33a5c83 | 2023-07-12 04:23:36 +0000 | [diff] [blame] | 65 |
|
Ao Xu | 0733c43 | 2018-11-02 17:35:02 +0800 | [diff] [blame] | 66 | #endif /* _MESON_DRM_H */ |