summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBoram Park <boram1288.park@samsung.com>2015-12-22 19:42:08 +0900
committerBoram Park <boram1288.park@samsung.com>2015-12-22 19:42:08 +0900
commit3d9a51a47d6cf40341b07a7928dbdc969b98f263 (patch)
tree8ccd1486323b9d47a7a366138836453d7273c4e2 /src
parent0d5cbf02062e400e138cfd5cef05e80ba6af9b57 (diff)
downloadlibtdm-drm-3d9a51a47d6cf40341b07a7928dbdc969b98f263.tar.gz
libtdm-drm-3d9a51a47d6cf40341b07a7928dbdc969b98f263.tar.bz2
libtdm-drm-3d9a51a47d6cf40341b07a7928dbdc969b98f263.zip
change buffer type from tdm_buffer to tbm_surface
Change-Id: Ifd4a8874ed384d5249e5eca9ab143bed343f8ec3
Diffstat (limited to 'src')
-rw-r--r--src/tdm_drm.h2
-rw-r--r--src/tdm_drm_display.c22
2 files changed, 11 insertions, 13 deletions
diff --git a/src/tdm_drm.h b/src/tdm_drm.h
index 41245ab..a354417 100644
--- a/src/tdm_drm.h
+++ b/src/tdm_drm.h
@@ -44,7 +44,7 @@ tdm_error drm_layer_set_property(tdm_layer *layer, unsigned int id, tdm_value
tdm_error drm_layer_get_property(tdm_layer *layer, unsigned int id, tdm_value *value);
tdm_error drm_layer_set_info(tdm_layer *layer, tdm_info_layer *info);
tdm_error drm_layer_get_info(tdm_layer *layer, tdm_info_layer *info);
-tdm_error drm_layer_set_buffer(tdm_layer *layer, tdm_buffer *buffer);
+tdm_error drm_layer_set_buffer(tdm_layer *layer, tbm_surface_h buffer);
tdm_error drm_layer_unset_buffer(tdm_layer *layer);
/* drm module internal macros, structures, functions */
diff --git a/src/tdm_drm_display.c b/src/tdm_drm_display.c
index 777b2a6..3b72fc9 100644
--- a/src/tdm_drm_display.c
+++ b/src/tdm_drm_display.c
@@ -23,7 +23,7 @@ typedef struct _tdm_drm_display_buffer
struct list_head link;
unsigned int fb_id;
- tdm_buffer *buffer;
+ tbm_surface_h buffer;
int width;
} tdm_drm_display_buffer;
@@ -117,7 +117,7 @@ _tdm_drm_display_get_mode(tdm_drm_output_data *output_data)
}
static tdm_drm_display_buffer*
-_tdm_drm_display_find_buffer(tdm_drm_data *drm_data, tdm_buffer *buffer)
+_tdm_drm_display_find_buffer(tdm_drm_data *drm_data, tbm_surface_h buffer)
{
tdm_drm_display_buffer *display_buffer;
@@ -498,7 +498,7 @@ _tdm_drm_display_create_layer_list(tdm_drm_data *drm_data)
}
static void
-_tdm_drm_display_cb_destroy_buffer(tdm_buffer *buffer, void *user_data)
+_tdm_drm_display_cb_destroy_buffer(tbm_surface_h buffer, void *user_data)
{
tdm_drm_data *drm_data;
tdm_drm_display_buffer *display_buffer;
@@ -1402,20 +1402,18 @@ drm_layer_get_info(tdm_layer *layer, tdm_info_layer *info)
}
tdm_error
-drm_layer_set_buffer(tdm_layer *layer, tdm_buffer *buffer)
+drm_layer_set_buffer(tdm_layer *layer, tbm_surface_h buffer)
{
tdm_drm_layer_data *layer_data = layer;
tdm_drm_data *drm_data;
tdm_drm_display_buffer *display_buffer;
tdm_error err = TDM_ERROR_NONE;
- tbm_surface_h surface;
int ret, i, count;
RETURN_VAL_IF_FAIL(layer_data, TDM_ERROR_INVALID_PARAMETER);
RETURN_VAL_IF_FAIL(buffer, TDM_ERROR_INVALID_PARAMETER);
drm_data = layer_data->drm_data;
- surface = tdm_buffer_get_surface(buffer);
display_buffer = _tdm_drm_display_find_buffer(drm_data, buffer);
if (!display_buffer)
@@ -1448,18 +1446,18 @@ drm_layer_set_buffer(tdm_layer *layer, tdm_buffer *buffer)
unsigned int offsets[4] = {0,};
unsigned int size;
- width = tbm_surface_get_width(surface);
- height = tbm_surface_get_height(surface);
- format = tbm_surface_get_format(surface);
- count = tbm_surface_internal_get_num_bos(surface);
+ width = tbm_surface_get_width(buffer);
+ height = tbm_surface_get_height(buffer);
+ format = tbm_surface_get_format(buffer);
+ count = tbm_surface_internal_get_num_bos(buffer);
for (i = 0; i < count; i++)
{
- tbm_bo bo = tbm_surface_internal_get_bo(surface, i);
+ tbm_bo bo = tbm_surface_internal_get_bo(buffer, i);
handles[i] = tbm_bo_get_handle(bo, TBM_DEVICE_DEFAULT).u32;
}
count = tbm_surface_internal_get_num_planes(format);
for (i = 0; i < count; i++)
- tbm_surface_internal_get_plane_data(surface, i, &size, &offsets[i], &pitches[i]);
+ tbm_surface_internal_get_plane_data(buffer, i, &size, &offsets[i], &pitches[i]);
ret = drmModeAddFB2(drm_data->drm_fd, width, height, format,
handles, pitches, offsets, &display_buffer->fb_id, 0);