f73cf3efbc35dcfe5c0375a51b020461d9129f49
[cascardo/linux.git] / drivers / gpu / drm / nouveau / core / engine / graph / fuc / macros.fuc
1 /*
2  * Copyright 2013 Red Hat Inc.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and associated documentation files (the "Software"),
6  * to deal in the Software without restriction, including without limitation
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8  * and/or sell copies of the Software, and to permit persons to whom the
9  * Software is furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20  * OTHER DEALINGS IN THE SOFTWARE.
21  *
22  * Authors: Ben Skeggs <bskeggs@redhat.com>
23  */
24
25 #include "os.h"
26
27 #define GF100 0xc0
28 #define GF117 0xd7
29 #define GK100 0xe0
30
31 #define mmctx_data(r,c) .b32 (((c - 1) << 26) | r)
32 #define queue_init      .skip 72 // (2 * 4) + ((8 * 4) * 2)
33
34 #define T_WAIT    0
35 #define T_MMCTX   1
36 #define T_STRWAIT 2
37 #define T_STRINIT 3
38 #define T_AUTO    4
39 #define T_CHAN    5
40 #define T_LOAD    6
41 #define T_SAVE    7
42 #define T_LCHAN   8
43 #define T_LCTXH   9
44
45 #define trace_set(bit) /*
46 */      mov $r8 0x83c /*
47 */      shl b32 $r8 6 /*
48 */      clear b32 $r9 /*
49 */      bset $r9 bit /*
50 */      iowr I[$r8 + 0x000] $r9
51
52 #define trace_clr(bit) /*
53 */      mov $r8 0x85c /*
54 */      shl b32 $r8 6 /*
55 */      clear b32 $r9 /*
56 */      bset $r9 bit /*
57 */      iowr I[$r8 + 0x000] $r9