linux-5.0.1/drivers/gpu/drm/msm/disp/dpu1/dpu_core_irq.c
/**
 * _dpu_core_irq_disable - disable core interrupt given by the index
 * @dpu_kms:		Pointer to dpu kms context
 * @irq_idx:		interrupt index
 */
disable core interrupt given by the index
@dpu_kms:            Pointer to dpu kms context
@irq_idx:            interrupt index
disable core interrupt given by the index @dpu_kms : Pointer to dpu kms context @irq_idx : interrupt index
static int _dpu_core_irq_disable(struct dpu_kms *dpu_kms, int irq_idx)
{
	int ret = 0, enable_count;
	if (!dpu_kms || !dpu_kms->hw_intr || !dpu_kms->irq_obj.enable_counts) {
		DPU_ERROR("invalid params\n");
		return -EINVAL;
	}
	if (irq_idx < 0 || irq_idx >= dpu_kms->hw_intr->irq_idx_tbl_size) {
		DPU_ERROR("invalid IRQ index: [%d]\n", irq_idx);
		return -EINVAL;
	}
	enable_count = atomic_read(&dpu_kms->irq_obj.enable_counts[irq_idx]);
	DRM_DEBUG_KMS("irq_idx=%d enable_count=%d\n", irq_idx, enable_count);
	trace_dpu_core_irq_disable_idx(irq_idx, enable_count);
	if (atomic_dec_return(&dpu_kms->irq_obj.enable_counts[irq_idx]) == 0) {
		ret = dpu_kms->hw_intr->ops.disable_irq(
				dpu_kms->hw_intr,
				irq_idx);
		if (ret)
			DPU_ERROR("Fail to disable IRQ for irq_idx:%d\n",
					irq_idx);
		DPU_DEBUG("irq_idx=%d ret=%d\n", irq_idx, ret);
	}
	return ret;
}
static int _dpu_core_irq_disable ( struct dpu_kms * dpu_kms , int irq_idx ) { int ret = 0 , enable_count ; if ( ! dpu_kms || ! dpu_kms -> hw_intr || ! dpu_kms -> irq_obj . enable_counts ) { DPU_ERROR ( " \n " ) ; return - EINVAL ; } if ( irq_idx < 0 || irq_idx >= dpu_kms -> hw_intr -> irq_idx_tbl_size ) { DPU_ERROR ( " \n " , irq_idx ) ; return - EINVAL ; } enable_count = atomic_read ( & dpu_kms -> irq_obj . enable_counts [ irq_idx ] ) ; DRM_DEBUG_KMS ( " \n " , irq_idx , enable_count ) ; trace_dpu_core_irq_disable_idx ( irq_idx , enable_count ) ; if ( atomic_dec_return ( & dpu_kms -> irq_obj . enable_counts [ irq_idx ] ) == 0 ) { ret = dpu_kms -> hw_intr -> ops . disable_irq ( dpu_kms -> hw_intr , irq_idx ) ; if ( ret ) DPU_ERROR ( " \n " , irq_idx ) ; DPU_DEBUG ( " \n " , irq_idx , ret ) ; } return ret ; }
_dpu_core_irq_disable - disable core interrupt given by the index
 @dpu_kms:            Pointer to dpu kms context
 @irq_idx:            interrupt index
_dpu_core_irq_disable - disable core interrupt given by the index @dpu_kms : Pointer to dpu kms context @irq_idx : interrupt index