8
8
9
9
#include <nvif/push507c.h>
10
10
11
+ #include <nvhw/class/cl907d.h>
12
+
11
13
#define CRC907D_MAX_ENTRIES 255
12
14
13
15
struct crc907d_notifier {
@@ -25,42 +27,45 @@ crc907d_set_src(struct nv50_head *head, int or,
25
27
enum nv50_crc_source_type source ,
26
28
struct nv50_crc_notifier_ctx * ctx , u32 wndw )
27
29
{
28
- struct drm_crtc * crtc = & head -> base .base ;
29
30
struct nvif_push * push = nv50_disp (head -> base .base .dev )-> core -> chan .push ;
30
31
const int i = head -> base .index ;
31
- u32 crc_args = 0xfff00000 ;
32
+ u32 crc_args = NVDEF (NV907D , HEAD_SET_CRC_CONTROL , CONTROLLING_CHANNEL , CORE ) |
33
+ NVDEF (NV907D , HEAD_SET_CRC_CONTROL , EXPECT_BUFFER_COLLAPSE , FALSE) |
34
+ NVDEF (NV907D , HEAD_SET_CRC_CONTROL , TIMESTAMP_MODE , FALSE) |
35
+ NVDEF (NV907D , HEAD_SET_CRC_CONTROL , SECONDARY_OUTPUT , NONE ) |
36
+ NVDEF (NV907D , HEAD_SET_CRC_CONTROL , CRC_DURING_SNOOZE , DISABLE );
32
37
int ret ;
33
38
34
39
switch (source ) {
35
40
case NV50_CRC_SOURCE_TYPE_SOR :
36
- crc_args |= ( 0x00000f0f + or * 16 ) << 8 ;
41
+ crc_args |= NVDEF ( NV907D , HEAD_SET_CRC_CONTROL , PRIMARY_OUTPUT , SOR ( or )) ;
37
42
break ;
38
43
case NV50_CRC_SOURCE_TYPE_PIOR :
39
- crc_args |= ( 0x000000ff + or * 256 ) << 8 ;
44
+ crc_args |= NVDEF ( NV907D , HEAD_SET_CRC_CONTROL , PRIMARY_OUTPUT , PIOR ( or )) ;
40
45
break ;
41
46
case NV50_CRC_SOURCE_TYPE_DAC :
42
- crc_args |= ( 0x00000ff0 + or ) << 8 ;
47
+ crc_args |= NVDEF ( NV907D , HEAD_SET_CRC_CONTROL , PRIMARY_OUTPUT , DAC ( or )) ;
43
48
break ;
44
49
case NV50_CRC_SOURCE_TYPE_RG :
45
- crc_args |= ( 0x00000ff8 + drm_crtc_index ( crtc )) << 8 ;
50
+ crc_args |= NVDEF ( NV907D , HEAD_SET_CRC_CONTROL , PRIMARY_OUTPUT , RG ( i )) ;
46
51
break ;
47
52
case NV50_CRC_SOURCE_TYPE_SF :
48
- crc_args |= ( 0x00000f8f + drm_crtc_index ( crtc ) * 16 ) << 8 ;
53
+ crc_args |= NVDEF ( NV907D , HEAD_SET_CRC_CONTROL , PRIMARY_OUTPUT , SF ( i )) ;
49
54
break ;
50
55
case NV50_CRC_SOURCE_NONE :
51
- crc_args |= 0x000fff00 ;
56
+ crc_args |= NVDEF ( NV907D , HEAD_SET_CRC_CONTROL , PRIMARY_OUTPUT , NONE ) ;
52
57
break ;
53
58
}
54
59
55
60
if ((ret = PUSH_WAIT (push , 4 )))
56
61
return ret ;
57
62
58
63
if (source ) {
59
- PUSH_NVSQ (push , NV907D , 0x0438 + ( i * 0x300 ), ctx -> ntfy .handle );
60
- PUSH_NVSQ (push , NV907D , 0x0430 + ( i * 0x300 ), crc_args );
64
+ PUSH_MTHD (push , NV907D , HEAD_SET_CONTEXT_DMA_CRC ( i ), ctx -> ntfy .handle );
65
+ PUSH_MTHD (push , NV907D , HEAD_SET_CRC_CONTROL ( i ), crc_args );
61
66
} else {
62
- PUSH_NVSQ (push , NV907D , 0x0430 + ( i * 0x300 ), crc_args );
63
- PUSH_NVSQ (push , NV907D , 0x0438 + ( i * 0x300 ), 0 );
67
+ PUSH_MTHD (push , NV907D , HEAD_SET_CRC_CONTROL ( i ), crc_args );
68
+ PUSH_MTHD (push , NV907D , HEAD_SET_CONTEXT_DMA_CRC ( i ), 0 );
64
69
}
65
70
66
71
return 0 ;
0 commit comments