Lines Matching refs:buf

32 …struct scm_buffer_info_t *buf = (struct scm_buffer_info_t *)kmalloc(sizeof(struct scm_buffer_info_…  in __create_buffer()  local
33 if (buf == NULL) in __create_buffer()
35 memset(buf, 0, sizeof(struct scm_buffer_info_t)); in __create_buffer()
36 buf->bit_depth = video_frame_buffer_info.bit_depth; in __create_buffer()
37 buf->flags = SCM_BF_DB; in __create_buffer()
40 buf->flags |= SCM_BF_PIXEL; in __create_buffer()
42 buf->flags |= SCM_BF_TEXT; in __create_buffer()
43 buf->height = video_frame_buffer_info.height; in __create_buffer()
44 buf->width = video_frame_buffer_info.width; in __create_buffer()
45 buf->size = video_frame_buffer_info.size; in __create_buffer()
50 buf->vaddr = (uint64_t)phys_2_virt(p->addr_phys); in __create_buffer()
51 return buf; in __create_buffer()
53 kfree(buf); in __create_buffer()
63 static int __destroy_buffer(struct scm_buffer_info_t *buf) in __destroy_buffer() argument
66 if (unlikely(buf == &video_frame_buffer_info || buf == NULL)) in __destroy_buffer()
68 if (unlikely(buf->vaddr == NULL)) in __destroy_buffer()
70 if (unlikely(verify_area(buf->vaddr, buf->size) == true)) in __destroy_buffer()
73 if (buf->flags & SCM_BF_FB) in __destroy_buffer()
77 …free_pages(Phy_to_2M_Page(virt_2_phys(buf->vaddr)), PAGE_2M_ALIGN(video_frame_buffer_info.size) / … in __destroy_buffer()
148 ui->buf = __create_buffer(ui->type); in scm_register_alloc()
149 if ((uint64_t)(ui->buf) == (uint64_t)-ENOMEM) in scm_register_alloc()
158 ui->ui_ops->install(ui->buf); in scm_register_alloc()
183 ui->buf = __create_buffer(ui->type); in scm_register()
185 if ((uint64_t)(ui->buf) == (uint64_t)-ENOMEM) in scm_register()
192 ui->ui_ops->install(ui->buf); in scm_register()
252 if (ptr->buf == &video_frame_buffer_info) in scm_enable_double_buffer()
255 struct scm_buffer_info_t *buf = __create_buffer(SCM_BF_DB | SCM_BF_PIXEL); in scm_enable_double_buffer() local
256 if ((uint64_t)(buf) == (uint64_t)-ENOMEM) in scm_enable_double_buffer()
260 if (ptr->ui_ops->change(buf) != 0) // 这里的change回调函数不会是空指针吗 问题2 in scm_enable_double_buffer()
263 __destroy_buffer(buf); in scm_enable_double_buffer()
264 kfree(buf); in scm_enable_double_buffer()
271 video_set_refresh_target(__current_framework->buf); in scm_enable_double_buffer()
286 if (ui->buf->vaddr == NULL) in scm_framework_enable()
293 retval = video_set_refresh_target(ui->buf); in scm_framework_enable()
318 if (ptr->buf == &video_frame_buffer_info) in scm_reinit()