xref: /openbsd/sys/dev/pci/drm/radeon/ni_reg.h (revision a6445c1d)
1 /*	$OpenBSD: ni_reg.h,v 1.1 2013/08/12 04:11:53 jsg Exp $	*/
2 /*
3  * Copyright 2010 Advanced Micro Devices, Inc.
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included in
13  * all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
18  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
19  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21  * OTHER DEALINGS IN THE SOFTWARE.
22  *
23  * Authors: Alex Deucher
24  */
25 #ifndef __NI_REG_H__
26 #define __NI_REG_H__
27 
28 /* northern islands - DCE5 */
29 
30 #define NI_INPUT_GAMMA_CONTROL                         0x6840
31 #       define NI_GRPH_INPUT_GAMMA_MODE(x)             (((x) & 0x3) << 0)
32 #       define NI_INPUT_GAMMA_USE_LUT                  0
33 #       define NI_INPUT_GAMMA_BYPASS                   1
34 #       define NI_INPUT_GAMMA_SRGB_24                  2
35 #       define NI_INPUT_GAMMA_XVYCC_222                3
36 #       define NI_OVL_INPUT_GAMMA_MODE(x)              (((x) & 0x3) << 4)
37 
38 #define NI_PRESCALE_GRPH_CONTROL                       0x68b4
39 #       define NI_GRPH_PRESCALE_BYPASS                 (1 << 4)
40 
41 #define NI_PRESCALE_OVL_CONTROL                        0x68c4
42 #       define NI_OVL_PRESCALE_BYPASS                  (1 << 4)
43 
44 #define NI_INPUT_CSC_CONTROL                           0x68d4
45 #       define NI_INPUT_CSC_GRPH_MODE(x)               (((x) & 0x3) << 0)
46 #       define NI_INPUT_CSC_BYPASS                     0
47 #       define NI_INPUT_CSC_PROG_COEFF                 1
48 #       define NI_INPUT_CSC_PROG_SHARED_MATRIXA        2
49 #       define NI_INPUT_CSC_OVL_MODE(x)                (((x) & 0x3) << 4)
50 
51 #define NI_OUTPUT_CSC_CONTROL                          0x68f0
52 #       define NI_OUTPUT_CSC_GRPH_MODE(x)              (((x) & 0x7) << 0)
53 #       define NI_OUTPUT_CSC_BYPASS                    0
54 #       define NI_OUTPUT_CSC_TV_RGB                    1
55 #       define NI_OUTPUT_CSC_YCBCR_601                 2
56 #       define NI_OUTPUT_CSC_YCBCR_709                 3
57 #       define NI_OUTPUT_CSC_PROG_COEFF                4
58 #       define NI_OUTPUT_CSC_PROG_SHARED_MATRIXB       5
59 #       define NI_OUTPUT_CSC_OVL_MODE(x)               (((x) & 0x7) << 4)
60 
61 #define NI_DEGAMMA_CONTROL                             0x6960
62 #       define NI_GRPH_DEGAMMA_MODE(x)                 (((x) & 0x3) << 0)
63 #       define NI_DEGAMMA_BYPASS                       0
64 #       define NI_DEGAMMA_SRGB_24                      1
65 #       define NI_DEGAMMA_XVYCC_222                    2
66 #       define NI_OVL_DEGAMMA_MODE(x)                  (((x) & 0x3) << 4)
67 #       define NI_ICON_DEGAMMA_MODE(x)                 (((x) & 0x3) << 8)
68 #       define NI_CURSOR_DEGAMMA_MODE(x)               (((x) & 0x3) << 12)
69 
70 #define NI_GAMUT_REMAP_CONTROL                         0x6964
71 #       define NI_GRPH_GAMUT_REMAP_MODE(x)             (((x) & 0x3) << 0)
72 #       define NI_GAMUT_REMAP_BYPASS                   0
73 #       define NI_GAMUT_REMAP_PROG_COEFF               1
74 #       define NI_GAMUT_REMAP_PROG_SHARED_MATRIXA      2
75 #       define NI_GAMUT_REMAP_PROG_SHARED_MATRIXB      3
76 #       define NI_OVL_GAMUT_REMAP_MODE(x)              (((x) & 0x3) << 4)
77 
78 #define NI_REGAMMA_CONTROL                             0x6a80
79 #       define NI_GRPH_REGAMMA_MODE(x)                 (((x) & 0x7) << 0)
80 #       define NI_REGAMMA_BYPASS                       0
81 #       define NI_REGAMMA_SRGB_24                      1
82 #       define NI_REGAMMA_XVYCC_222                    2
83 #       define NI_REGAMMA_PROG_A                       3
84 #       define NI_REGAMMA_PROG_B                       4
85 #       define NI_OVL_REGAMMA_MODE(x)                  (((x) & 0x7) << 4)
86 
87 #endif
88