Skip to content
This repository was archived by the owner on Oct 3, 2024. It is now read-only.

Commit af85389

Browse files
author
Ben Skeggs
committed
drm/nouveau/disp: shuffle functions around
Upcoming changes to split OR from output path drastically change the placement of various operations. In order to make the real changes clearer, do the moving around part ahead of time. Signed-off-by: Ben Skeggs <[email protected]>
1 parent 639d72e commit af85389

33 files changed

+1183
-1243
lines changed

drivers/gpu/drm/nouveau/nvkm/engine/disp/Kbuild

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,29 @@ nvkm-y += nvkm/engine/disp/gm107.o
1212
nvkm-y += nvkm/engine/disp/gm200.o
1313
nvkm-y += nvkm/engine/disp/gp100.o
1414
nvkm-y += nvkm/engine/disp/gp102.o
15+
nvkm-y += nvkm/engine/disp/vga.o
1516

16-
nvkm-y += nvkm/engine/disp/outp.o
17-
nvkm-y += nvkm/engine/disp/outpdp.o
1817
nvkm-y += nvkm/engine/disp/dacnv50.o
1918
nvkm-y += nvkm/engine/disp/piornv50.o
2019
nvkm-y += nvkm/engine/disp/sornv50.o
2120
nvkm-y += nvkm/engine/disp/sorg94.o
2221
nvkm-y += nvkm/engine/disp/sorgf119.o
2322
nvkm-y += nvkm/engine/disp/sorgm107.o
2423
nvkm-y += nvkm/engine/disp/sorgm200.o
25-
nvkm-y += nvkm/engine/disp/dport.o
2624

27-
nvkm-y += nvkm/engine/disp/conn.o
25+
nvkm-y += nvkm/engine/disp/outp.o
26+
nvkm-y += nvkm/engine/disp/dp.o
2827

2928
nvkm-y += nvkm/engine/disp/hdagt215.o
3029
nvkm-y += nvkm/engine/disp/hdagf119.o
3130

32-
nvkm-y += nvkm/engine/disp/hdmi_infoframe.o
31+
nvkm-y += nvkm/engine/disp/hdmi.o
3332
nvkm-y += nvkm/engine/disp/hdmig84.o
3433
nvkm-y += nvkm/engine/disp/hdmigt215.o
3534
nvkm-y += nvkm/engine/disp/hdmigf119.o
3635
nvkm-y += nvkm/engine/disp/hdmigk104.o
3736

38-
nvkm-y += nvkm/engine/disp/vga.o
37+
nvkm-y += nvkm/engine/disp/conn.o
3938

4039
nvkm-y += nvkm/engine/disp/rootnv04.o
4140
nvkm-y += nvkm/engine/disp/rootnv50.o

drivers/gpu/drm/nouveau/nvkm/engine/disp/dacnv50.c

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -30,40 +30,16 @@
3030
#include <nvif/cl5070.h>
3131
#include <nvif/unpack.h>
3232

33+
static const struct nvkm_output_func
34+
nv50_dac_output_func = {
35+
};
36+
3337
int
34-
nv50_dac_power(NV50_DISP_MTHD_V1)
38+
nv50_dac_output_new(struct nvkm_disp *disp, int index,
39+
struct dcb_output *dcbE, struct nvkm_output **poutp)
3540
{
36-
struct nvkm_device *device = disp->base.engine.subdev.device;
37-
const u32 doff = outp->or * 0x800;
38-
union {
39-
struct nv50_disp_dac_pwr_v0 v0;
40-
} *args = data;
41-
u32 stat;
42-
int ret = -ENOSYS;
43-
44-
nvif_ioctl(object, "disp dac pwr size %d\n", size);
45-
if (!(ret = nvif_unpack(ret, &data, &size, args->v0, 0, 0, false))) {
46-
nvif_ioctl(object, "disp dac pwr vers %d state %d data %d "
47-
"vsync %d hsync %d\n",
48-
args->v0.version, args->v0.state, args->v0.data,
49-
args->v0.vsync, args->v0.hsync);
50-
stat = 0x00000040 * !args->v0.state;
51-
stat |= 0x00000010 * !args->v0.data;
52-
stat |= 0x00000004 * !args->v0.vsync;
53-
stat |= 0x00000001 * !args->v0.hsync;
54-
} else
55-
return ret;
56-
57-
nvkm_msec(device, 2000,
58-
if (!(nvkm_rd32(device, 0x61a004 + doff) & 0x80000000))
59-
break;
60-
);
61-
nvkm_mask(device, 0x61a004 + doff, 0xc000007f, 0x80000000 | stat);
62-
nvkm_msec(device, 2000,
63-
if (!(nvkm_rd32(device, 0x61a004 + doff) & 0x80000000))
64-
break;
65-
);
66-
return 0;
41+
return nvkm_output_new_(&nv50_dac_output_func, disp,
42+
index, dcbE, poutp);
6743
}
6844

6945
int
@@ -113,14 +89,38 @@ nv50_dac_sense(NV50_DISP_MTHD_V1)
11389
return 0;
11490
}
11591

116-
static const struct nvkm_output_func
117-
nv50_dac_output_func = {
118-
};
119-
12092
int
121-
nv50_dac_output_new(struct nvkm_disp *disp, int index,
122-
struct dcb_output *dcbE, struct nvkm_output **poutp)
93+
nv50_dac_power(NV50_DISP_MTHD_V1)
12394
{
124-
return nvkm_output_new_(&nv50_dac_output_func, disp,
125-
index, dcbE, poutp);
95+
struct nvkm_device *device = disp->base.engine.subdev.device;
96+
const u32 doff = outp->or * 0x800;
97+
union {
98+
struct nv50_disp_dac_pwr_v0 v0;
99+
} *args = data;
100+
u32 stat;
101+
int ret = -ENOSYS;
102+
103+
nvif_ioctl(object, "disp dac pwr size %d\n", size);
104+
if (!(ret = nvif_unpack(ret, &data, &size, args->v0, 0, 0, false))) {
105+
nvif_ioctl(object, "disp dac pwr vers %d state %d data %d "
106+
"vsync %d hsync %d\n",
107+
args->v0.version, args->v0.state, args->v0.data,
108+
args->v0.vsync, args->v0.hsync);
109+
stat = 0x00000040 * !args->v0.state;
110+
stat |= 0x00000010 * !args->v0.data;
111+
stat |= 0x00000004 * !args->v0.vsync;
112+
stat |= 0x00000001 * !args->v0.hsync;
113+
} else
114+
return ret;
115+
116+
nvkm_msec(device, 2000,
117+
if (!(nvkm_rd32(device, 0x61a004 + doff) & 0x80000000))
118+
break;
119+
);
120+
nvkm_mask(device, 0x61a004 + doff, 0xc000007f, 0x80000000 | stat);
121+
nvkm_msec(device, 2000,
122+
if (!(nvkm_rd32(device, 0x61a004 + doff) & 0x80000000))
123+
break;
124+
);
125+
return 0;
126126
}

0 commit comments

Comments
 (0)