Commit bf5d1a6b authored by Ben Skeggs's avatar Ben Skeggs
Browse files

drm/nouveau/disp/nv50-: fetch mask of available dacs during oneinit



Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent f7b2ece3
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -58,8 +58,13 @@ gf119_dac = {
int
gf119_dac_new(struct nvkm_disp *disp, int id)
{
	struct nvkm_device *device = disp->engine.subdev.device;
	if (!(nvkm_rd32(device, 0x612004) & (0x00000010 << id)))
		return 0;
	return nvkm_ior_new_(&gf119_dac, disp, DAC, id);
}

int
gf119_dac_cnt(struct nvkm_disp *disp, unsigned long *pmask)
{
	struct nvkm_device *device = disp->engine.subdev.device;
	*pmask = (nvkm_rd32(device, 0x612004) & 0x000000f0) >> 4;
	return 4;
}
+8 −3
Original line number Diff line number Diff line
@@ -109,8 +109,13 @@ nv50_dac = {
int
nv50_dac_new(struct nvkm_disp *disp, int id)
{
	struct nvkm_device *device = disp->engine.subdev.device;
	if (!(nvkm_rd32(device, 0x610184) & (0x00100000 << id)))
		return 0;
	return nvkm_ior_new_(&nv50_dac, disp, DAC, id);
}

int
nv50_dac_cnt(struct nvkm_disp *disp, unsigned long *pmask)
{
	struct nvkm_device *device = disp->engine.subdev.device;
	*pmask = (nvkm_rd32(device, 0x610184) & 0x00700000) >> 20;
	return 3;
}
+1 −1
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ g84_disp = {
	.super = nv50_disp_super,
	.root = &g84_disp_root_oclass,
	.head = { .cnt = nv50_head_cnt, .new = nv50_head_new },
	.dac = { .nr = 3, .new = nv50_dac_new },
	.dac = { .cnt = nv50_dac_cnt, .new = nv50_dac_new },
	.sor = { .nr = 2, .new = g84_sor_new },
	.pior = { .nr = 3, .new = nv50_pior_new },
};
+1 −1
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ g94_disp = {
	.super = nv50_disp_super,
	.root = &g94_disp_root_oclass,
	.head = { .cnt = nv50_head_cnt, .new = nv50_head_new },
	.dac = { .nr = 3, .new = nv50_dac_new },
	.dac = { .cnt = nv50_dac_cnt, .new = nv50_dac_new },
	.sor = { .nr = 4, .new = g94_sor_new },
	.pior = { .nr = 3, .new = nv50_pior_new },
};
+1 −1
Original line number Diff line number Diff line
@@ -172,7 +172,7 @@ gf119_disp = {
	.super = gf119_disp_super,
	.root = &gf119_disp_root_oclass,
	.head = { .cnt = gf119_head_cnt, .new = gf119_head_new },
	.dac = { .nr = 3, .new = gf119_dac_new },
	.dac = { .cnt = gf119_dac_cnt, .new = gf119_dac_new },
	.sor = { .nr = 4, .new = gf119_sor_new },
};

Loading