blob: 70ee76cc7e66da04f1e72f650651c24bf82c344e [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)
Yalong Liubdcf9122018-01-19 18:35:02 +080030
31/**
32 * User-desired buffer creation information structure.
33 *
34 * @size: user-desired memory allocation size.
Yalong Liubdcf9122018-01-19 18:35:02 +080035 * @flags: user request for setting memory type or cache attributes.
36 * @handle: returned a handle to created gem object.
Ao Xu0733c432018-11-02 17:35:02 +080037 * - this handle will be set by gem module of kernel side.
Yalong Liubdcf9122018-01-19 18:35:02 +080038 */
Yalong Liu22dc0a52018-02-22 10:27:20 +080039struct drm_meson_gem_create {
Ao Xu0733c432018-11-02 17:35:02 +080040 __u64 size;
41 __u32 flags;
42 __u32 handle;
Yalong Liubdcf9122018-01-19 18:35:02 +080043};
44
Ao Xu0733c432018-11-02 17:35:02 +080045#define DRM_MESON_GEM_CREATE 0x00
Yalong Liubdcf9122018-01-19 18:35:02 +080046
Ao Xu0733c432018-11-02 17:35:02 +080047#define DRM_IOCTL_MESON_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + \
Yalong Liu22dc0a52018-02-22 10:27:20 +080048 DRM_MESON_GEM_CREATE, struct drm_meson_gem_create)
Yalong Liubdcf9122018-01-19 18:35:02 +080049
Ao Xu0733c432018-11-02 17:35:02 +080050#endif /* _MESON_DRM_H */