Lines Matching refs:qinfo
75 static u32 msgq_inc(const struct bcm_vk_sync_qinfo *qinfo, u32 idx, u32 inc) in msgq_inc() argument
77 return ((idx + inc) & qinfo->q_mask); in msgq_inc()
81 struct vk_msg_blk __iomem *msgq_blk_addr(const struct bcm_vk_sync_qinfo *qinfo, in msgq_blk_addr() argument
84 return qinfo->q_start + (VK_MSGQ_BLK_SIZE * idx); in msgq_blk_addr()
88 const struct bcm_vk_sync_qinfo *qinfo) in msgq_occupied() argument
95 return ((wr_idx - rd_idx) & qinfo->q_mask); in msgq_occupied()
100 const struct bcm_vk_sync_qinfo *qinfo) in msgq_avail_space() argument
102 return (qinfo->q_size - msgq_occupied(msgq, qinfo) - 1); in msgq_avail_space()
462 struct bcm_vk_sync_qinfo *qinfo; in bcm_vk_sync_msgq() local
492 qinfo = &chan->sync_qinfo[j]; in bcm_vk_sync_msgq()
494 qinfo->q_start = vk->bar[BAR_1] + msgq_start; in bcm_vk_sync_msgq()
495 qinfo->q_size = msgq_size; in bcm_vk_sync_msgq()
497 qinfo->q_low = qinfo->q_size >> 1; in bcm_vk_sync_msgq()
498 qinfo->q_mask = qinfo->q_size - 1; in bcm_vk_sync_msgq()
499 qinfo->q_db_offset = msgq_db_offset; in bcm_vk_sync_msgq()
547 struct bcm_vk_sync_qinfo *qinfo; in bcm_vk_append_ib_sgl() local
556 qinfo = &chan->sync_qinfo[q_num]; in bcm_vk_append_ib_sgl()
557 avail = msgq_avail_space(msgq, qinfo); in bcm_vk_append_ib_sgl()
558 if (avail < qinfo->q_low) { in bcm_vk_append_ib_sgl()
560 avail, qinfo->q_size); in bcm_vk_append_ib_sgl()
587 struct bcm_vk_sync_qinfo *qinfo = &chan->sync_qinfo[q_num]; in bcm_to_v_q_doorbell() local
589 vkwrite32(vk, db_val, BAR_0, qinfo->q_db_offset); in bcm_to_v_q_doorbell()
601 struct bcm_vk_sync_qinfo *qinfo; in bcm_to_v_msg_enqueue() local
619 qinfo = &chan->sync_qinfo[q_num]; in bcm_to_v_msg_enqueue()
623 avail = msgq_avail_space(msgq, qinfo); in bcm_to_v_msg_enqueue()
633 avail = msgq_avail_space(msgq, qinfo); in bcm_to_v_msg_enqueue()
644 if (wr_idx >= qinfo->q_size) { in bcm_to_v_msg_enqueue()
646 wr_idx, qinfo->q_size); in bcm_to_v_msg_enqueue()
652 dst = msgq_blk_addr(qinfo, wr_idx); in bcm_to_v_msg_enqueue()
657 wr_idx = msgq_inc(qinfo, wr_idx, 1); in bcm_to_v_msg_enqueue()
658 dst = msgq_blk_addr(qinfo, wr_idx); in bcm_to_v_msg_enqueue()
671 msgq_occupied(msgq, qinfo), in bcm_to_v_msg_enqueue()
672 msgq_avail_space(msgq, qinfo), in bcm_to_v_msg_enqueue()
783 struct bcm_vk_sync_qinfo *qinfo; in bcm_to_h_msg_dequeue() local
804 qinfo = &chan->sync_qinfo[q_num]; in bcm_to_h_msg_dequeue()
805 max_msg_to_process = BCM_VK_MSG_PROC_MAX_LOOP * qinfo->q_size; in bcm_to_h_msg_dequeue()
822 src = msgq_blk_addr(qinfo, rd_idx & qinfo->q_mask); in bcm_to_h_msg_dequeue()
825 if ((rd_idx >= qinfo->q_size) || in bcm_to_h_msg_dequeue()
826 (src_size > (qinfo->q_size - 1))) { in bcm_to_h_msg_dequeue()
829 rd_idx, src_size, qinfo->q_size); in bcm_to_h_msg_dequeue()
845 rd_idx = msgq_inc(qinfo, rd_idx, 1); in bcm_to_h_msg_dequeue()
846 src = msgq_blk_addr(qinfo, rd_idx); in bcm_to_h_msg_dequeue()
869 msgq_occupied(msgq, qinfo), in bcm_to_h_msg_dequeue()
870 msgq_avail_space(msgq, qinfo), in bcm_to_h_msg_dequeue()