blob: ec05b1ea94576a9e62ffd114a634e02d7605a81d [file] [log] [blame]
limin.tian8c5c1e12023-02-28 03:27:14 +00001/* SPDX-License-Identifier: MIT */
2/*
3 * Copyright © 2019-2022 Amlogic Inc.
4 */
Yalong Liubdcf9122018-01-19 18:35:02 +08005
Ao Xu0733c432018-11-02 17:35:02 +08006#ifndef _MESON_DRM_H
7#define _MESON_DRM_H
Yalong Liubdcf9122018-01-19 18:35:02 +08008
Ao Xu0733c432018-11-02 17:35:02 +08009#include <drm/drm.h>
10
11/* Use flags */
12#define MESON_USE_NONE 0
13#define MESON_USE_SCANOUT (1ull << 0)
14#define MESON_USE_CURSOR (1ull << 1)
15#define MESON_USE_RENDERING (1ull << 2)
16#define MESON_USE_LINEAR (1ull << 3)
17#define MESON_USE_PROTECTED (1ull << 11)
18#define MESON_USE_HW_VIDEO_ENCODER (1ull << 12)
19#define MESON_USE_CAMERA_WRITE (1ull << 13)
20#define MESON_USE_CAMERA_READ (1ull << 14)
21#define MESON_USE_TEXTURE (1ull << 17)
Ao Xu6fbd0322020-04-14 18:08:22 +080022#define MESON_USE_VIDEO_PLANE (1ull << 18)
23#define MESON_USE_VIDEO_AFBC (1ull << 19)
Ao Xu6747bbd2020-09-28 20:02:09 +080024#define MESON_USE_VD1 (1ull << 20)
25#define MESON_USE_VD2 (1ull << 21)
Yalong Liubdcf9122018-01-19 18:35:02 +080026
27/**
28 * User-desired buffer creation information structure.
29 *
30 * @size: user-desired memory allocation size.
Yalong Liubdcf9122018-01-19 18:35:02 +080031 * @flags: user request for setting memory type or cache attributes.
32 * @handle: returned a handle to created gem object.
Ao Xu0733c432018-11-02 17:35:02 +080033 * - this handle will be set by gem module of kernel side.
Yalong Liubdcf9122018-01-19 18:35:02 +080034 */
Yalong Liu22dc0a52018-02-22 10:27:20 +080035struct drm_meson_gem_create {
Ao Xu0733c432018-11-02 17:35:02 +080036 __u64 size;
37 __u32 flags;
38 __u32 handle;
Yalong Liubdcf9122018-01-19 18:35:02 +080039};
40
sky zhouf05ca462020-10-29 18:07:40 +080041/*Memory related.*/
Ao Xu0733c432018-11-02 17:35:02 +080042#define DRM_IOCTL_MESON_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + \
sky zhouf05ca462020-10-29 18:07:40 +080043 0x00, struct drm_meson_gem_create)
wenlong.zhang7d32ed92023-04-12 06:08:17 +000044#define DRM_IOCTL_MESON_RMFB DRM_IOWR(DRM_COMMAND_BASE + \
45 0x01, unsigned int)
sky zhouf05ca462020-10-29 18:07:40 +080046
47/*KMS related.*/
48#define DRM_IOCTL_MESON_ASYNC_ATOMIC DRM_IOWR(DRM_COMMAND_BASE + \
49 0x10, struct drm_mode_atomic)
Yalong Liubdcf9122018-01-19 18:35:02 +080050
Ao Xu0733c432018-11-02 17:35:02 +080051#endif /* _MESON_DRM_H */