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

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



Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
parent 246db5fd
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ struct nv50_head_func {
	int (*ovly)(struct nv50_head *, struct nv50_head_atom *);
	int (*dither)(struct nv50_head *, struct nv50_head_atom *);
	int (*procamp)(struct nv50_head *, struct nv50_head_atom *);
	void (*or)(struct nv50_head *, struct nv50_head_atom *);
	int (*or)(struct nv50_head *, struct nv50_head_atom *);
	void (*static_wndw_map)(struct nv50_head *, struct nv50_head_atom *);
};

@@ -78,7 +78,7 @@ int head907d_curs_set(struct nv50_head *, struct nv50_head_atom *);
int head907d_curs_clr(struct nv50_head *);
int head907d_ovly(struct nv50_head *, struct nv50_head_atom *);
int head907d_procamp(struct nv50_head *, struct nv50_head_atom *);
void head907d_or(struct nv50_head *, struct nv50_head_atom *);
int head907d_or(struct nv50_head *, struct nv50_head_atom *);

extern const struct nv50_head_func head917d;
int head917d_curs_layout(struct nv50_head *, struct nv50_wndw_atom *,
+16 −13
Original line number Diff line number Diff line
@@ -31,21 +31,24 @@

#include <nvif/push507c.h>

void
int
head907d_or(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, 0x0404 + (head->base.index * 0x300), 2);
		evo_data(push, asyh->or.depth  << 6 |
	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, NV907D, 0x0404 + (i * 0x300), asyh->or.depth  << 6 |
						      asyh->or.nvsync << 4 |
						      asyh->or.nhsync << 3 |
			       asyh->or.crc_raster);
		evo_data(push, 0x31ec6000 | head->base.index << 25 |
						      asyh->or.crc_raster,
				0x0408 + (i * 0x300), 0x31ec6000 |
						      head->base.index << 25 |
						      asyh->mode.interlace);
		evo_kick(push, core);
	}
	return 0;
}

int
+26 −25
Original line number Diff line number Diff line
@@ -25,14 +25,14 @@

#include <nvif/pushc37b.h>

static void
static int
headc37d_or(struct nv50_head *head, struct nv50_head_atom *asyh)
{
	struct nv50_dmac *core = &nv50_disp(head->base.base.dev)->core->chan;
	struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push;
	const int i = head->base.index;
	u8 depth;
	u32 *push;
	int ret;

	if ((push = evo_wait(core, 2))) {
	/*XXX: This is a dirty hack until OR depth handling is
	 *     improved later for deep colour etc.
	 */
@@ -47,13 +47,14 @@ headc37d_or(struct nv50_head *head, struct nv50_head_atom *asyh)
		break;
	}

		evo_mthd(push, 0x2004 + (head->base.index * 0x400), 1);
		evo_data(push, depth << 4 |
	if ((ret = PUSH_WAIT(push, 2)))
		return ret;

	PUSH_NVSQ(push, NVC37D, 0x2004 + (i * 0x400), depth << 4 |
						      asyh->or.nvsync << 3 |
						      asyh->or.nhsync << 2 |
						      asyh->or.crc_raster);
		evo_kick(push, core);
	}
	return 0;
}

static int
+26 −25
Original line number Diff line number Diff line
@@ -25,14 +25,14 @@

#include <nvif/pushc37b.h>

static void
static int
headc57d_or(struct nv50_head *head, struct nv50_head_atom *asyh)
{
	struct nv50_dmac *core = &nv50_disp(head->base.base.dev)->core->chan;
	struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push;
	const int i = head->base.index;
	u8 depth;
	u32 *push;
	int ret;

	if ((push = evo_wait(core, 2))) {
	/*XXX: This is a dirty hack until OR depth handling is
	 *     improved later for deep colour etc.
	 */
@@ -47,14 +47,15 @@ headc57d_or(struct nv50_head *head, struct nv50_head_atom *asyh)
		break;
	}

		evo_mthd(push, 0x2004 + (head->base.index * 0x400), 1);
		evo_data(push, 0xfc000000 |
	if ((ret = PUSH_WAIT(push, 2)))
		return ret;

	PUSH_NVSQ(push, NVC57D, 0x2004 + (i * 0x400), 0xfc000000 |
						      depth << 4 |
						      asyh->or.nvsync << 3 |
						      asyh->or.nhsync << 2 |
						      asyh->or.crc_raster);
		evo_kick(push, core);
	}
	return 0;
}

static int