Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2fde1f1c authored by Ben Skeggs's avatar Ben Skeggs
Browse files

drm/nouveau/disp: switch to device pri macros



Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent f9793bb7
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@
int
nv50_dac_power(NV50_DISP_MTHD_V1)
{
	struct nvkm_device *device = disp->base.engine.subdev.device;
	const u32 doff = outp->or * 0x800;
	union {
		struct nv50_disp_dac_pwr_v0 v0;
@@ -54,7 +55,7 @@ nv50_dac_power(NV50_DISP_MTHD_V1)
		return ret;

	nv_wait(disp, 0x61a004 + doff, 0x80000000, 0x00000000);
	nv_mask(disp, 0x61a004 + doff, 0xc000007f, 0x80000000 | stat);
	nvkm_mask(device, 0x61a004 + doff, 0xc000007f, 0x80000000 | stat);
	nv_wait(disp, 0x61a004 + doff, 0x80000000, 0x00000000);
	return 0;
}
@@ -62,6 +63,7 @@ nv50_dac_power(NV50_DISP_MTHD_V1)
int
nv50_dac_sense(NV50_DISP_MTHD_V1)
{
	struct nvkm_device *device = disp->base.engine.subdev.device;
	union {
		struct nv50_disp_dac_load_v0 v0;
	} *args = data;
@@ -79,15 +81,15 @@ nv50_dac_sense(NV50_DISP_MTHD_V1)
	} else
		return ret;

	nv_mask(disp, 0x61a004 + doff, 0x807f0000, 0x80150000);
	nvkm_mask(device, 0x61a004 + doff, 0x807f0000, 0x80150000);
	nv_wait(disp, 0x61a004 + doff, 0x80000000, 0x00000000);

	nv_wr32(disp, 0x61a00c + doff, 0x00100000 | loadval);
	nvkm_wr32(device, 0x61a00c + doff, 0x00100000 | loadval);
	mdelay(9);
	udelay(500);
	loadval = nv_mask(disp, 0x61a00c + doff, 0xffffffff, 0x00000000);
	loadval = nvkm_mask(device, 0x61a00c + doff, 0xffffffff, 0x00000000);

	nv_mask(disp, 0x61a004 + doff, 0x807f0000, 0x80550000);
	nvkm_mask(device, 0x61a004 + doff, 0x807f0000, 0x80550000);
	nv_wait(disp, 0x61a004 + doff, 0x80000000, 0x00000000);

	nv_debug(disp, "DAC%d sense: 0x%08x\n", outp->or, loadval);
+128 −105

File changed.

Preview size limit exceeded, changes collapsed.

+2 −1
Original line number Diff line number Diff line
@@ -219,8 +219,9 @@ gk104_disp_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
		struct nvkm_oclass *oclass, void *data, u32 size,
		struct nvkm_object **pobject)
{
	struct nvkm_device *device = (void *)parent;
	struct nv50_disp *disp;
	int heads = nv_rd32(parent, 0x022448);
	int heads = nvkm_rd32(device, 0x022448);
	int ret;

	ret = nvkm_disp_create(parent, engine, oclass, heads,
+2 −1
Original line number Diff line number Diff line
@@ -54,8 +54,9 @@ gk110_disp_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
		struct nvkm_oclass *oclass, void *data, u32 size,
		struct nvkm_object **pobject)
{
	struct nvkm_device *device = (void *)parent;
	struct nv50_disp *disp;
	int heads = nv_rd32(parent, 0x022448);
	int heads = nvkm_rd32(device, 0x022448);
	int ret;

	ret = nvkm_disp_create(parent, engine, oclass, heads,
+2 −1
Original line number Diff line number Diff line
@@ -54,8 +54,9 @@ gm107_disp_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
		struct nvkm_oclass *oclass, void *data, u32 size,
		struct nvkm_object **pobject)
{
	struct nvkm_device *device = (void *)parent;
	struct nv50_disp *disp;
	int heads = nv_rd32(parent, 0x022448);
	int heads = nvkm_rd32(device, 0x022448);
	int ret;

	ret = nvkm_disp_create(parent, engine, oclass, heads,
Loading