Skip to content

Commit 355223c

Browse files
committed
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: Dave Airlie <[email protected]> From: Joonas Lahtinen <[email protected]> Link: https://patch.msgid.link/acTdjAoOGkzl3dcc@jlahtine-mobl
2 parents 7261c2f + 77fcf58 commit 355223c

6 files changed

Lines changed: 41 additions & 15 deletions

File tree

drivers/gpu/drm/i915/display/intel_display.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4602,6 +4602,7 @@ intel_crtc_prepare_cleared_state(struct intel_atomic_state *state,
46024602
struct intel_crtc_state *crtc_state =
46034603
intel_atomic_get_new_crtc_state(state, crtc);
46044604
struct intel_crtc_state *saved_state;
4605+
int err;
46054606

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

4613-
intel_dp_tunnel_atomic_clear_stream_bw(state, crtc_state);
4614+
err = intel_dp_tunnel_atomic_clear_stream_bw(state, crtc_state);
4615+
if (err) {
4616+
kfree(saved_state);
4617+
4618+
return err;
4619+
}
46144620

46154621
/* FIXME: before the switch to atomic started, a new pipe_config was
46164622
* kzalloc'd. Code that depends on any field being zero should be

drivers/gpu/drm/i915/display/intel_dp_tunnel.c

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -621,19 +621,27 @@ int intel_dp_tunnel_atomic_compute_stream_bw(struct intel_atomic_state *state,
621621
*
622622
* Clear any DP tunnel stream BW requirement set by
623623
* intel_dp_tunnel_atomic_compute_stream_bw().
624+
*
625+
* Returns 0 in case of success, a negative error code otherwise.
624626
*/
625-
void intel_dp_tunnel_atomic_clear_stream_bw(struct intel_atomic_state *state,
626-
struct intel_crtc_state *crtc_state)
627+
int intel_dp_tunnel_atomic_clear_stream_bw(struct intel_atomic_state *state,
628+
struct intel_crtc_state *crtc_state)
627629
{
628630
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
631+
int err;
629632

630633
if (!crtc_state->dp_tunnel_ref.tunnel)
631-
return;
634+
return 0;
635+
636+
err = drm_dp_tunnel_atomic_set_stream_bw(&state->base,
637+
crtc_state->dp_tunnel_ref.tunnel,
638+
crtc->pipe, 0);
639+
if (err)
640+
return err;
632641

633-
drm_dp_tunnel_atomic_set_stream_bw(&state->base,
634-
crtc_state->dp_tunnel_ref.tunnel,
635-
crtc->pipe, 0);
636642
drm_dp_tunnel_ref_put(&crtc_state->dp_tunnel_ref);
643+
644+
return 0;
637645
}
638646

639647
/**

drivers/gpu/drm/i915/display/intel_dp_tunnel.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ int intel_dp_tunnel_atomic_compute_stream_bw(struct intel_atomic_state *state,
4040
struct intel_dp *intel_dp,
4141
const struct intel_connector *connector,
4242
struct intel_crtc_state *crtc_state);
43-
void intel_dp_tunnel_atomic_clear_stream_bw(struct intel_atomic_state *state,
44-
struct intel_crtc_state *crtc_state);
43+
int intel_dp_tunnel_atomic_clear_stream_bw(struct intel_atomic_state *state,
44+
struct intel_crtc_state *crtc_state);
4545

4646
int intel_dp_tunnel_atomic_add_state_for_crtc(struct intel_atomic_state *state,
4747
struct intel_crtc *crtc);
@@ -88,9 +88,12 @@ intel_dp_tunnel_atomic_compute_stream_bw(struct intel_atomic_state *state,
8888
return 0;
8989
}
9090

91-
static inline void
91+
static inline int
9292
intel_dp_tunnel_atomic_clear_stream_bw(struct intel_atomic_state *state,
93-
struct intel_crtc_state *crtc_state) {}
93+
struct intel_crtc_state *crtc_state)
94+
{
95+
return 0;
96+
}
9497

9598
static inline int
9699
intel_dp_tunnel_atomic_add_state_for_crtc(struct intel_atomic_state *state,

drivers/gpu/drm/i915/display/intel_gmbus.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,8 +496,10 @@ gmbus_xfer_read_chunk(struct intel_display *display,
496496

497497
val = intel_de_read_fw(display, GMBUS3(display));
498498
do {
499-
if (extra_byte_added && len == 1)
499+
if (extra_byte_added && len == 1) {
500+
len--;
500501
break;
502+
}
501503

502504
*buf++ = val & 0xff;
503505
val >>= 8;

drivers/gpu/drm/i915/display/intel_plane.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,11 +436,16 @@ void intel_plane_copy_hw_state(struct intel_plane_state *plane_state,
436436
drm_framebuffer_get(plane_state->hw.fb);
437437
}
438438

439+
static void unlink_nv12_plane(struct intel_crtc_state *crtc_state,
440+
struct intel_plane_state *plane_state);
441+
439442
void intel_plane_set_invisible(struct intel_crtc_state *crtc_state,
440443
struct intel_plane_state *plane_state)
441444
{
442445
struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);
443446

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

1521+
if (!plane_state->planar_linked_plane)
1522+
return;
1523+
15161524
plane_state->planar_linked_plane = NULL;
15171525

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

1553-
if (plane_state->planar_linked_plane)
1554-
unlink_nv12_plane(crtc_state, plane_state);
1561+
unlink_nv12_plane(crtc_state, plane_state);
15551562
}
15561563

15571564
if (!crtc_state->nv12_planes)

drivers/gpu/drm/i915/i915_wait_util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
might_sleep(); \
2626
for (;;) { \
2727
const bool expired__ = ktime_after(ktime_get_raw(), end__); \
28-
OP; \
2928
/* Guarantee COND check prior to timeout */ \
3029
barrier(); \
30+
OP; \
3131
if (COND) { \
3232
ret__ = 0; \
3333
break; \

0 commit comments

Comments
 (0)