linux-5.0.1/drivers/gpu/drm/msm/disp/dpu1/dpu_core_irq.c
/**
 * dpu_core_irq_callback_handler - dispatch core interrupts
 * @arg:		private data of callback handler
 * @irq_idx:		interrupt index
 */
dispatch core interrupts
@arg:                private data of callback handler
@irq_idx:            interrupt index
dispatch core interrupts @arg : private data of callback handler @irq_idx : interrupt index
static void dpu_core_irq_callback_handler(void *arg, int irq_idx)
{
	struct dpu_kms *dpu_kms = arg;
	struct dpu_irq *irq_obj = &dpu_kms->irq_obj;
	struct dpu_irq_callback *cb;
	unsigned long irq_flags;
	pr_debug("irq_idx=%d\n", irq_idx);
	if (list_empty(&irq_obj->irq_cb_tbl[irq_idx])) {
		DRM_ERROR("no registered cb, idx:%d enable_count:%d\n", irq_idx,
			atomic_read(&dpu_kms->irq_obj.enable_counts[irq_idx]));
	}
	atomic_inc(&irq_obj->irq_counts[irq_idx]);
	spin_lock_irqsave(&dpu_kms->irq_obj.cb_lock, irq_flags);
	list_for_each_entry(cb, &irq_obj->irq_cb_tbl[irq_idx], list)
		if (cb->func)
			cb->func(cb->arg, irq_idx);
	spin_unlock_irqrestore(&dpu_kms->irq_obj.cb_lock, irq_flags);
	dpu_kms->hw_intr->ops.clear_intr_status_nolock(
			dpu_kms->hw_intr,
			irq_idx);
}
static void dpu_core_irq_callback_handler ( void * arg , int irq_idx ) { struct dpu_kms * dpu_kms = arg ; struct dpu_irq * irq_obj = & dpu_kms -> irq_obj ; struct dpu_irq_callback * cb ; unsigned long irq_flags ; pr_debug ( " \n " , irq_idx ) ; if ( list_empty ( & irq_obj -> irq_cb_tbl [ irq_idx ] ) ) { DRM_ERROR ( " \n " , irq_idx , atomic_read ( & dpu_kms -> irq_obj . enable_counts [ irq_idx ] ) ) ; } atomic_inc ( & irq_obj -> irq_counts [ irq_idx ] ) ; spin_lock_irqsave ( & dpu_kms -> irq_obj . cb_lock , irq_flags ) ; list_for_each_entry ( cb , & irq_obj -> irq_cb_tbl [ irq_idx ] , list ) if ( cb -> func ) cb -> func ( cb -> arg , irq_idx ) ; spin_unlock_irqrestore ( & dpu_kms -> irq_obj . cb_lock , irq_flags ) ; dpu_kms -> hw_intr -> ops . clear_intr_status_nolock ( dpu_kms -> hw_intr , irq_idx ) ; }
dpu_core_irq_callback_handler - dispatch core interrupts
 @arg:                private data of callback handler
 @irq_idx:            interrupt index
dpu_core_irq_callback_handler - dispatch core interrupts @arg : private data of callback handler @irq_idx : interrupt index
/*
	 * Perform registered function callback
	 */ /*
	 * Clear pending interrupt status in HW.
	 * NOTE: dpu_core_irq_callback_handler is protected by top-level
	 *       spinlock, so it is safe to clear any interrupt status here.
	 */