1 /*
2  * Copyright (c) 2011 Intel Corporation. All Rights Reserved.
3  * Copyright (c) Imagination Technologies Limited, UK
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the
7  * "Software"), to deal in the Software without restriction, including
8  * without limitation the rights to use, copy, modify, merge, publish,
9  * distribute, sub license, and/or sell copies of the Software, and to
10  * permit persons to whom the Software is furnished to do so, subject to
11  * the following conditions:
12  *
13  * The above copyright notice and this permission notice (including the
14  * next paragraph) shall be included in all copies or substantial portions
15  * of the Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
20  * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
21  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24  */
25 
26 
27 /******************************************************************************
28 
29  @File         msvdx_offsets.h
30 
31  @Title        MSVDX Offsets
32 
33  @Platform
34 
35  @Description
36 
37 ******************************************************************************/
38 #ifndef _MSVDX_OFFSETS_H_
39 #define _MSVDX_OFFSETS_H_
40 
41 #include "msvdx_defs.h"
42 
43 #define REG_MAC_OFFSET                          REG_MSVDX_DMAC_OFFSET
44 #define REG_MSVDX_CMDS_OFFSET           REG_MSVDX_CMD_OFFSET
45 #define REG_MSVDX_VEC_MPEG2_OFFSET      REG_MSVDX_VEC_OFFSET
46 #define REG_MSVDX_VEC_MPEG4_OFFSET      REG_MSVDX_VEC_OFFSET
47 #define REG_MSVDX_VEC_H264_OFFSET       REG_MSVDX_VEC_OFFSET
48 #define REG_MSVDX_VEC_VC1_OFFSET        REG_MSVDX_VEC_OFFSET
49 #define REG_MSVDX_VEC_VP6_OFFSET        REG_MSVDX_VEC_OFFSET
50 #define REG_MSVDX_VEC_VP8_OFFSET        REG_MSVDX_VEC_OFFSET
51 #define REG_MSVDX_VEC_JPEG_OFFSET       REG_MSVDX_VEC_OFFSET
52 #define REG_MSVDX_CORE_OFFSET           REG_MSVDX_SYS_OFFSET
53 #define REG_DMAC_OFFSET                         REG_MSVDX_DMAC_OFFSET
54 
55 #define RENDEC_REGISTER_OFFSET(__group__, __reg__ ) ( (__group__##_##__reg__##_OFFSET) + ( REG_##__group__##_OFFSET ) )
56 
57 /* Not the best place for this */
58 #ifdef PLEASE_DONT_INCLUDE_REGISTER_BASE
59 
60 /* This macro is used by KM gpu sim code */
61 
62 #define REGISTER_OFFSET(__group__, __reg__ ) ( (__group__##_##__reg__##_OFFSET) )
63 
64 #else
65 
66 /* This is the macro used by UM Drivers - it included the Mtx memory offser to the msvdx redisters */
67 
68 // #define REGISTER_OFFSET(__group__, __reg__ ) ( (__group__##_##__reg__##_OFFSET) + ( REG_##__group__##_OFFSET ) )
69 #define REGISTER_OFFSET(__group__, __reg__ ) ( (__group__##_##__reg__##_OFFSET) + ( REG_##__group__##_OFFSET ) + 0x04800000 )
70 
71 #endif
72 
73 
74 #endif /*_MSVDX_OFFSETS_H_*/
75