~thopiekar/arm-mali/libvdpau-sunxi

1 by Jens Kuske
First release
1
/*
2
 * Copyright (c) 2013 Jens Kuske <jenskuske@gmail.com>
3
 *
4
 * This library is free software; you can redistribute it and/or
5
 * modify it under the terms of the GNU Lesser General Public
6
 * License as published by the Free Software Foundation; either
7
 * version 2.1 of the License, or (at your option) any later version.
8
 *
9
 * This library is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
 * Lesser General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU Lesser General Public
15
 * License along with this library; if not, write to the Free Software
16
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
17
 *
18
 */
19
20
#ifndef __VE_H__
21
#define __VE_H__
22
23
#include <stdint.h>
24
25
int ve_open(void);
26
void ve_close(void);
27
void ve_flush_cache(void *start, int len);
28
void *ve_get_regs(void);
8 by Jens Kuske
Add function to get VE version
29
int ve_get_version(void);
1 by Jens Kuske
First release
30
int ve_wait(int timeout);
31
32
void *ve_malloc(int size);
33
void ve_free(void *ptr);
34
uint32_t ve_virt2phys(void *ptr);
35
36
static inline void writel(uint32_t val, void *addr)
37
{
38
	*((volatile uint32_t *)addr) = val;
39
}
40
41
static inline uint32_t readl(void *addr)
42
{
43
	return *((volatile uint32_t *) addr);
44
}
45
46
#define VE_CTRL				0x000
8 by Jens Kuske
Add function to get VE version
47
#define VE_VERSION			0x0f0
1 by Jens Kuske
First release
48
49
#define VE_MPEG_PIC_HDR			0x100
25 by Jens Kuske
Add very basic mp4 decoder
50
#define VE_MPEG_VOP_HDR			0x104
1 by Jens Kuske
First release
51
#define VE_MPEG_SIZE			0x108
52
#define VE_MPEG_FRAME_SIZE		0x10c
25 by Jens Kuske
Add very basic mp4 decoder
53
#define VE_MPEG_MBA			0x110
1 by Jens Kuske
First release
54
#define VE_MPEG_CTRL			0x114
55
#define VE_MPEG_TRIGGER			0x118
56
#define VE_MPEG_STATUS			0x11c
25 by Jens Kuske
Add very basic mp4 decoder
57
#define VE_MPEG_TRBTRD_FIELD		0x120
58
#define VE_MPEG_TRBTRD_FRAME		0x124
1 by Jens Kuske
First release
59
#define VE_MPEG_VLD_ADDR		0x128
60
#define VE_MPEG_VLD_OFFSET		0x12c
61
#define VE_MPEG_VLD_LEN			0x130
62
#define VE_MPEG_VLD_END			0x134
25 by Jens Kuske
Add very basic mp4 decoder
63
#define VE_MPEG_MBH_ADDR		0x138
64
#define VE_MPEG_DCAC_ADDR		0x13c
65
#define VE_MPEG_NCF_ADDR		0x144
1 by Jens Kuske
First release
66
#define VE_MPEG_REC_LUMA		0x148
67
#define VE_MPEG_REC_CHROMA		0x14c
68
#define VE_MPEG_FWD_LUMA		0x150
69
#define VE_MPEG_FWD_CHROMA		0x154
70
#define VE_MPEG_BACK_LUMA		0x158
71
#define VE_MPEG_BACK_CHROMA		0x15c
72
#define VE_MPEG_IQ_MIN_INPUT		0x180
25 by Jens Kuske
Add very basic mp4 decoder
73
#define VE_MPEG_QP_INPUT		0x184
74
1 by Jens Kuske
First release
75
#define VE_MPEG_ROT_LUMA		0x1cc
76
#define VE_MPEG_ROT_CHROMA		0x1d0
77
#define VE_MPEG_SDROT_CTRL		0x1d4
78
79
#define VE_H264_FRAME_SIZE		0x200
80
#define VE_H264_PIC_HDR			0x204
81
#define VE_H264_SLICE_HDR		0x208
82
#define VE_H264_SLICE_HDR2		0x20c
83
#define VE_H264_PRED_WEIGHT		0x210
84
#define VE_H264_QP_PARAM		0x21c
85
#define VE_H264_CTRL			0x220
86
#define VE_H264_TRIGGER			0x224
87
#define VE_H264_STATUS			0x228
88
#define VE_H264_CUR_MB_NUM		0x22c
89
#define VE_H264_VLD_ADDR		0x230
90
#define VE_H264_VLD_OFFSET		0x234
91
#define VE_H264_VLD_LEN			0x238
92
#define VE_H264_VLD_END			0x23c
93
#define VE_H264_SDROT_CTRL		0x240
94
#define VE_H264_OUTPUT_FRAME_IDX	0x24c
95
#define VE_H264_EXTRA_BUFFER1		0x250
96
#define VE_H264_EXTRA_BUFFER2		0x254
97
#define VE_H264_BASIC_BITS		0x2dc
98
#define VE_H264_RAM_WRITE_PTR		0x2e0
99
#define VE_H264_RAM_WRITE_DATA		0x2e4
100
101
#define VE_SRAM_H264_PRED_WEIGHT_TABLE	0x000
102
#define VE_SRAM_H264_FRAMEBUFFER_LIST	0x400
103
#define VE_SRAM_H264_REF_LIST0		0x640
104
#define VE_SRAM_H264_REF_LIST1		0x664
13 by Jens Kuske
Add support for custom h264 scaling lists
105
#define VE_SRAM_H264_SCALING_LISTS	0x800
1 by Jens Kuske
First release
106
107
#endif