Skip to content

Commit 29ace86

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

File tree

4 files changed

+25
-8
lines changed

4 files changed

+25
-8
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,12 @@ head507d_procamp(struct nv50_head *head, struct nv50_head_atom *asyh)
3636
if ((ret = PUSH_WAIT(push, 2)))
3737
return ret;
3838

39-
PUSH_NVSQ(push, NV507D, 0x08a8 + (i * 0x400), asyh->procamp.sat.sin << 20 |
40-
asyh->procamp.sat.cos << 8);
39+
PUSH_MTHD(push, NV507D, HEAD_SET_PROCAMP(i),
40+
NVDEF(NV507D, HEAD_SET_PROCAMP, COLOR_SPACE, RGB) |
41+
NVDEF(NV507D, HEAD_SET_PROCAMP, CHROMA_LPF, AUTO) |
42+
NVVAL(NV507D, HEAD_SET_PROCAMP, SAT_COS, asyh->procamp.sat.cos) |
43+
NVVAL(NV507D, HEAD_SET_PROCAMP, SAT_SINE, asyh->procamp.sat.sin) |
44+
NVDEF(NV507D, HEAD_SET_PROCAMP, TRANSITION, HARD));
4145
return 0;
4246
}
4347

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,13 @@ head907d_procamp(struct nv50_head *head, struct nv50_head_atom *asyh)
6363
if ((ret = PUSH_WAIT(push, 2)))
6464
return ret;
6565

66-
PUSH_NVSQ(push, NV907D, 0x0498 + (i * 0x300), asyh->procamp.sat.sin << 20 |
67-
asyh->procamp.sat.cos << 8);
66+
PUSH_MTHD(push, NV907D, HEAD_SET_PROCAMP(i),
67+
NVDEF(NV907D, HEAD_SET_PROCAMP, COLOR_SPACE, RGB) |
68+
NVDEF(NV907D, HEAD_SET_PROCAMP, CHROMA_LPF, AUTO) |
69+
NVVAL(NV907D, HEAD_SET_PROCAMP, SAT_COS, asyh->procamp.sat.cos) |
70+
NVVAL(NV907D, HEAD_SET_PROCAMP, SAT_SINE, asyh->procamp.sat.sin) |
71+
NVDEF(NV907D, HEAD_SET_PROCAMP, DYNAMIC_RANGE, VESA) |
72+
NVDEF(NV907D, HEAD_SET_PROCAMP, RANGE_COMPRESSION, DISABLE));
6873
return 0;
6974
}
7075

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,14 @@ headc37d_procamp(struct nv50_head *head, struct nv50_head_atom *asyh)
6969
if ((ret = PUSH_WAIT(push, 2)))
7070
return ret;
7171

72-
PUSH_NVSQ(push, NVC37D, 0x2000 + (i * 0x400), 0x80000000 |
73-
asyh->procamp.sat.sin << 16 |
74-
asyh->procamp.sat.cos << 4);
72+
PUSH_MTHD(push, NVC37D, HEAD_SET_PROCAMP(i),
73+
NVDEF(NVC37D, HEAD_SET_PROCAMP, COLOR_SPACE, RGB) |
74+
NVDEF(NVC37D, HEAD_SET_PROCAMP, CHROMA_LPF, DISABLE) |
75+
NVVAL(NVC37D, HEAD_SET_PROCAMP, SAT_COS, asyh->procamp.sat.cos) |
76+
NVVAL(NVC37D, HEAD_SET_PROCAMP, SAT_SINE, asyh->procamp.sat.sin) |
77+
NVDEF(NVC37D, HEAD_SET_PROCAMP, DYNAMIC_RANGE, VESA) |
78+
NVDEF(NVC37D, HEAD_SET_PROCAMP, RANGE_COMPRESSION, DISABLE) |
79+
NVDEF(NVC37D, HEAD_SET_PROCAMP, BLACK_LEVEL, GRAPHICS));
7580
return 0;
7681
}
7782

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ headc57d_procamp(struct nv50_head *head, struct nv50_head_atom *asyh)
7171
return ret;
7272

7373
//TODO:
74-
PUSH_NVSQ(push, NVC57D, 0x2000 + (i * 0x400), 0x00000000);
74+
PUSH_MTHD(push, NVC57D, HEAD_SET_PROCAMP(i),
75+
NVDEF(NVC57D, HEAD_SET_PROCAMP, COLOR_SPACE, RGB) |
76+
NVDEF(NVC57D, HEAD_SET_PROCAMP, CHROMA_LPF, DISABLE) |
77+
NVDEF(NVC57D, HEAD_SET_PROCAMP, DYNAMIC_RANGE, VESA));
7578
return 0;
7679
}
7780

0 commit comments

Comments
 (0)