Lines Matching refs:handle
42 static int validateAndMap(private_handle_t* handle) { in validateAndMap() argument
43 if (private_handle_t::validate(handle)) { in validateAndMap()
44 ALOGE("%s: Private handle is invalid - handle:%p", __func__, handle); in validateAndMap()
47 if (handle->fd_metadata < 0) { in validateAndMap()
52 if (!handle->base_metadata) { in validateAndMap()
55 handle->fd_metadata, 0); in validateAndMap()
58 __func__, handle, handle->fd_metadata, strerror(errno)); in validateAndMap()
62 handle->base_metadata = (uintptr_t) base; in validateAndMap()
67 static void unmapAndReset(private_handle_t *handle) { in unmapAndReset() argument
68 if (private_handle_t::validate(handle) == 0 && handle->base_metadata) { in unmapAndReset()
69 munmap(reinterpret_cast<void *>(handle->base_metadata), getMetaDataSize()); in unmapAndReset()
70 handle->base_metadata = 0; in unmapAndReset()
74 int setMetaData(private_handle_t *handle, DispParamType paramType, in setMetaData() argument
76 auto err = validateAndMap(handle); in setMetaData()
79 return setMetaDataVa(reinterpret_cast<MetaData_t*>(handle->base_metadata), in setMetaData()
157 int clearMetaData(private_handle_t *handle, DispParamType paramType) { in clearMetaData() argument
158 auto err = validateAndMap(handle); in clearMetaData()
161 return clearMetaDataVa(reinterpret_cast<MetaData_t *>(handle->base_metadata), in clearMetaData()
181 int getMetaData(private_handle_t *handle, DispFetchParamType paramType, in getMetaData() argument
183 int ret = validateAndMap(handle); in getMetaData()
186 return getMetaDataVa(reinterpret_cast<MetaData_t *>(handle->base_metadata), in getMetaData()
356 int setMetaDataAndUnmap(struct private_handle_t *handle, enum DispParamType paramType, in setMetaDataAndUnmap() argument
358 auto ret = setMetaData(handle, paramType, param); in setMetaDataAndUnmap()
359 unmapAndReset(handle); in setMetaDataAndUnmap()
363 int getMetaDataAndUnmap(struct private_handle_t *handle, in getMetaDataAndUnmap() argument
366 auto ret = getMetaData(handle, paramType, param); in getMetaDataAndUnmap()
367 unmapAndReset(handle); in getMetaDataAndUnmap()