Commit 9549c14b authored by Ben Skeggs's avatar Ben Skeggs
Browse files

drm/nouveau/kms/nv50-: convert core head_curs_set() to new push macros



Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
parent aabe253e
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ struct nv50_head_func {
			   struct nv50_head_atom *);
	int (*curs_format)(struct nv50_head *, struct nv50_wndw_atom *,
			   struct nv50_head_atom *);
	void (*curs_set)(struct nv50_head *, struct nv50_head_atom *);
	int (*curs_set)(struct nv50_head *, struct nv50_head_atom *);
	void (*curs_clr)(struct nv50_head *);
	void (*base)(struct nv50_head *, struct nv50_head_atom *);
	void (*ovly)(struct nv50_head *, struct nv50_head_atom *);
@@ -74,7 +74,7 @@ int head907d_olut_set(struct nv50_head *, struct nv50_head_atom *);
int head907d_olut_clr(struct nv50_head *);
int head907d_core_set(struct nv50_head *, struct nv50_head_atom *);
int head907d_core_clr(struct nv50_head *);
void head907d_curs_set(struct nv50_head *, struct nv50_head_atom *);
int head907d_curs_set(struct nv50_head *, struct nv50_head_atom *);
void head907d_curs_clr(struct nv50_head *);
void head907d_ovly(struct nv50_head *, struct nv50_head_atom *);
void head907d_procamp(struct nv50_head *, struct nv50_head_atom *);
@@ -88,7 +88,7 @@ extern const struct nv50_head_func headc37d;
int headc37d_view(struct nv50_head *, struct nv50_head_atom *);
int headc37d_curs_format(struct nv50_head *, struct nv50_wndw_atom *,
			 struct nv50_head_atom *);
void headc37d_curs_set(struct nv50_head *, struct nv50_head_atom *);
int headc37d_curs_set(struct nv50_head *, struct nv50_head_atom *);
void headc37d_curs_clr(struct nv50_head *);
void headc37d_dither(struct nv50_head *, struct nv50_head_atom *);
void headc37d_static_wndw_map(struct nv50_head *, struct nv50_head_atom *);
+13 −10
Original line number Diff line number Diff line
@@ -117,18 +117,21 @@ head507d_curs_clr(struct nv50_head *head)
	}
}

static void
static int
head507d_curs_set(struct nv50_head *head, struct nv50_head_atom *asyh)
{
	struct nv50_dmac *core = &nv50_disp(head->base.base.dev)->core->chan;
	u32 *push;
	if ((push = evo_wait(core, 3))) {
		evo_mthd(push, 0x0880 + head->base.index * 0x400, 2);
		evo_data(push, 0x80000000 | asyh->curs.layout << 26 |
					    asyh->curs.format << 24);
		evo_data(push, asyh->curs.offset >> 8);
		evo_kick(push, core);
	}
	struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push;
	const int i = head->base.index;
	int ret;

	if ((ret = PUSH_WAIT(push, 3)))
		return ret;

	PUSH_NVSQ(push, NV507D, 0x0880 + (i * 0x400), 0x80000000 |
						      asyh->curs.layout << 26 |
						      asyh->curs.format << 24,
				0x0884 + (i * 0x400), asyh->curs.offset >> 8);
	return 0;
}

int
+14 −12
Original line number Diff line number Diff line
@@ -38,20 +38,22 @@ head827d_curs_clr(struct nv50_head *head)
	}
}

static void
static int
head827d_curs_set(struct nv50_head *head, struct nv50_head_atom *asyh)
{
	struct nv50_dmac *core = &nv50_disp(head->base.base.dev)->core->chan;
	u32 *push;
	if ((push = evo_wait(core, 5))) {
		evo_mthd(push, 0x0880 + head->base.index * 0x400, 2);
		evo_data(push, 0x80000000 | asyh->curs.layout << 26 |
					    asyh->curs.format << 24);
		evo_data(push, asyh->curs.offset >> 8);
		evo_mthd(push, 0x089c + head->base.index * 0x400, 1);
		evo_data(push, asyh->curs.handle);
		evo_kick(push, core);
	}
	struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push;
	const int i = head->base.index;
	int ret;

	if ((ret = PUSH_WAIT(push, 5)))
		return ret;

	PUSH_NVSQ(push, NV827D, 0x0880 + (i * 0x400), 0x80000000 |
						      asyh->curs.layout << 26 |
						      asyh->curs.format << 24,
				0x0884 + (i * 0x400), asyh->curs.offset >> 8);
	PUSH_NVSQ(push, NV827D, 0x089c + (i * 0x400), asyh->curs.handle);
	return 0;
}

static int
+14 −12
Original line number Diff line number Diff line
@@ -144,20 +144,22 @@ head907d_curs_clr(struct nv50_head *head)
	}
}

void
int
head907d_curs_set(struct nv50_head *head, struct nv50_head_atom *asyh)
{
	struct nv50_dmac *core = &nv50_disp(head->base.base.dev)->core->chan;
	u32 *push;
	if ((push = evo_wait(core, 5))) {
		evo_mthd(push, 0x0480 + head->base.index * 0x300, 2);
		evo_data(push, 0x80000000 | asyh->curs.layout << 26 |
					    asyh->curs.format << 24);
		evo_data(push, asyh->curs.offset >> 8);
		evo_mthd(push, 0x048c + head->base.index * 0x300, 1);
		evo_data(push, asyh->curs.handle);
		evo_kick(push, core);
	}
	struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push;
	const int i = head->base.index;
	int ret;

	if ((ret = PUSH_WAIT(push, 5)))
		return ret;

	PUSH_NVSQ(push, NV907D, 0x0480 + (i * 0x300), 0x80000000 |
						      asyh->curs.layout << 26 |
						      asyh->curs.format << 24,
				0x0484 + (i * 0x300), asyh->curs.offset >> 8);
	PUSH_NVSQ(push, NV907D, 0x048c + (i * 0x300), asyh->curs.handle);
	return 0;
}

int
+15 −15
Original line number Diff line number Diff line
@@ -98,23 +98,23 @@ headc37d_curs_clr(struct nv50_head *head)
	}
}

void
int
headc37d_curs_set(struct nv50_head *head, struct nv50_head_atom *asyh)
{
	struct nv50_dmac *core = &nv50_disp(head->base.base.dev)->core->chan;
	u32 *push;
	if ((push = evo_wait(core, 7))) {
		evo_mthd(push, 0x209c + head->base.index * 0x400, 2);
		evo_data(push, 0x80000000 |
	struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push;
	const int i = head->base.index;
	int ret;

	if ((ret = PUSH_WAIT(push, 7)))
		return ret;

	PUSH_NVSQ(push, NVC37D, 0x209c + (i * 0x400), 0x80000000 |
						      asyh->curs.layout << 8 |
			       asyh->curs.format << 0);
		evo_data(push, 0x000072ff);
		evo_mthd(push, 0x2088 + head->base.index * 0x400, 1);
		evo_data(push, asyh->curs.handle);
		evo_mthd(push, 0x2090 + head->base.index * 0x400, 1);
		evo_data(push, asyh->curs.offset >> 8);
		evo_kick(push, core);
	}
						      asyh->curs.format << 0,
				0x20a0 + (i * 0x400), 0x000072ff);
	PUSH_NVSQ(push, NVC37D, 0x2088 + (i * 0x400), asyh->curs.handle);
	PUSH_NVSQ(push, NVC37D, 0x2090 + (i * 0x400), asyh->curs.offset >> 8);
	return 0;
}

int