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

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

drm/nouveau/tmr: cosmetic changes



This is purely preparation for upcoming commits, there should be no
code changes here.

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent da06b46b
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -66,7 +66,7 @@ int nv04_dac_output_offset(struct drm_encoder *encoder)
static int sample_load_twice(struct drm_device *dev, bool sense[2])
{
	struct nvif_device *device = &nouveau_drm(dev)->device;
	struct nvkm_timer *ptimer = nvxx_timer(device);
	struct nvkm_timer *tmr = nvxx_timer(device);
	int i;

	for (i = 0; i < 2; i++) {
@@ -80,15 +80,15 @@ static int sample_load_twice(struct drm_device *dev, bool sense[2])
		 * use a 10ms timeout (guards against crtc being inactive, in
		 * which case blank state would never change)
		 */
		if (!nvkm_timer_wait_eq(ptimer, 10000000,
		if (!nvkm_timer_wait_eq(tmr, 10000000,
					NV_PRMCIO_INP0__COLOR,
					0x00000001, 0x00000000))
			return -EBUSY;
		if (!nvkm_timer_wait_eq(ptimer, 10000000,
		if (!nvkm_timer_wait_eq(tmr, 10000000,
					NV_PRMCIO_INP0__COLOR,
					0x00000001, 0x00000001))
			return -EBUSY;
		if (!nvkm_timer_wait_eq(ptimer, 10000000,
		if (!nvkm_timer_wait_eq(tmr, 10000000,
					NV_PRMCIO_INP0__COLOR,
					0x00000001, 0x00000000))
			return -EBUSY;
+3 −3
Original line number Diff line number Diff line
@@ -661,7 +661,7 @@ nv_load_state_ext(struct drm_device *dev, int head,
{
	struct nouveau_drm *drm = nouveau_drm(dev);
	struct nvif_device *device = &drm->device;
	struct nvkm_timer *ptimer = nvxx_timer(device);
	struct nvkm_timer *tmr = nvxx_timer(device);
	struct nv04_crtc_reg *regp = &state->crtc_reg[head];
	uint32_t reg900;
	int i;
@@ -741,8 +741,8 @@ nv_load_state_ext(struct drm_device *dev, int head,
		if (drm->device.info.family < NV_DEVICE_INFO_V0_KELVIN) {
			/* Not waiting for vertical retrace before modifying
			   CRE_53/CRE_54 causes lockups. */
			nvkm_timer_wait_eq(ptimer, 650000000, NV_PRMCIO_INP0__COLOR, 0x8, 0x8);
			nvkm_timer_wait_eq(ptimer, 650000000, NV_PRMCIO_INP0__COLOR, 0x8, 0x0);
			nvkm_timer_wait_eq(tmr, 650000000, NV_PRMCIO_INP0__COLOR, 0x8, 0x8);
			nvkm_timer_wait_eq(tmr, 650000000, NV_PRMCIO_INP0__COLOR, 0x8, 0x0);
		}

		wr_cio_state(dev, head, regp, NV_CIO_CRE_42);
+4 −4
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ void nvkm_timer_alarm_cancel(void *, struct nvkm_alarm *);
	nvkm_timer_wait_cb((o), NV_WAIT_DEFAULT, (c), (d))

struct nvkm_timer {
	struct nvkm_subdev base;
	struct nvkm_subdev subdev;
	u64  (*read)(struct nvkm_timer *);
	void (*alarm)(struct nvkm_timer *, u64 time, struct nvkm_alarm *);
	void (*alarm_cancel)(struct nvkm_timer *, struct nvkm_alarm *);
@@ -47,11 +47,11 @@ nvkm_timer(void *obj)
	nvkm_subdev_create_((p), (e), (o), 0, "PTIMER", "timer",            \
			       sizeof(**d), (void **)d)
#define nvkm_timer_destroy(p)                                               \
	nvkm_subdev_destroy(&(p)->base)
	nvkm_subdev_destroy(&(p)->subdev)
#define nvkm_timer_init(p)                                                  \
	nvkm_subdev_init(&(p)->base)
	nvkm_subdev_init(&(p)->subdev)
#define nvkm_timer_fini(p,s)                                                \
	nvkm_subdev_fini(&(p)->base, (s))
	nvkm_subdev_fini(&(p)->subdev, (s))

int nvkm_timer_create_(struct nvkm_object *, struct nvkm_engine *,
			  struct nvkm_oclass *, int size, void **);
+2 −2
Original line number Diff line number Diff line
@@ -164,7 +164,7 @@ nouveau_abi16_ioctl_getparam(ABI16_IOCTL_ARGS)
	struct nouveau_cli *cli = nouveau_cli(file_priv);
	struct nouveau_drm *drm = nouveau_drm(dev);
	struct nvif_device *device = &drm->device;
	struct nvkm_timer *ptimer = nvxx_timer(device);
	struct nvkm_timer *tmr = nvxx_timer(device);
	struct nvkm_gr *gr = nvxx_gr(device);
	struct drm_nouveau_getparam *getparam = data;

@@ -206,7 +206,7 @@ nouveau_abi16_ioctl_getparam(ABI16_IOCTL_ARGS)
		getparam->value = 0; /* deprecated */
		break;
	case NOUVEAU_GETPARAM_PTIMER_TIME:
		getparam->value = ptimer->read(ptimer);
		getparam->value = tmr->read(tmr);
		break;
	case NOUVEAU_GETPARAM_HAS_BO_USAGE:
		getparam->value = 1;
+3 −3
Original line number Diff line number Diff line
@@ -237,7 +237,7 @@ nvkm_pgr_vstatus_print(struct nv50_gr_priv *priv, int r,
static int
g84_gr_tlb_flush(struct nvkm_engine *engine)
{
	struct nvkm_timer *ptimer = nvkm_timer(engine);
	struct nvkm_timer *tmr = nvkm_timer(engine);
	struct nv50_gr_priv *priv = (void *)engine;
	bool idle, timeout = false;
	unsigned long flags;
@@ -247,7 +247,7 @@ g84_gr_tlb_flush(struct nvkm_engine *engine)
	spin_lock_irqsave(&priv->lock, flags);
	nv_mask(priv, 0x400500, 0x00000001, 0x00000000);

	start = ptimer->read(ptimer);
	start = tmr->read(tmr);
	do {
		idle = true;

@@ -266,7 +266,7 @@ g84_gr_tlb_flush(struct nvkm_engine *engine)
				idle = false;
		}
	} while (!idle &&
		 !(timeout = ptimer->read(ptimer) - start > 2000000000));
		 !(timeout = tmr->read(tmr) - start > 2000000000));

	if (timeout) {
		nv_error(priv, "PGRAPH TLB flush idle timeout fail\n");
Loading