1: int32_t AG903_PgpMgrReleaseVRAMInputHandle(
AG903_PgpMgrVRAMInputHandle *handle)
2: {
3:
4:
if ((handle == NULL) || (handle->id !=
AG903_PGP_MGR_VRAM_INPUT_HANDLE_ID)) {
5:
return -
AG903_EINVAL;
6: }
7:
8:
9:
if (handle->ref_cnt != 0) {
10:
return -
AG903_EBUSY;
11: }
12:
13:
if (PgpContext.assign_vram[handle->port_no] == handle) {
14: PgpContext.assign_vram[handle->port_no] = NULL;
15: }
16:
if (PgpContext.exec_vram[handle->port_no] == handle) {
17: PgpContext.exec_vram[handle->port_no] = NULL;
18: }
19:
20: handle->is_used =
false;
21: handle->id = 0;
22: PgpContext.num_vram_input_handles--;
23:
return AG903_ENONE;
24: }