Lines Matching refs:attributes
43 for (i = 0; i < buffer->attributes.n_planes; i++) { in linux_dmabuf_buffer_destroy()
44 close(buffer->attributes.fd[i]); in linux_dmabuf_buffer_destroy()
45 buffer->attributes.fd[i] = -1; in linux_dmabuf_buffer_destroy()
48 buffer->attributes.n_planes = 0; in linux_dmabuf_buffer_destroy()
50 if (buffer->attributes.buffer_handle != NULL) { in linux_dmabuf_buffer_destroy()
51 free(buffer->attributes.buffer_handle); in linux_dmabuf_buffer_destroy()
107 if (buffer->attributes.fd[plane_idx] != -1) { in params_add()
116 buffer->attributes.fd[plane_idx] = name_fd; in params_add()
117 buffer->attributes.offset[plane_idx] = offset; in params_add()
118 buffer->attributes.stride[plane_idx] = stride; in params_add()
121 buffer->attributes.modifier[plane_idx] = DRM_FORMAT_MOD_INVALID; in params_add()
123 buffer->attributes.modifier[plane_idx] = ((uint64_t)modifier_hi << 32) | in params_add()
126 buffer->attributes.n_planes++; in params_add()
147 …buffer->attributes.buffer_handle = zalloc((sizeof(BufferHandle)) + (reserveFds + reserveInts) * si… in params_add_buffer_handle()
148 if (!buffer->attributes.buffer_handle) { in params_add_buffer_handle()
153 buffer->attributes.buffer_handle->fd = buffer->attributes.fd[0]; in params_add_buffer_handle()
154 buffer->attributes.buffer_handle->width = width; in params_add_buffer_handle()
155 buffer->attributes.buffer_handle->stride = stride; in params_add_buffer_handle()
156 buffer->attributes.buffer_handle->height = height; in params_add_buffer_handle()
157 buffer->attributes.buffer_handle->size = size; in params_add_buffer_handle()
158 buffer->attributes.buffer_handle->format = format; in params_add_buffer_handle()
159 buffer->attributes.buffer_handle->usage = ((uint64_t)(usage_hi) << 32) | usage_lo; in params_add_buffer_handle()
160 buffer->attributes.buffer_handle->phyAddr = ((uint64_t)(phyaddr_hi) << 32) | phyaddr_lo;; in params_add_buffer_handle()
161 buffer->attributes.buffer_handle->key = key; in params_add_buffer_handle()
162 buffer->attributes.buffer_handle->reserveFds = reserveFds; in params_add_buffer_handle()
163 buffer->attributes.buffer_handle->reserveInts = reserveInts; in params_add_buffer_handle()
168 buffer->attributes.buffer_handle->reserve[i] = *p; in params_add_buffer_handle()
172 buffer->attributes.buffer_handle->reserve[i] = *p; in params_add_buffer_handle()
233 if (!buffer->attributes.n_planes) { in params_create_common()
241 for (i = 0; i < buffer->attributes.n_planes; i++) { in params_create_common()
242 if (buffer->attributes.fd[i] == -1) { in params_create_common()
250 buffer->attributes.width = width; in params_create_common()
251 buffer->attributes.height = height; in params_create_common()
252 buffer->attributes.format = format; in params_create_common()
253 buffer->attributes.flags = flags; in params_create_common()
262 for (i = 0; i < buffer->attributes.n_planes; i++) { in params_create_common()
265 if ((uint64_t) buffer->attributes.offset[i] + buffer->attributes.stride[i] > UINT32_MAX) { in params_create_common()
273 (uint64_t) buffer->attributes.offset[i] + in params_create_common()
274 (uint64_t) buffer->attributes.stride[i] * height > UINT32_MAX) { in params_create_common()
283 size = lseek(buffer->attributes.fd[i], 0, SEEK_END); in params_create_common()
287 if (buffer->attributes.offset[i] >= size) { in params_create_common()
291 buffer->attributes.offset[i], i); in params_create_common()
295 if (buffer->attributes.offset[i] + buffer->attributes.stride[i] > size) { in params_create_common()
299 buffer->attributes.stride[i], i); in params_create_common()
306 buffer->attributes.offset[i] + buffer->attributes.stride[i] * height > size) { in params_create_common()
426 buffer->attributes.fd[i] = -1; in linux_dmabuf_create_params()