Lines Matching refs:pvr_ccb

28 	struct pvr_ccb *pvr_ccb = priv;  in ccb_ctrl_init()  local
32 ctrl->wrap_mask = pvr_ccb->num_cmds - 1; in ccb_ctrl_init()
33 ctrl->cmd_size = pvr_ccb->cmd_size; in ccb_ctrl_init()
48 pvr_ccb_init(struct pvr_device *pvr_dev, struct pvr_ccb *pvr_ccb, in pvr_ccb_init() argument
55 pvr_ccb->num_cmds = num_cmds; in pvr_ccb_init()
56 pvr_ccb->cmd_size = cmd_size; in pvr_ccb_init()
58 err = drmm_mutex_init(from_pvr_device(pvr_dev), &pvr_ccb->lock); in pvr_ccb_init()
66 pvr_ccb->ctrl = pvr_fw_object_create_and_map(pvr_dev, sizeof(*pvr_ccb->ctrl), in pvr_ccb_init()
68 ccb_ctrl_init, pvr_ccb, &pvr_ccb->ctrl_obj); in pvr_ccb_init()
69 if (IS_ERR(pvr_ccb->ctrl)) in pvr_ccb_init()
70 return PTR_ERR(pvr_ccb->ctrl); in pvr_ccb_init()
72 pvr_ccb->ccb = pvr_fw_object_create_and_map(pvr_dev, ccb_size, in pvr_ccb_init()
74 NULL, NULL, &pvr_ccb->ccb_obj); in pvr_ccb_init()
75 if (IS_ERR(pvr_ccb->ccb)) { in pvr_ccb_init()
76 err = PTR_ERR(pvr_ccb->ccb); in pvr_ccb_init()
80 pvr_fw_object_get_fw_addr(pvr_ccb->ctrl_obj, &pvr_ccb->ctrl_fw_addr); in pvr_ccb_init()
81 pvr_fw_object_get_fw_addr(pvr_ccb->ccb_obj, &pvr_ccb->ccb_fw_addr); in pvr_ccb_init()
83 WRITE_ONCE(pvr_ccb->ctrl->write_offset, 0); in pvr_ccb_init()
84 WRITE_ONCE(pvr_ccb->ctrl->read_offset, 0); in pvr_ccb_init()
85 WRITE_ONCE(pvr_ccb->ctrl->wrap_mask, num_cmds - 1); in pvr_ccb_init()
86 WRITE_ONCE(pvr_ccb->ctrl->cmd_size, cmd_size); in pvr_ccb_init()
91 pvr_fw_object_unmap_and_destroy(pvr_ccb->ctrl_obj); in pvr_ccb_init()
101 pvr_ccb_fini(struct pvr_ccb *pvr_ccb) in pvr_ccb_fini() argument
103 pvr_fw_object_unmap_and_destroy(pvr_ccb->ccb_obj); in pvr_ccb_fini()
104 pvr_fw_object_unmap_and_destroy(pvr_ccb->ctrl_obj); in pvr_ccb_fini()
119 pvr_ccb_slot_available_locked(struct pvr_ccb *pvr_ccb, u32 *write_offset) in pvr_ccb_slot_available_locked() argument
121 struct rogue_fwif_ccb_ctl *ctrl = pvr_ccb->ctrl; in pvr_ccb_slot_available_locked()
124 lockdep_assert_held(&pvr_ccb->lock); in pvr_ccb_slot_available_locked()
216 struct pvr_ccb *pvr_ccb = &pvr_dev->kccb.ccb; in pvr_kccb_used_slot_count_locked() local
217 struct rogue_fwif_ccb_ctl *ctrl = pvr_ccb->ctrl; in pvr_kccb_used_slot_count_locked()
222 lockdep_assert_held(&pvr_ccb->lock); in pvr_kccb_used_slot_count_locked()
244 struct pvr_ccb *pvr_ccb = &pvr_dev->kccb.ccb; in pvr_kccb_send_cmd_reserved_powered() local
245 struct rogue_fwif_kccb_cmd *kccb = pvr_ccb->ccb; in pvr_kccb_send_cmd_reserved_powered()
246 struct rogue_fwif_ccb_ctl *ctrl = pvr_ccb->ctrl; in pvr_kccb_send_cmd_reserved_powered()
252 mutex_lock(&pvr_ccb->lock); in pvr_kccb_send_cmd_reserved_powered()
260 if (WARN_ON(!pvr_ccb_slot_available_locked(pvr_ccb, &new_write_offset))) in pvr_kccb_send_cmd_reserved_powered()
280 mutex_unlock(&pvr_ccb->lock); in pvr_kccb_send_cmd_reserved_powered()