Commit 79c453af authored by Ben Skeggs's avatar Ben Skeggs Committed by Dave Airlie
Browse files

drm/nouveau/disp: replace hda func pointer check with flag



Simpler, and less error-prone than a separate set of function pointers.

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 1c6aab75
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -109,7 +109,7 @@ g84_sor = {
int
g84_sor_new(struct nvkm_disp *disp, int id)
{
	return nvkm_ior_new_(&g84_sor, disp, SOR, id);
	return nvkm_ior_new_(&g84_sor, disp, SOR, id, false);
}

static const struct nvkm_disp_mthd_list
+1 −1
Original line number Diff line number Diff line
@@ -298,7 +298,7 @@ g94_sor = {
static int
g94_sor_new(struct nvkm_disp *disp, int id)
{
	return nvkm_ior_new_(&g94_sor, disp, SOR, id);
	return nvkm_ior_new_(&g94_sor, disp, SOR, id, false);
}

int
+3 −30
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@ ga102_sor_clock(struct nvkm_ior *sor)
}

static const struct nvkm_ior_func
ga102_sor_hda = {
ga102_sor = {
	.route = {
		.get = gm200_sor_route_get,
		.set = gm200_sor_route_set,
@@ -114,40 +114,13 @@ ga102_sor_hda = {
	},
};

static const struct nvkm_ior_func
ga102_sor = {
	.route = {
		.get = gm200_sor_route_get,
		.set = gm200_sor_route_set,
	},
	.state = gv100_sor_state,
	.power = nv50_sor_power,
	.clock = ga102_sor_clock,
	.hdmi = {
		.ctrl = gv100_sor_hdmi_ctrl,
		.scdc = gm200_sor_hdmi_scdc,
	},
	.dp = {
		.lanes = { 0, 1, 2, 3 },
		.links = ga102_sor_dp_links,
		.power = g94_sor_dp_power,
		.pattern = gm107_sor_dp_pattern,
		.drive = gm200_sor_dp_drive,
		.vcpi = tu102_sor_dp_vcpi,
		.audio = gv100_sor_dp_audio,
		.audio_sym = gv100_sor_dp_audio_sym,
		.watermark = gv100_sor_dp_watermark,
	},
};

static int
ga102_sor_new(struct nvkm_disp *disp, int id)
{
	struct nvkm_device *device = disp->engine.subdev.device;
	u32 hda = nvkm_rd32(device, 0x08a15c);
	if (hda & BIT(id))
		return nvkm_ior_new_(&ga102_sor_hda, disp, SOR, id);
	return nvkm_ior_new_(&ga102_sor, disp, SOR, id);

	return nvkm_ior_new_(&ga102_sor, disp, SOR, id, hda & BIT(id));
}

static const struct nvkm_disp_func
+2 −2
Original line number Diff line number Diff line
@@ -309,7 +309,7 @@ gf119_sor = {
static int
gf119_sor_new(struct nvkm_disp *disp, int id)
{
	return nvkm_ior_new_(&gf119_sor, disp, SOR, id);
	return nvkm_ior_new_(&gf119_sor, disp, SOR, id, true);
}

int
@@ -357,7 +357,7 @@ gf119_dac = {
int
gf119_dac_new(struct nvkm_disp *disp, int id)
{
	return nvkm_ior_new_(&gf119_dac, disp, DAC, id);
	return nvkm_ior_new_(&gf119_dac, disp, DAC, id, false);
}

int
+1 −1
Original line number Diff line number Diff line
@@ -116,7 +116,7 @@ gk104_sor = {
int
gk104_sor_new(struct nvkm_disp *disp, int id)
{
	return nvkm_ior_new_(&gk104_sor, disp, SOR, id);
	return nvkm_ior_new_(&gk104_sor, disp, SOR, id, true);
}

static const struct nvkm_disp_mthd_list
Loading