|
@@ -675,76 +675,6 @@ exit:
|
|
|
return rc;
|
|
|
}
|
|
|
|
|
|
-int cvp_dsp_deregister_buffer(uint32_t session_id, uint32_t buff_fd,
|
|
|
- uint32_t buff_fd_size, uint32_t buff_size,
|
|
|
- uint32_t buff_offset, uint32_t buff_index,
|
|
|
- uint32_t buff_fd_iova)
|
|
|
-{
|
|
|
- struct cvp_dsp_cmd_msg cmd;
|
|
|
- int rc;
|
|
|
- struct cvp_dsp_apps *me = &gfa_cv;
|
|
|
- struct cvp_dsp_rsp_msg rsp;
|
|
|
- bool retried = false;
|
|
|
-
|
|
|
- cmd.type = CPU2DSP_DEREGISTER_BUFFER;
|
|
|
- cmd.session_id = session_id;
|
|
|
- cmd.buff_fd = buff_fd;
|
|
|
- cmd.buff_fd_size = buff_fd_size;
|
|
|
- cmd.buff_size = buff_size;
|
|
|
- cmd.buff_offset = buff_offset;
|
|
|
- cmd.buff_index = buff_index;
|
|
|
- cmd.buff_fd_iova = buff_fd_iova;
|
|
|
-
|
|
|
- dprintk(CVP_DSP,
|
|
|
- "%s: type=0x%x, buff_fd_iova=0x%x buff_index=0x%x\n",
|
|
|
- __func__, cmd.type, buff_fd_iova,
|
|
|
- cmd.buff_index);
|
|
|
- dprintk(CVP_DSP, "%s: buff_size=0x%x session_id=0x%x\n",
|
|
|
- __func__, cmd.buff_size, cmd.session_id);
|
|
|
-
|
|
|
- mutex_lock(&me->tx_lock);
|
|
|
-retry:
|
|
|
- rc = cvp_dsp_send_cmd_sync(&cmd, sizeof(struct cvp_dsp_cmd_msg), &rsp);
|
|
|
- if (rc) {
|
|
|
- dprintk(CVP_ERR, "%s send failed rc = %d\n", __func__, rc);
|
|
|
- goto exit;
|
|
|
- }
|
|
|
-
|
|
|
- if (rsp.ret == CPU2DSP_EFAIL || rsp.ret == CPU2DSP_EUNSUPPORTED) {
|
|
|
- dprintk(CVP_WARN, "%s, DSP return err %d\n", __func__, rsp.ret);
|
|
|
- rc = -EINVAL;
|
|
|
- goto exit;
|
|
|
- }
|
|
|
-
|
|
|
- if (rsp.ret == CPU2DSP_EUNAVAILABLE)
|
|
|
- goto fatal_exit;
|
|
|
-
|
|
|
- if (rsp.ret == CPU2DSP_EFATAL) {
|
|
|
- if (!retried) {
|
|
|
- mutex_unlock(&me->tx_lock);
|
|
|
- retried = true;
|
|
|
- rc = cvp_reinit_dsp();
|
|
|
- mutex_lock(&me->tx_lock);
|
|
|
- if (rc)
|
|
|
- goto fatal_exit;
|
|
|
- else
|
|
|
- goto retry;
|
|
|
- } else {
|
|
|
- goto fatal_exit;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- goto exit;
|
|
|
-
|
|
|
-fatal_exit:
|
|
|
- me->state = DSP_INVALID;
|
|
|
- cvp_hyp_assign_from_dsp();
|
|
|
- rc = -ENOTSUPP;
|
|
|
-exit:
|
|
|
- mutex_unlock(&me->tx_lock);
|
|
|
- return rc;
|
|
|
-}
|
|
|
-
|
|
|
static const struct rpmsg_device_id cvp_dsp_rpmsg_match[] = {
|
|
|
{ CVP_APPS_DSP_GLINK_GUID },
|
|
|
{ },
|