⬢ DragonFlyBSD Kernel Audit
DF-4933 / fix.diff
← back to finding ↓ download raw
--- a/sys/dev/drm/amd/display/dc/irq/dce110/irq_service_dce110.c
+++ b/sys/dev/drm/amd/display/dc/irq/dce110/irq_service_dce110.c
@@ -198,11 +198,18 @@
 {
 	struct dc_context *dc_ctx = irq_service->ctx;
 	struct dc *core_dc = irq_service->ctx->dc;
-	enum dc_irq_source dal_irq_src =
-			dc_interrupt_to_irq_source(irq_service->ctx->dc,
-						   info->src_id,
-						   info->ext_id);
-	uint8_t pipe_offset = dal_irq_src - IRQ_TYPE_VBLANK;
+	/* derive the pipe index from the table entry itself — the VUPDATE
+	 * entries carry no .src_id, so re-mapping through the IH src-id
+	 * space returned DC_IRQ_SOURCE_INVALID and underflowed pipe_offset */
+	enum dc_irq_source source =
+			(enum dc_irq_source)(info - irq_service->info);
+	uint8_t pipe_offset;
+
+	if (source >= DC_IRQ_SOURCE_VUPDATE1 &&
+	    source <= DC_IRQ_SOURCE_VUPDATE6)
+		pipe_offset = source - DC_IRQ_SOURCE_VUPDATE1;
+	else
+		pipe_offset = source - DC_IRQ_SOURCE_VBLANK1;
 
 	struct timing_generator *tg =
 			core_dc->current_state->res_ctx.pipe_ctx[pipe_offset].stream_res.tg;