Home | History | Annotate | Download | only in libgralloc-qsd8k

Lines Matching refs:hnd

57     private_handle_t* hnd = (private_handle_t*)handle;
58 if (!(hnd->flags & private_handle_t::PRIV_FLAGS_FRAMEBUFFER)) {
59 size_t size = hnd->size;
61 size += hnd->offset;
64 PROT_READ|PROT_WRITE, MAP_SHARED, hnd->fd, 0);
67 handle, hnd->fd, strerror(errno));
68 hnd->base = 0;
71 hnd->base = intptr_t(mappedAddress) + hnd->offset;
73 // hnd->fd, hnd->offset, hnd->size, mappedAddress);
75 *vaddr = (void*)hnd->base;
82 private_handle_t* hnd = (private_handle_t*)handle;
83 if (!(hnd->flags & private_handle_t::PRIV_FLAGS_FRAMEBUFFER)) {
84 void* base = (void*)hnd->base;
85 size_t size = hnd->size;
87 base = (void*)(intptr_t(base) - hnd->offset);
88 size += hnd->offset;
95 hnd->base = 0;
121 private_handle_t* hnd = (private_handle_t*)handle;
122 if (hnd->pid != getpid()) {
123 hnd->base = 0;
124 hnd->lockState = 0;
125 hnd->writeOwner = 0;
142 private_handle_t* hnd = (private_handle_t*)handle;
144 LOGE_IF(hnd->lockState & private_handle_t::LOCK_STATE_READ_MASK,
146 hnd, hnd->lockState);
149 if (hnd->pid != getpid()) {
150 if (hnd->lockState & private_handle_t::LOCK_STATE_MAPPED) {
153 hnd->base = 0;
154 hnd->lockState = 0;
155 hnd->writeOwner = 0;
161 private_handle_t* hnd)
168 LOGE_IF(hnd->lockState & private_handle_t::LOCK_STATE_READ_MASK,
170 hnd, hnd->lockState);
172 if (hnd->lockState & private_handle_t::LOCK_STATE_MAPPED) {
174 if ((hnd->flags & private_handle_t::PRIV_FLAGS_USES_PMEM) ||
175 (hnd->flags & private_handle_t::PRIV_FLAGS_USES_PMEM_ADSP)) {
176 if (hnd->pid != getpid()) {
180 gralloc_unmap(module, hnd);
183 gralloc_unmap(module, hnd);
199 private_handle_t* hnd = (private_handle_t*)handle;
204 current_value = hnd->lockState;
231 (volatile int32_t*)&hnd->lockState);
236 hnd->writeOwner = gettid();
247 (hnd->flags & pmemMask) &&
248 !(hnd->flags & private_handle_t::PRIV_FLAGS_FRAMEBUFFER)) {
249 hnd->flags |= private_handle_t::PRIV_FLAGS_NEEDS_FLUSH;
257 if (!(hnd->lockState & private_handle_t::LOCK_STATE_MAPPED)) {
261 (volatile int32_t*)&(hnd->lockState));
266 *vaddr = (void*)hnd->base;
278 private_handle_t* hnd = (private_handle_t*)handle;
281 if (hnd->flags & private_handle_t::PRIV_FLAGS_NEEDS_FLUSH) {
285 region.offset = hnd->offset;
286 region.len = hnd->size;
287 err = ioctl(hnd->fd, PMEM_CACHE_FLUSH, &region);
289 hnd, hnd->offset, hnd->size);
290 hnd->flags &= ~private_handle_t::PRIV_FLAGS_NEEDS_FLUSH;
294 current_value = hnd->lockState;
299 if (hnd->writeOwner == gettid()) {
300 hnd->writeOwner = 0;
313 (volatile int32_t*)&hnd->lockState));
341 private_handle_t* hnd = (private_handle_t*)native_handle_create(
343 hnd->magic = private_handle_t::sMagic;
344 hnd->fd = fd;
345 hnd->flags = private_handle_t::PRIV_FLAGS_USES_PMEM;
346 hnd->size = size;
347 hnd->offset = offset;
348 hnd->base = intptr_t(base) + offset;
349 hnd->lockState = private_handle_t::LOCK_STATE_MAPPED;
350 *handle = (native_handle_t *)hnd;