tbm_module: add tbm_surface_data_get_plane_data 97/260297/1
authorSooChan Lim <sc1.lim@samsung.com>
Tue, 22 Jun 2021 02:20:17 +0000 (11:20 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Tue, 22 Jun 2021 02:20:17 +0000 (11:20 +0900)
This gets the plane data from the surface_data

Change-Id: I4dc59461c28941c0f4184b3a70ea6d5922925b42

src/tbm_module.c
src/tbm_module.h

index 8bd834c..b614128 100644 (file)
@@ -896,6 +896,20 @@ tbm_surface_data_free(tbm_backend_surface_data *surface_data)
        free(surface_data);
 }
 
+tbm_error_e
+tbm_surface_data_get_plane_data(tbm_backend_surface_data *surface_data, int plane_idx, uint32_t *size, uint32_t *offset, uint32_t *pitch, int *bo_idx)
+{
+       tbm_error_e error;
+
+       TBM_RETURN_VAL_IF_FAIL(surface_data, TBM_ERROR_INVALID_PARAMETER);
+       TBM_RETURN_VAL_IF_FAIL(surface_data->hal_surface, TBM_ERROR_NOT_SUPPORTED);
+
+       error = (tbm_error_e)hal_tbm_surface_get_plane_data(surface_data->hal_surface, plane_idx, size, offset, pitch, bo_idx);
+       TBM_RETURN_VAL_IF_FAIL(error == TBM_ERROR_NONE, error);
+
+       return TBM_ERROR_NONE;
+}
+
 void
 tbm_module_bo_free(tbm_module *module, tbm_bo bo, tbm_backend_bo_data *bo_data, int get_from_hal_surface)
 {
index da920a8..9f31c5f 100644 (file)
@@ -91,6 +91,7 @@ tbm_backend_bo_data *tbm_module_import_bo_data_with_fd(tbm_module *module, tbm_b
 tbm_backend_bo_data *tbm_module_import_bo_data_with_key(tbm_module *module, tbm_bo bo, tbm_key key, tbm_error_e *error);
 
 void                      tbm_surface_data_free(tbm_backend_surface_data *surface_data);
+tbm_error_e               tbm_surface_data_get_plane_data(tbm_backend_surface_data *surface_data, int plane_idx, uint32_t *size, uint32_t *offset, uint32_t *pitch, int *bo_idx);
 
 void          tbm_module_bo_free(tbm_module *module, tbm_bo bo, tbm_backend_bo_data *bo_data, int get_from_hal_surface);
 int           tbm_module_bo_get_size(tbm_module *module, tbm_bo bo, tbm_backend_bo_data *bo_data, tbm_error_e *error);