Commit 355223cb authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'drm-intel-fixes-2026-03-26' of...

Merge tag 'drm-intel-fixes-2026-03-26' of https://gitlab.freedesktop.org/drm/i915/kernel

 into drm-fixes

- DP tunnel error handling fix
- Spurious GMBUS timeout fix
- Unlink NV12 planes earlier
- Order OP vs. timeout correctly in __wait_for()

Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patch.msgid.link/acTdjAoOGkzl3dcc@jlahtine-mobl
parents 7261c2fc 77fcf58d
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -4602,6 +4602,7 @@ intel_crtc_prepare_cleared_state(struct intel_atomic_state *state,
	struct intel_crtc_state *crtc_state =
		intel_atomic_get_new_crtc_state(state, crtc);
	struct intel_crtc_state *saved_state;
	int err;

	saved_state = intel_crtc_state_alloc(crtc);
	if (!saved_state)
@@ -4610,7 +4611,12 @@ intel_crtc_prepare_cleared_state(struct intel_atomic_state *state,
	/* free the old crtc_state->hw members */
	intel_crtc_free_hw_state(crtc_state);

	intel_dp_tunnel_atomic_clear_stream_bw(state, crtc_state);
	err = intel_dp_tunnel_atomic_clear_stream_bw(state, crtc_state);
	if (err) {
		kfree(saved_state);

		return err;
	}

	/* FIXME: before the switch to atomic started, a new pipe_config was
	 * kzalloc'd. Code that depends on any field being zero should be
+14 −6
Original line number Diff line number Diff line
@@ -621,19 +621,27 @@ int intel_dp_tunnel_atomic_compute_stream_bw(struct intel_atomic_state *state,
 *
 * Clear any DP tunnel stream BW requirement set by
 * intel_dp_tunnel_atomic_compute_stream_bw().
 *
 * Returns 0 in case of success, a negative error code otherwise.
 */
void intel_dp_tunnel_atomic_clear_stream_bw(struct intel_atomic_state *state,
int intel_dp_tunnel_atomic_clear_stream_bw(struct intel_atomic_state *state,
					   struct intel_crtc_state *crtc_state)
{
	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
	int err;

	if (!crtc_state->dp_tunnel_ref.tunnel)
		return;
		return 0;

	drm_dp_tunnel_atomic_set_stream_bw(&state->base,
	err = drm_dp_tunnel_atomic_set_stream_bw(&state->base,
						 crtc_state->dp_tunnel_ref.tunnel,
						 crtc->pipe, 0);
	if (err)
		return err;

	drm_dp_tunnel_ref_put(&crtc_state->dp_tunnel_ref);

	return 0;
}

/**
+7 −4
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ int intel_dp_tunnel_atomic_compute_stream_bw(struct intel_atomic_state *state,
					     struct intel_dp *intel_dp,
					     const struct intel_connector *connector,
					     struct intel_crtc_state *crtc_state);
void intel_dp_tunnel_atomic_clear_stream_bw(struct intel_atomic_state *state,
int intel_dp_tunnel_atomic_clear_stream_bw(struct intel_atomic_state *state,
					   struct intel_crtc_state *crtc_state);

int intel_dp_tunnel_atomic_add_state_for_crtc(struct intel_atomic_state *state,
@@ -88,9 +88,12 @@ intel_dp_tunnel_atomic_compute_stream_bw(struct intel_atomic_state *state,
	return 0;
}

static inline void
static inline int
intel_dp_tunnel_atomic_clear_stream_bw(struct intel_atomic_state *state,
				       struct intel_crtc_state *crtc_state) {}
				       struct intel_crtc_state *crtc_state)
{
	return 0;
}

static inline int
intel_dp_tunnel_atomic_add_state_for_crtc(struct intel_atomic_state *state,
+3 −1
Original line number Diff line number Diff line
@@ -496,8 +496,10 @@ gmbus_xfer_read_chunk(struct intel_display *display,

		val = intel_de_read_fw(display, GMBUS3(display));
		do {
			if (extra_byte_added && len == 1)
			if (extra_byte_added && len == 1) {
				len--;
				break;
			}

			*buf++ = val & 0xff;
			val >>= 8;
+9 −2
Original line number Diff line number Diff line
@@ -436,11 +436,16 @@ void intel_plane_copy_hw_state(struct intel_plane_state *plane_state,
		drm_framebuffer_get(plane_state->hw.fb);
}

static void unlink_nv12_plane(struct intel_crtc_state *crtc_state,
			      struct intel_plane_state *plane_state);

void intel_plane_set_invisible(struct intel_crtc_state *crtc_state,
			       struct intel_plane_state *plane_state)
{
	struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);

	unlink_nv12_plane(crtc_state, plane_state);

	crtc_state->active_planes &= ~BIT(plane->id);
	crtc_state->scaled_planes &= ~BIT(plane->id);
	crtc_state->nv12_planes &= ~BIT(plane->id);
@@ -1513,6 +1518,9 @@ static void unlink_nv12_plane(struct intel_crtc_state *crtc_state,
	struct intel_display *display = to_intel_display(plane_state);
	struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);

	if (!plane_state->planar_linked_plane)
		return;

	plane_state->planar_linked_plane = NULL;

	if (!plane_state->is_y_plane)
@@ -1550,7 +1558,6 @@ static int icl_check_nv12_planes(struct intel_atomic_state *state,
		if (plane->pipe != crtc->pipe)
			continue;

		if (plane_state->planar_linked_plane)
		unlink_nv12_plane(crtc_state, plane_state);
	}

Loading