Skip to content

Commit 7bcf89e

Browse files
Ben Skeggsairlied
authored andcommitted
drm/nouveau/disp: split sor hda funcs out to their own struct
Signed-off-by: Ben Skeggs <[email protected]> Reviewed-by: Lyude Paul <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
1 parent 9a4514f commit 7bcf89e

File tree

12 files changed

+44
-63
lines changed

12 files changed

+44
-63
lines changed

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,7 @@ ga102_sor = {
110110
.scdc = gm200_sor_hdmi_scdc,
111111
},
112112
.dp = &ga102_sor_dp,
113-
.hda = {
114-
.hpd = gf119_sor_hda_hpd,
115-
.eld = gf119_sor_hda_eld,
116-
.device_entry = gv100_sor_hda_device_entry,
117-
},
113+
.hda = &gv100_sor_hda,
118114
};
119115

120116
static int

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

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
#include <nvif/class.h>
3535

36-
void
36+
static void
3737
gf119_sor_hda_device_entry(struct nvkm_ior *ior, int head)
3838
{
3939
struct nvkm_device *device = ior->disp->engine.subdev.device;
@@ -65,7 +65,7 @@ gf119_sor_hda_hpd(struct nvkm_ior *ior, int head, bool present)
6565
u32 mask = 0x80000001;
6666

6767
if (present) {
68-
ior->func->hda.device_entry(ior, head);
68+
ior->func->hda->device_entry(ior, head);
6969
data |= 0x00000001;
7070
} else {
7171
mask |= 0x00000002;
@@ -74,6 +74,13 @@ gf119_sor_hda_hpd(struct nvkm_ior *ior, int head, bool present)
7474
nvkm_mask(device, 0x10ec10 + soff, mask, data);
7575
}
7676

77+
const struct nvkm_ior_func_hda
78+
gf119_sor_hda = {
79+
.hpd = gf119_sor_hda_hpd,
80+
.eld = gf119_sor_hda_eld,
81+
.device_entry = gf119_sor_hda_device_entry,
82+
};
83+
7784
void
7885
gf119_sor_dp_watermark(struct nvkm_ior *sor, int head, u8 watermark)
7986
{
@@ -302,11 +309,7 @@ gf119_sor = {
302309
.ctrl = gf119_sor_hdmi_ctrl,
303310
},
304311
.dp = &gf119_sor_dp,
305-
.hda = {
306-
.hpd = gf119_sor_hda_hpd,
307-
.eld = gf119_sor_hda_eld,
308-
.device_entry = gf119_sor_hda_device_entry,
309-
},
312+
.hda = &gf119_sor_hda,
310313
};
311314

312315
static int

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,7 @@ gk104_sor = {
9696
.ctrl = gk104_sor_hdmi_ctrl,
9797
},
9898
.dp = &gf119_sor_dp,
99-
.hda = {
100-
.hpd = gf119_sor_hda_hpd,
101-
.eld = gf119_sor_hda_eld,
102-
.device_entry = gf119_sor_hda_device_entry,
103-
},
99+
.hda = &gf119_sor_hda,
104100
};
105101

106102
int

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,7 @@ gm107_sor = {
7474
.ctrl = gk104_sor_hdmi_ctrl,
7575
},
7676
.dp = &gm107_sor_dp,
77-
.hda = {
78-
.hpd = gf119_sor_hda_hpd,
79-
.eld = gf119_sor_hda_eld,
80-
.device_entry = gf119_sor_hda_device_entry,
81-
},
77+
.hda = &gf119_sor_hda,
8278
};
8379

8480
static int

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,7 @@ gm200_sor = {
136136
.scdc = gm200_sor_hdmi_scdc,
137137
},
138138
.dp = &gm200_sor_dp,
139-
.hda = {
140-
.hpd = gf119_sor_hda_hpd,
141-
.eld = gf119_sor_hda_eld,
142-
.device_entry = gf119_sor_hda_device_entry,
143-
},
139+
.hda = &gf119_sor_hda,
144140
};
145141

146142
static int

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,7 @@ gp100_sor = {
4242
.scdc = gm200_sor_hdmi_scdc,
4343
},
4444
.dp = &gm200_sor_dp,
45-
.hda = {
46-
.hpd = gf119_sor_hda_hpd,
47-
.eld = gf119_sor_hda_eld,
48-
.device_entry = gf119_sor_hda_device_entry,
49-
},
45+
.hda = &gf119_sor_hda,
5046
};
5147

5248
int

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
#include <nvif/class.h>
3333

34-
void
34+
static void
3535
gt215_sor_hda_eld(struct nvkm_ior *ior, int head, u8 *data, u8 size)
3636
{
3737
struct nvkm_device *device = ior->disp->engine.subdev.device;
@@ -45,7 +45,7 @@ gt215_sor_hda_eld(struct nvkm_ior *ior, int head, u8 *data, u8 size)
4545
nvkm_mask(device, 0x61c448 + soff, 0x80000002, 0x80000002);
4646
}
4747

48-
void
48+
static void
4949
gt215_sor_hda_hpd(struct nvkm_ior *ior, int head, bool present)
5050
{
5151
struct nvkm_device *device = ior->disp->engine.subdev.device;
@@ -58,6 +58,12 @@ gt215_sor_hda_hpd(struct nvkm_ior *ior, int head, bool present)
5858
nvkm_mask(device, 0x61c448 + ior->id * 0x800, mask, data);
5959
}
6060

61+
const struct nvkm_ior_func_hda
62+
gt215_sor_hda = {
63+
.hpd = gt215_sor_hda_hpd,
64+
.eld = gt215_sor_hda_eld,
65+
};
66+
6167
void
6268
gt215_sor_dp_audio(struct nvkm_ior *sor, int head, bool enable)
6369
{
@@ -162,10 +168,7 @@ gt215_sor = {
162168
.ctrl = gt215_sor_hdmi_ctrl,
163169
},
164170
.dp = &gt215_sor_dp,
165-
.hda = {
166-
.hpd = gt215_sor_hda_hpd,
167-
.eld = gt215_sor_hda_eld,
168-
},
171+
.hda = &gt215_sor_hda,
169172
};
170173

171174
static int

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
#include <nvif/clc37e.h>
3737
#include <nvif/unpack.h>
3838

39-
void
39+
static void
4040
gv100_sor_hda_device_entry(struct nvkm_ior *ior, int head)
4141
{
4242
struct nvkm_device *device = ior->disp->engine.subdev.device;
@@ -45,6 +45,13 @@ gv100_sor_hda_device_entry(struct nvkm_ior *ior, int head)
4545
nvkm_mask(device, 0x616528 + hoff, 0x00000070, head << 4);
4646
}
4747

48+
const struct nvkm_ior_func_hda
49+
gv100_sor_hda = {
50+
.hpd = gf119_sor_hda_hpd,
51+
.eld = gf119_sor_hda_eld,
52+
.device_entry = gv100_sor_hda_device_entry,
53+
};
54+
4855
void
4956
gv100_sor_dp_watermark(struct nvkm_ior *sor, int head, u8 watermark)
5057
{
@@ -190,11 +197,7 @@ gv100_sor = {
190197
.scdc = gm200_sor_hdmi_scdc,
191198
},
192199
.dp = &gv100_sor_dp,
193-
.hda = {
194-
.hpd = gf119_sor_hda_hpd,
195-
.eld = gf119_sor_hda_eld,
196-
.device_entry = gv100_sor_hda_device_entry,
197-
},
200+
.hda = &gv100_sor_hda,
198201
};
199202

200203
static int

drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,11 @@ struct nvkm_ior_func {
8686
void (*watermark)(struct nvkm_ior *, int head, u8 watermark);
8787
} *dp;
8888

89-
struct {
89+
const struct nvkm_ior_func_hda {
9090
void (*hpd)(struct nvkm_ior *, int head, bool present);
9191
void (*eld)(struct nvkm_ior *, int head, u8 *data, u8 size);
9292
void (*device_entry)(struct nvkm_ior *, int head);
93-
} hda;
93+
} *hda;
9494
};
9595

9696
int nvkm_ior_new_(const struct nvkm_ior_func *func, struct nvkm_disp *,
@@ -139,8 +139,7 @@ void g94_sor_dp_watermark(struct nvkm_ior *, int, u8);
139139

140140
void gt215_sor_hdmi_ctrl(struct nvkm_ior *, int, bool, u8, u8, u8 *, u8 , u8 *, u8);
141141
void gt215_sor_dp_audio(struct nvkm_ior *, int, bool);
142-
void gt215_sor_hda_hpd(struct nvkm_ior *, int, bool);
143-
void gt215_sor_hda_eld(struct nvkm_ior *, int, u8 *, u8);
142+
extern const struct nvkm_ior_func_hda gt215_sor_hda;
144143

145144
int gf119_sor_cnt(struct nvkm_disp *, unsigned long *);
146145
void gf119_sor_state(struct nvkm_ior *, struct nvkm_ior_state *);
@@ -152,9 +151,9 @@ void gf119_sor_dp_vcpi(struct nvkm_ior *, int, u8, u8, u16, u16);
152151
void gf119_sor_dp_audio(struct nvkm_ior *, int, bool);
153152
void gf119_sor_dp_audio_sym(struct nvkm_ior *, int, u16, u32);
154153
void gf119_sor_dp_watermark(struct nvkm_ior *, int, u8);
154+
extern const struct nvkm_ior_func_hda gf119_sor_hda;
155155
void gf119_sor_hda_hpd(struct nvkm_ior *, int, bool);
156156
void gf119_sor_hda_eld(struct nvkm_ior *, int, u8 *, u8);
157-
void gf119_sor_hda_device_entry(struct nvkm_ior *, int);
158157

159158
int gk104_sor_new(struct nvkm_disp *, int);
160159
void gk104_sor_hdmi_ctrl(struct nvkm_ior *, int, bool, u8, u8, u8 *, u8 , u8 *, u8);
@@ -175,7 +174,7 @@ void gv100_sor_hdmi_ctrl(struct nvkm_ior *, int, bool, u8, u8, u8 *, u8 , u8 *,
175174
void gv100_sor_dp_audio(struct nvkm_ior *, int, bool);
176175
void gv100_sor_dp_audio_sym(struct nvkm_ior *, int, u16, u32);
177176
void gv100_sor_dp_watermark(struct nvkm_ior *, int, u8);
178-
void gv100_sor_hda_device_entry(struct nvkm_ior *, int);
177+
extern const struct nvkm_ior_func_hda gv100_sor_hda;
179178

180179
void tu102_sor_dp_vcpi(struct nvkm_ior *, int, u8, u8, u16, u16);
181180

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,7 @@ mcp89_sor = {
4848
.ctrl = gt215_sor_hdmi_ctrl,
4949
},
5050
.dp = &mcp89_sor_dp,
51-
.hda = {
52-
.hpd = gt215_sor_hda_hpd,
53-
.eld = gt215_sor_hda_eld,
54-
},
51+
.hda = &gt215_sor_hda,
5552
};
5653

5754
static int

0 commit comments

Comments
 (0)