Commit 507e8e5e authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge branch 'linux-4.13' of git://github.com/skeggsb/linux into drm-fixes

nouveau regression fixes.

* 'linux-4.13' of git://github.com/skeggsb/linux:
  drm/nouveau/kms: remove call to drm_crtc_vblank_off() during unload/suspend
  drm/nouveau/kms/nv50: update vblank state in response to modeset actions
  drm/nouveau/disp: add tv encoders to output resource mapping
  drm/nouveau/i2c/gf119-: add support for address-only transactions
parents 520eccdf 746c842d
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -1158,8 +1158,6 @@ nouveau_connector_aux_xfer(struct drm_dp_aux *obj, struct drm_dp_aux_msg *msg)
		return -ENODEV;
	if (WARN_ON(msg->size > 16))
		return -E2BIG;
	if (msg->size == 0)
		return msg->size;

	ret = nvkm_i2c_aux_acquire(aux);
	if (ret)
+0 −5
Original line number Diff line number Diff line
@@ -409,7 +409,6 @@ nouveau_display_fini(struct drm_device *dev, bool suspend)
	struct nouveau_display *disp = nouveau_display(dev);
	struct nouveau_drm *drm = nouveau_drm(dev);
	struct drm_connector *connector;
	struct drm_crtc *crtc;

	if (!suspend) {
		if (drm_drv_uses_atomic_modeset(dev))
@@ -418,10 +417,6 @@ nouveau_display_fini(struct drm_device *dev, bool suspend)
			drm_crtc_force_disable_all(dev);
	}

	/* Make sure that drm and hw vblank irqs get properly disabled. */
	drm_for_each_crtc(crtc, dev)
		drm_crtc_vblank_off(crtc);

	/* disable flip completion events */
	nvif_notify_put(&drm->flip);

+23 −8
Original line number Diff line number Diff line
@@ -3674,15 +3674,24 @@ nv50_sor_create(struct drm_connector *connector, struct dcb_output *dcbe)
	drm_mode_connector_attach_encoder(connector, encoder);

	if (dcbe->type == DCB_OUTPUT_DP) {
		struct nv50_disp *disp = nv50_disp(encoder->dev);
		struct nvkm_i2c_aux *aux =
			nvkm_i2c_aux_find(i2c, dcbe->i2c_index);
		if (aux) {
			if (disp->disp->oclass < GF110_DISP) {
				/* HW has no support for address-only
				 * transactions, so we're required to
				 * use custom I2C-over-AUX code.
				 */
				nv_encoder->i2c = &aux->i2c;
			} else {
				nv_encoder->i2c = &nv_connector->aux.ddc;
			}
			nv_encoder->aux = aux;
		}

		/*TODO: Use DP Info Table to check for support. */
		if (nv50_disp(encoder->dev)->disp->oclass >= GF110_DISP) {
		if (disp->disp->oclass >= GF110_DISP) {
			ret = nv50_mstm_new(nv_encoder, &nv_connector->aux, 16,
					    nv_connector->base.base.id,
					    &nv_encoder->dp.mstm);
@@ -3931,6 +3940,8 @@ nv50_disp_atomic_commit_tail(struct drm_atomic_state *state)

		NV_ATOMIC(drm, "%s: clr %04x (set %04x)\n", crtc->name,
			  asyh->clr.mask, asyh->set.mask);
		if (crtc_state->active && !asyh->state.active)
			drm_crtc_vblank_off(crtc);

		if (asyh->clr.mask) {
			nv50_head_flush_clr(head, asyh, atom->flush_disable);
@@ -4016,12 +4027,14 @@ nv50_disp_atomic_commit_tail(struct drm_atomic_state *state)
			nv50_head_flush_set(head, asyh);
			interlock_core = 1;
		}
	}

	for_each_crtc_in_state(state, crtc, crtc_state, i) {
		if (crtc->state->event)
		if (asyh->state.active) {
			if (!crtc_state->active)
				drm_crtc_vblank_on(crtc);
			if (asyh->state.event)
				drm_crtc_vblank_get(crtc);
		}
	}

	/* Update plane(s). */
	for_each_plane_in_state(state, plane, plane_state, i) {
@@ -4067,11 +4080,13 @@ nv50_disp_atomic_commit_tail(struct drm_atomic_state *state)
		if (crtc->state->event) {
			unsigned long flags;
			/* Get correct count/ts if racing with vblank irq */
			if (crtc->state->active)
				drm_accurate_vblank_count(crtc);
			spin_lock_irqsave(&crtc->dev->event_lock, flags);
			drm_crtc_send_vblank_event(crtc, crtc->state->event);
			spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
			crtc->state->event = NULL;
			if (crtc->state->active)
				drm_crtc_vblank_put(crtc);
		}
	}
+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ struct nvkm_ior {
		unsigned proto_evo:4;
		enum nvkm_ior_proto {
			CRT,
			TV,
			TMDS,
			LVDS,
			DP,
+1 −0
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ nvkm_outp_xlat(struct nvkm_outp *outp, enum nvkm_ior_type *type)
	case 0:
		switch (outp->info.type) {
		case DCB_OUTPUT_ANALOG: *type = DAC; return  CRT;
		case DCB_OUTPUT_TV    : *type = DAC; return   TV;
		case DCB_OUTPUT_TMDS  : *type = SOR; return TMDS;
		case DCB_OUTPUT_LVDS  : *type = SOR; return LVDS;
		case DCB_OUTPUT_DP    : *type = SOR; return   DP;
Loading