blob: 26b6c7b87a50e4ab052586c860521a9219088769 [file] [log] [blame]
Yalong Liubdcf9122018-01-19 18:35:02 +08001/*
Ao Xu0733c432018-11-02 17:35:02 +08002 * include/uapi/drm/meson_drm.h
Yalong Liubdcf9122018-01-19 18:35:02 +08003 *
Ao Xu0733c432018-11-02 17:35:02 +08004 * Copyright (C) 2016 Amlogic, Inc. All rights reserved.
Yalong Liubdcf9122018-01-19 18:35:02 +08005 *
Ao Xu0733c432018-11-02 17:35:02 +08006 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
Yalong Liubdcf9122018-01-19 18:35:02 +080010 */
11
Ao Xu0733c432018-11-02 17:35:02 +080012#ifndef _MESON_DRM_H
13#define _MESON_DRM_H
Yalong Liubdcf9122018-01-19 18:35:02 +080014
Ao Xu0733c432018-11-02 17:35:02 +080015#include <drm/drm.h>
16
17/* Use flags */
18#define MESON_USE_NONE 0
19#define MESON_USE_SCANOUT (1ull << 0)
20#define MESON_USE_CURSOR (1ull << 1)
21#define MESON_USE_RENDERING (1ull << 2)
22#define MESON_USE_LINEAR (1ull << 3)
23#define MESON_USE_PROTECTED (1ull << 11)
24#define MESON_USE_HW_VIDEO_ENCODER (1ull << 12)
25#define MESON_USE_CAMERA_WRITE (1ull << 13)
26#define MESON_USE_CAMERA_READ (1ull << 14)
27#define MESON_USE_TEXTURE (1ull << 17)
Ao Xu6fbd0322020-04-14 18:08:22 +080028#define MESON_USE_VIDEO_PLANE (1ull << 18)
29#define MESON_USE_VIDEO_AFBC (1ull << 19)
Ao Xu6747bbd2020-09-28 20:02:09 +080030#define MESON_USE_VD1 (1ull << 20)
31#define MESON_USE_VD2 (1ull << 21)
Yalong Liubdcf9122018-01-19 18:35:02 +080032
33/**
34 * User-desired buffer creation information structure.
35 *
36 * @size: user-desired memory allocation size.
Yalong Liubdcf9122018-01-19 18:35:02 +080037 * @flags: user request for setting memory type or cache attributes.
38 * @handle: returned a handle to created gem object.
Ao Xu0733c432018-11-02 17:35:02 +080039 * - this handle will be set by gem module of kernel side.
Yalong Liubdcf9122018-01-19 18:35:02 +080040 */
Yalong Liu22dc0a52018-02-22 10:27:20 +080041struct drm_meson_gem_create {
Ao Xu0733c432018-11-02 17:35:02 +080042 __u64 size;
43 __u32 flags;
44 __u32 handle;
Yalong Liubdcf9122018-01-19 18:35:02 +080045};
46
sky zhouf05ca462020-10-29 18:07:40 +080047/*Memory related.*/
Ao Xu0733c432018-11-02 17:35:02 +080048#define DRM_IOCTL_MESON_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + \
sky zhouf05ca462020-10-29 18:07:40 +080049 0x00, struct drm_meson_gem_create)
50
51/*KMS related.*/
52#define DRM_IOCTL_MESON_ASYNC_ATOMIC DRM_IOWR(DRM_COMMAND_BASE + \
53 0x10, struct drm_mode_atomic)
Yalong Liubdcf9122018-01-19 18:35:02 +080054
Ao Xu0733c432018-11-02 17:35:02 +080055#endif /* _MESON_DRM_H */