Skip to content

Commit 2aa934c

Browse files
author
Ben Skeggs
committed
drm/nouveau/kms/nv50-: use NVIDIA's headers for core head_base()
Signed-off-by: Ben Skeggs <[email protected]> Reviewed-by: Lyude Paul <[email protected]>
1 parent 916722f commit 2aa934c

File tree

3 files changed

+19
-18
lines changed

3 files changed

+19
-18
lines changed

drivers/gpu/drm/nouveau/dispnv50/head507d.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,21 +95,21 @@ head507d_base(struct nv50_head *head, struct nv50_head_atom *asyh)
9595

9696
if (asyh->base.cpp) {
9797
switch (asyh->base.cpp) {
98-
case 8: bounds |= 0x00000500; break;
99-
case 4: bounds |= 0x00000300; break;
100-
case 2: bounds |= 0x00000100; break;
101-
case 1: bounds |= 0x00000000; break;
98+
case 8: bounds |= NVDEF(NV507D, HEAD_SET_BASE_CHANNEL_USAGE_BOUNDS, PIXEL_DEPTH, BPP_64); break;
99+
case 4: bounds |= NVDEF(NV507D, HEAD_SET_BASE_CHANNEL_USAGE_BOUNDS, PIXEL_DEPTH, BPP_32); break;
100+
case 2: bounds |= NVDEF(NV507D, HEAD_SET_BASE_CHANNEL_USAGE_BOUNDS, PIXEL_DEPTH, BPP_16); break;
101+
case 1: bounds |= NVDEF(NV507D, HEAD_SET_BASE_CHANNEL_USAGE_BOUNDS, PIXEL_DEPTH, BPP_8); break;
102102
default:
103103
WARN_ON(1);
104104
break;
105105
}
106-
bounds |= 0x00000001;
106+
bounds |= NVDEF(NV507D, HEAD_SET_BASE_CHANNEL_USAGE_BOUNDS, USABLE, TRUE);
107107
}
108108

109109
if ((ret = PUSH_WAIT(push, 2)))
110110
return ret;
111111

112-
PUSH_NVSQ(push, NV507D, 0x0900 + (i * 0x400), bounds);
112+
PUSH_MTHD(push, NV507D, HEAD_SET_BASE_CHANNEL_USAGE_BOUNDS(i), bounds);
113113
return 0;
114114
}
115115

drivers/gpu/drm/nouveau/dispnv50/head907d.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,21 +123,21 @@ head907d_base(struct nv50_head *head, struct nv50_head_atom *asyh)
123123

124124
if (asyh->base.cpp) {
125125
switch (asyh->base.cpp) {
126-
case 8: bounds |= 0x00000500; break;
127-
case 4: bounds |= 0x00000300; break;
128-
case 2: bounds |= 0x00000100; break;
129-
case 1: bounds |= 0x00000000; break;
126+
case 8: bounds |= NVDEF(NV907D, HEAD_SET_BASE_CHANNEL_USAGE_BOUNDS, PIXEL_DEPTH, BPP_64); break;
127+
case 4: bounds |= NVDEF(NV907D, HEAD_SET_BASE_CHANNEL_USAGE_BOUNDS, PIXEL_DEPTH, BPP_32); break;
128+
case 2: bounds |= NVDEF(NV907D, HEAD_SET_BASE_CHANNEL_USAGE_BOUNDS, PIXEL_DEPTH, BPP_16); break;
129+
case 1: bounds |= NVDEF(NV907D, HEAD_SET_BASE_CHANNEL_USAGE_BOUNDS, PIXEL_DEPTH, BPP_8); break;
130130
default:
131131
WARN_ON(1);
132132
break;
133133
}
134-
bounds |= 0x00000001;
134+
bounds |= NVDEF(NV907D, HEAD_SET_BASE_CHANNEL_USAGE_BOUNDS, USABLE, TRUE);
135135
}
136136

137137
if ((ret = PUSH_WAIT(push, 2)))
138138
return ret;
139139

140-
PUSH_NVSQ(push, NV907D, 0x04d0 + (i * 0x300), bounds);
140+
PUSH_MTHD(push, NV907D, HEAD_SET_BASE_CHANNEL_USAGE_BOUNDS(i), bounds);
141141
return 0;
142142
}
143143

drivers/gpu/drm/nouveau/dispnv50/head917d.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,21 +52,22 @@ head917d_base(struct nv50_head *head, struct nv50_head_atom *asyh)
5252

5353
if (asyh->base.cpp) {
5454
switch (asyh->base.cpp) {
55-
case 8: bounds |= 0x00000500; break;
56-
case 4: bounds |= 0x00000300; break;
57-
case 2: bounds |= 0x00000100; break;
58-
case 1: bounds |= 0x00000000; break;
55+
case 8: bounds |= NVDEF(NV917D, HEAD_SET_BASE_CHANNEL_USAGE_BOUNDS, PIXEL_DEPTH, BPP_64); break;
56+
case 4: bounds |= NVDEF(NV917D, HEAD_SET_BASE_CHANNEL_USAGE_BOUNDS, PIXEL_DEPTH, BPP_32); break;
57+
case 2: bounds |= NVDEF(NV917D, HEAD_SET_BASE_CHANNEL_USAGE_BOUNDS, PIXEL_DEPTH, BPP_16); break;
58+
case 1: bounds |= NVDEF(NV917D, HEAD_SET_BASE_CHANNEL_USAGE_BOUNDS, PIXEL_DEPTH, BPP_8); break;
5959
default:
6060
WARN_ON(1);
6161
break;
6262
}
63-
bounds |= 0x00020001;
63+
bounds |= NVDEF(NV917D, HEAD_SET_BASE_CHANNEL_USAGE_BOUNDS, USABLE, TRUE);
64+
bounds |= NVDEF(NV917D, HEAD_SET_BASE_CHANNEL_USAGE_BOUNDS, BASE_LUT, USAGE_1025);
6465
}
6566

6667
if ((ret = PUSH_WAIT(push, 2)))
6768
return ret;
6869

69-
PUSH_NVSQ(push, NV917D, 0x04d0 + (i * 0x300), bounds);
70+
PUSH_MTHD(push, NV917D, HEAD_SET_BASE_CHANNEL_USAGE_BOUNDS(i), bounds);
7071
return 0;
7172
}
7273

0 commit comments

Comments
 (0)