blob: 72e326f9c7defd73eab70d139dde8d867e3bd776 [file] [log] [blame]
Russell King96f60e32012-08-15 13:59:49 +01001/*
2 * Copyright (C) 2012 Russell King
3 * With inspiration from the i915 driver
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 */
9#ifndef DRM_ARMADA_IOCTL_H
10#define DRM_ARMADA_IOCTL_H
11
Gabriel Laskar6a14d012015-11-30 15:10:41 +010012#include "drm.h"
13
Emil Velikov12246492016-04-07 18:47:05 +010014#if defined(__cplusplus)
15extern "C" {
16#endif
17
Russell King96f60e32012-08-15 13:59:49 +010018#define DRM_ARMADA_GEM_CREATE 0x00
19#define DRM_ARMADA_GEM_MMAP 0x02
20#define DRM_ARMADA_GEM_PWRITE 0x03
21
22#define ARMADA_IOCTL(dir, name, str) \
23 DRM_##dir(DRM_COMMAND_BASE + DRM_ARMADA_##name, struct drm_armada_##str)
24
25struct drm_armada_gem_create {
26 uint32_t handle;
27 uint32_t size;
28};
29#define DRM_IOCTL_ARMADA_GEM_CREATE \
30 ARMADA_IOCTL(IOWR, GEM_CREATE, gem_create)
31
32struct drm_armada_gem_mmap {
33 uint32_t handle;
34 uint32_t pad;
35 uint64_t offset;
36 uint64_t size;
37 uint64_t addr;
38};
39#define DRM_IOCTL_ARMADA_GEM_MMAP \
40 ARMADA_IOCTL(IOWR, GEM_MMAP, gem_mmap)
41
42struct drm_armada_gem_pwrite {
43 uint64_t ptr;
44 uint32_t handle;
45 uint32_t offset;
46 uint32_t size;
47};
48#define DRM_IOCTL_ARMADA_GEM_PWRITE \
49 ARMADA_IOCTL(IOW, GEM_PWRITE, gem_pwrite)
50
Emil Velikov12246492016-04-07 18:47:05 +010051#if defined(__cplusplus)
52}
53#endif
54
Russell King96f60e32012-08-15 13:59:49 +010055#endif