-static int
-_tbm_surface_get_info (struct _tbm_surface *surf, int opt, tbm_surface_info_s *info, int map)
-{
- tbm_bo_handle bo_handles[4];
- int i;
-
- info->width = surf->info.width;
- info->height = surf->info.height;
- info->format = surf->info.format;
- info->bpp = surf->info.bpp;
- info->size = surf->info.size;
- info->num_planes = surf->info.num_planes;
-
- if (surf->num_bos == 1)
- {
- if (map == 1)
- {
- bo_handles[0] = tbm_bo_map (surf->bos[0], TBM_DEVICE_CPU, opt);
- if (bo_handles[0].ptr == NULL)
- return 0;
- }
- else
- {
- bo_handles[0] = tbm_bo_get_handle (surf->bos[0], TBM_DEVICE_CPU);
- if (bo_handles[0].ptr == NULL)
- return 0;
- }
-
- for (i = 0; i < surf->info.num_planes; i++)
- {
- info->planes[i].size = surf->info.planes[i].size;
- info->planes[i].offset = surf->info.planes[i].offset;
- info->planes[i].stride = surf->info.planes[i].stride;
- info->planes[i].ptr = bo_handles[0].ptr + surf->info.planes[i].offset;
- }
- }
- else
- {
- /* TODO: calculate the virtaul address when num_bos is over 1 */
- }
-
- return 1;
-}
-