Commit 6d6e11e2 authored by Ben Skeggs's avatar Ben Skeggs
Browse files

drm/nouveau/kms/nv50-: convert wndw image_set() to new push macros



Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
parent 34838908
Loading
Loading
Loading
Loading
+26 −28
Original line number Diff line number Diff line
@@ -56,37 +56,35 @@ base507c_image_clr(struct nv50_wndw *wndw)
	}
}

static void
static int
base507c_image_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
{
	u32 *push;
	if ((push = evo_wait(&wndw->wndw, 13))) {
		evo_mthd(push, 0x0084, 1);
		evo_data(push, asyw->image.mode << 8 |
	struct nvif_push *push = wndw->wndw.push;
	int ret;

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

	PUSH_NVSQ(push, NV507C, 0x0084, asyw->image.mode << 8 |
					asyw->image.interval << 4);
		evo_mthd(push, 0x00c0, 1);
		evo_data(push, asyw->image.handle[0]);
	PUSH_NVSQ(push, NV507C, 0x00c0, asyw->image.handle[0]);
	if (asyw->image.format == 0xca) {
			evo_mthd(push, 0x0110, 2);
			evo_data(push, 1);
			evo_data(push, 0x6400);
		PUSH_NVSQ(push, NV507C, 0x0110, 1,
					0x0114, 0x6400);
	} else {
			evo_mthd(push, 0x0110, 2);
			evo_data(push, 0);
			evo_data(push, 0);
		PUSH_NVSQ(push, NV507C, 0x0110, 0,
					0x0114, 0);
	}
		evo_mthd(push, 0x0800, 5);
		evo_data(push, asyw->image.offset[0] >> 8);
		evo_data(push, 0x00000000);
		evo_data(push, asyw->image.h << 16 | asyw->image.w);
		evo_data(push, asyw->image.layout << 20 |
	PUSH_NVSQ(push, NV507C, 0x0800, asyw->image.offset[0] >> 8,
				0x0804, 0x00000000,
				0x0808, asyw->image.h << 16 | asyw->image.w,
				0x080c, asyw->image.layout << 20 |
				       (asyw->image.pitch[0] >> 8) << 8 |
				        asyw->image.blocks[0] << 8 |
			       asyw->image.blockh);
		evo_data(push, asyw->image.kind << 16 |
					asyw->image.blockh,
				0x0810, asyw->image.kind << 16 |
					asyw->image.format << 8);
		evo_kick(push, &wndw->wndw);
	}
	return 0;
}

int
+27 −27
Original line number Diff line number Diff line
@@ -21,36 +21,36 @@
 */
#include "base.h"

static void
#include <nvif/push507c.h>

static int
base827c_image_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
{
	u32 *push;
	if ((push = evo_wait(&wndw->wndw, 13))) {
		evo_mthd(push, 0x0084, 1);
		evo_data(push, asyw->image.mode << 8 |
	struct nvif_push *push = wndw->wndw.push;
	int ret;

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

	PUSH_NVSQ(push, NV827C, 0x0084, asyw->image.mode << 8 |
					asyw->image.interval << 4);
		evo_mthd(push, 0x00c0, 1);
		evo_data(push, asyw->image.handle[0]);
	PUSH_NVSQ(push, NV827C, 0x00c0, asyw->image.handle[0]);
	if (asyw->image.format == 0xca) {
			evo_mthd(push, 0x0110, 2);
			evo_data(push, 1);
			evo_data(push, 0x6400);
		PUSH_NVSQ(push, NV827C, 0x0110, 1,
					0x0114, 0x6400);
	} else {
			evo_mthd(push, 0x0110, 2);
			evo_data(push, 0);
			evo_data(push, 0);
		PUSH_NVSQ(push, NV827C, 0x0110, 0,
					0x0114, 0);
	}
		evo_mthd(push, 0x0800, 5);
		evo_data(push, asyw->image.offset[0] >> 8);
		evo_data(push, 0x00000000);
		evo_data(push, asyw->image.h << 16 | asyw->image.w);
		evo_data(push, asyw->image.layout << 20 |
	PUSH_NVSQ(push, NV827C, 0x0800, asyw->image.offset[0] >> 8,
				0x0804, 0x00000000,
				0x0808, asyw->image.h << 16 | asyw->image.w,
				0x080c, asyw->image.layout << 20 |
				       (asyw->image.pitch[0] >> 8) << 8 |
				        asyw->image.blocks[0] << 8 |
			       asyw->image.blockh);
		evo_data(push, asyw->image.format << 8);
		evo_kick(push, &wndw->wndw);
	}
					asyw->image.blockh,
				0x0810, asyw->image.format << 8);
	return 0;
}

static const struct nv50_wndw_func
+19 −19
Original line number Diff line number Diff line
@@ -23,27 +23,27 @@

#include <nvif/push507c.h>

static void
static int
base907c_image_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
{
	u32 *push;
	if ((push = evo_wait(&wndw->wndw, 10))) {
		evo_mthd(push, 0x0084, 1);
		evo_data(push, asyw->image.mode << 8 |
	struct nvif_push *push = wndw->wndw.push;
	int ret;

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

	PUSH_NVSQ(push, NV907C, 0x0084, asyw->image.mode << 8 |
					asyw->image.interval << 4);
		evo_mthd(push, 0x00c0, 1);
		evo_data(push, asyw->image.handle[0]);
		evo_mthd(push, 0x0400, 5);
		evo_data(push, asyw->image.offset[0] >> 8);
		evo_data(push, 0x00000000);
		evo_data(push, asyw->image.h << 16 | asyw->image.w);
		evo_data(push, asyw->image.layout << 24 |
	PUSH_NVSQ(push, NV907C, 0x00c0, asyw->image.handle[0]);
	PUSH_NVSQ(push, NV907C, 0x0400, asyw->image.offset[0] >> 8,
				0x0404, 0x00000000,
				0x0408, asyw->image.h << 16 | asyw->image.w,
				0x040c, asyw->image.layout << 24 |
				       (asyw->image.pitch[0] >> 8) << 8 |
				        asyw->image.blocks[0] << 8 |
			       asyw->image.blockh);
		evo_data(push, asyw->image.format << 8);
		evo_kick(push, &wndw->wndw);
	}
					asyw->image.blockh,
				0x0410, asyw->image.format << 8);
	return 0;
}

static int
+21 −22
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@

#include <nvif/cl507e.h>
#include <nvif/event.h>
#include <nvif/push507c.h>

void
ovly507e_update(struct nv50_wndw *wndw, u32 *interlock)
@@ -66,30 +67,28 @@ ovly507e_image_clr(struct nv50_wndw *wndw)
	}
}

static void
static int
ovly507e_image_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
{
	u32 *push;
	if ((push = evo_wait(&wndw->wndw, 12))) {
		evo_mthd(push, 0x0084, 1);
		evo_data(push, asyw->image.interval << 4);
		evo_mthd(push, 0x00c0, 1);
		evo_data(push, asyw->image.handle[0]);
		evo_mthd(push, 0x0100, 1);
		evo_data(push, 0x00000002);
		evo_mthd(push, 0x0800, 1);
		evo_data(push, asyw->image.offset[0] >> 8);
		evo_mthd(push, 0x0808, 3);
		evo_data(push, asyw->image.h << 16 | asyw->image.w);
		evo_data(push, asyw->image.layout << 20 |
	struct nvif_push *push = wndw->wndw.push;
	int ret;

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

	PUSH_NVSQ(push, NV507E, 0x0084, asyw->image.interval << 4);
	PUSH_NVSQ(push, NV507E, 0x00c0, asyw->image.handle[0]);
	PUSH_NVSQ(push, NV507E, 0x0100, 0x00000002);
	PUSH_NVSQ(push, NV507E, 0x0800, asyw->image.offset[0] >> 8);
	PUSH_NVSQ(push, NV507E, 0x0808, asyw->image.h << 16 | asyw->image.w,
				0x080c, asyw->image.layout << 20 |
				       (asyw->image.pitch[0] >> 8) << 8 |
					asyw->image.blocks[0] << 8 |
			       asyw->image.blockh);
		evo_data(push, asyw->image.kind << 16 |
					asyw->image.blockh,
				0x0810, asyw->image.kind << 16 |
					asyw->image.format << 8 |
					asyw->image.colorspace);
		evo_kick(push, &wndw->wndw);
	}
	return 0;
}

void
+20 −21
Original line number Diff line number Diff line
@@ -24,31 +24,30 @@

#include <nouveau_bo.h>

#include <nvif/push507c.h>
#include <nvif/timer.h>

static void
static int
ovly827e_image_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
{
	u32 *push;
	if ((push = evo_wait(&wndw->wndw, 12))) {
		evo_mthd(push, 0x0084, 1);
		evo_data(push, asyw->image.interval << 4);
		evo_mthd(push, 0x00c0, 1);
		evo_data(push, asyw->image.handle[0]);
		evo_mthd(push, 0x0100, 1);
		evo_data(push, 0x00000002);
		evo_mthd(push, 0x0800, 1);
		evo_data(push, asyw->image.offset[0] >> 8);
		evo_mthd(push, 0x0808, 3);
		evo_data(push, asyw->image.h << 16 | asyw->image.w);
		evo_data(push, asyw->image.layout << 20 |
	struct nvif_push *push = wndw->wndw.push;
	int ret;

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

	PUSH_NVSQ(push, NV827E, 0x0084, asyw->image.interval << 4);
	PUSH_NVSQ(push, NV827E, 0x00c0, asyw->image.handle[0]);
	PUSH_NVSQ(push, NV827E, 0x0100, 0x00000002);
	PUSH_NVSQ(push, NV827E, 0x0800, asyw->image.offset[0] >> 8);
	PUSH_NVSQ(push, NV827E, 0x0808, asyw->image.h << 16 | asyw->image.w,
				0x080c, asyw->image.layout << 20 |
				       (asyw->image.pitch[0] >> 8) << 8 |
					asyw->image.blocks[0] << 8 |
			       asyw->image.blockh);
		evo_data(push, asyw->image.format << 8 |
					asyw->image.blockh,
				0x0810, asyw->image.format << 8 |
					asyw->image.colorspace);
		evo_kick(push, &wndw->wndw);
	}
	return 0;
}

int
Loading