#include "tdm_private.h"
static tdm_private_layer*
-_tdm_display_find_private_layer(tdm_private_output *private_output, tdm_layer *layer)
+_tdm_display_find_private_layer(tdm_private_output *private_output, tdm_layer *layer_backend)
{
tdm_private_layer *private_layer = NULL;
LIST_FOR_EACH_ENTRY(private_layer, &private_output->layer_list, link)
{
- if (private_layer->layer == layer)
+ if (private_layer->layer_backend == layer_backend)
return private_layer;
}
}
static tdm_private_output*
-_tdm_display_find_private_output(tdm_private_display *private_display, tdm_output *output)
+_tdm_display_find_private_output(tdm_private_display *private_display, tdm_output *output_backend)
{
tdm_private_output *private_output = NULL;
LIST_FOR_EACH_ENTRY(private_output, &private_display->output_list, link)
{
- if (private_output->output == output)
+ if (private_output->output_backend == output_backend)
return private_output;
}
}
static tdm_error
-_tdm_display_update_caps_layer(tdm_private_display *private_display, tdm_layer *layer, tdm_caps_layer *caps)
+_tdm_display_update_caps_layer(tdm_private_display *private_display,
+ tdm_layer *layer_backend, tdm_caps_layer *caps)
{
tdm_func_display *func_display = &private_display->func_display;
char buf[1024];
return TDM_ERROR_BAD_MODULE;
}
- ret = func_display->layer_get_capability(layer, caps);
+ ret = func_display->layer_get_capability(layer_backend, caps);
if (ret != TDM_ERROR_NONE)
{
TDM_ERR("layer_get_capability() failed");
}
static tdm_error
-_tdm_display_update_caps_output(tdm_private_display *private_display, tdm_output *output, tdm_caps_output *caps)
+_tdm_display_update_caps_output(tdm_private_display *private_display,
+ tdm_output *output_backend, tdm_caps_output *caps)
{
tdm_func_display *func_display = &private_display->func_display;
int i;
return TDM_ERROR_BAD_MODULE;
}
- ret = func_display->output_get_capability(output, caps);
+ ret = func_display->output_get_capability(output_backend, caps);
if (ret != TDM_ERROR_NONE)
{
TDM_ERR("output_get_capability() failed");
static tdm_error
_tdm_display_update_layer(tdm_private_display *private_display,
tdm_private_output *private_output,
- tdm_layer *layer)
+ tdm_layer *layer_backend)
{
tdm_private_layer *private_layer;
tdm_error ret;
- private_layer = _tdm_display_find_private_layer(private_output, layer);
+ private_layer = _tdm_display_find_private_layer(private_output, layer_backend);
if (!private_layer)
{
private_layer = calloc(1, sizeof(tdm_private_layer));
private_layer->func_display = &private_display->func_display;
private_layer->private_display = private_display;
private_layer->private_output = private_output;
- private_layer->layer = layer;
+ private_layer->layer_backend = layer_backend;
LIST_INITHEAD(&private_layer->capture_list);
else
_tdm_display_destroy_caps_layer(&private_layer->caps);
- ret = _tdm_display_update_caps_layer(private_display, layer, &private_layer->caps);
+ ret = _tdm_display_update_caps_layer(private_display, layer_backend, &private_layer->caps);
if (ret != TDM_ERROR_NONE)
goto failed_update;
}
static tdm_error
-_tdm_display_update_output(tdm_private_display *private_display, tdm_output *output, int pipe)
+_tdm_display_update_output(tdm_private_display *private_display,
+ tdm_output *output_backend, int pipe)
{
tdm_func_display *func_display = &private_display->func_display;
tdm_private_output *private_output = NULL;
int layer_count = 0, i;
tdm_error ret;
- private_output = _tdm_display_find_private_output(private_display, output);
+ private_output = _tdm_display_find_private_output(private_display, output_backend);
if (!private_output)
{
private_output = calloc(1, sizeof(tdm_private_output));
LIST_ADD(&private_output->link, &private_display->output_list);
private_output->func_display = func_display;
private_output->private_display = private_display;
- private_output->output = output;
+ private_output->output_backend = output_backend;
private_output->pipe = pipe;
LIST_INITHEAD(&private_output->layer_list);
else
_tdm_display_destroy_caps_output(&private_output->caps);
- ret = _tdm_display_update_caps_output(private_display, output, &private_output->caps);
+ ret = _tdm_display_update_caps_output(private_display, output_backend, &private_output->caps);
if (ret != TDM_ERROR_NONE)
return ret;
- layers = func_display->output_get_layers(output, &layer_count, &ret);
+ layers = func_display->output_get_layers(output_backend, &layer_count, &ret);
if (ret != TDM_ERROR_NONE)
goto failed_update;
func_capture = private_capture->func_capture
static void
-_tdm_caputre_cb_done(tdm_capture *capture, tbm_surface_h buffer, void *user_data)
+_tdm_caputre_cb_done(tdm_capture *capture_backend, tbm_surface_h buffer, void *user_data)
{
tdm_buffer_unref_backend(tdm_buffer_get(buffer));
}
tdm_func_display *func_display;
tdm_func_capture *func_capture;
tdm_private_capture *private_capture = NULL;
- tdm_capture *capture = NULL;
+ tdm_capture *capture_backend = NULL;
tdm_error ret = TDM_ERROR_NONE;
private_display = private_output->private_display;
return NULL;
}
- capture = func_display->output_create_capture(private_output->output, &ret);
+ capture_backend = func_display->output_create_capture(private_output->output_backend, &ret);
if (ret != TDM_ERROR_NONE)
{
if (error)
if (!private_capture)
{
TDM_ERR("failed: alloc memory");
- func_capture->capture_destroy(capture);
+ func_capture->capture_destroy(capture_backend);
if (error)
*error = TDM_ERROR_OUT_OF_MEMORY;
return NULL;
}
- ret = func_capture->capture_set_done_handler(capture, _tdm_caputre_cb_done, private_capture);
+ ret = func_capture->capture_set_done_handler(capture_backend, _tdm_caputre_cb_done, private_capture);
if (ret != TDM_ERROR_NONE)
{
TDM_ERR("set capture_done_handler failed");
- func_capture->capture_destroy(capture);
+ func_capture->capture_destroy(capture_backend);
if (error)
*error = ret;
return NULL;
private_capture->private_display = private_display;
private_capture->private_output = private_output;
private_capture->private_layer = NULL;
- private_capture->capture = capture;
+ private_capture->capture_backend = capture_backend;
if (error)
*error = TDM_ERROR_NONE;
tdm_func_display *func_display;
tdm_func_capture *func_capture;
tdm_private_capture *private_capture = NULL;
- tdm_capture *capture = NULL;
+ tdm_capture *capture_backend = NULL;
tdm_error ret = TDM_ERROR_NONE;
private_output = private_layer->private_output;
return NULL;
}
- capture = func_display->layer_create_capture(private_layer->layer, &ret);
+ capture_backend = func_display->layer_create_capture(private_layer->layer_backend, &ret);
if (ret != TDM_ERROR_NONE)
return NULL;
if (!private_capture)
{
TDM_ERR("failed: alloc memory");
- func_capture->capture_destroy(capture);
+ func_capture->capture_destroy(capture_backend);
if (error)
*error = TDM_ERROR_OUT_OF_MEMORY;
return NULL;
private_capture->private_display = private_display;
private_capture->private_output = private_output;
private_capture->private_layer = private_layer;
- private_capture->capture = capture;
+ private_capture->capture_backend = capture_backend;
if (error)
*error = TDM_ERROR_NONE;
LIST_DEL(&private_capture->link);
func_capture = private_capture->func_capture;
- func_capture->capture_destroy(private_capture->capture);
+ func_capture->capture_destroy(private_capture->capture_backend);
free(private_capture);
}
EXTERN void
tdm_capture_destroy(tdm_capture *capture)
{
+ tdm_private_capture *private_capture = capture;
tdm_private_display *private_display;
- tdm_private_capture *private_capture;
- if (!capture)
+ if (!private_capture)
return;
- private_capture = (tdm_private_capture*)capture;
private_display = private_capture->private_display;
pthread_mutex_lock(&private_display->lock);
return TDM_ERROR_NONE;
}
- ret = func_capture->capture_set_info(private_capture->capture, info);
+ ret = func_capture->capture_set_info(private_capture->capture_backend, info);
pthread_mutex_unlock(&private_display->lock);
}
tdm_buffer_ref_backend(buffer);
- ret = func_capture->capture_attach(private_capture->capture,
+ ret = func_capture->capture_attach(private_capture->capture_backend,
tdm_buffer_get_surface(buffer));
pthread_mutex_unlock(&private_display->lock);
return TDM_ERROR_NONE;
}
- ret = func_capture->capture_commit(private_capture->capture);
+ ret = func_capture->capture_commit(private_capture->capture_backend);
pthread_mutex_unlock(&private_display->lock);
}
EXTERN tdm_error
-tdm_display_get_pp_available_size(tdm_display *dpy, int *min_w, int *min_h, int *max_w, int *max_h, int *preferred_align)
+tdm_display_get_pp_available_size(tdm_display *dpy, int *min_w, int *min_h,
+ int *max_w, int *max_h, int *preferred_align)
{
DISPLAY_FUNC_ENTRY();
}
EXTERN tdm_error
-tdm_output_get_available_size(tdm_output *output, int *min_w, int *min_h, int *max_w, int *max_h, int *preferred_align)
+tdm_output_get_available_size(tdm_output *output, int *min_w, int *min_h,
+ int *max_w, int *max_h, int *preferred_align)
{
OUTPUT_FUNC_ENTRY();
return TDM_ERROR_NONE;
}
- ret = func_display->output_set_property(private_output->output, id, value);
+ ret = func_display->output_set_property(private_output->output_backend, id, value);
pthread_mutex_unlock(&private_display->lock);
return TDM_ERROR_NONE;
}
- ret = func_display->output_get_property(private_output->output, id, value);
+ ret = func_display->output_get_property(private_output->output_backend, id, value);
pthread_mutex_unlock(&private_display->lock);
}
static void
-_tdm_output_cb_vblank(tdm_output *output, unsigned int sequence,
+_tdm_output_cb_vblank(tdm_output *output_backend, unsigned int sequence,
unsigned int tv_sec, unsigned int tv_usec, void *user_data)
{
tdm_private_output *private_output;
private_display = private_output->private_display;
LIST_FOR_EACH_ENTRY(private_output, &private_display->output_list, link)
{
- if (private_output->output == output)
+ if (private_output->output_backend == output_backend)
private_display_backend = private_output->private_display;
}
pthread_mutex_unlock(&private_display_backend->lock);
if (vblank_handler->func)
- vblank_handler->func(vblank_handler->private_output, sequence, tv_sec, tv_usec, vblank_handler->user_data);
+ vblank_handler->func(vblank_handler->private_output, sequence,
+ tv_sec, tv_usec, vblank_handler->user_data);
pthread_mutex_lock(&private_display_backend->lock);
}
static void
-_tdm_output_cb_commit(tdm_output *output, unsigned int sequence,
+_tdm_output_cb_commit(tdm_output *output_backend, unsigned int sequence,
unsigned int tv_sec, unsigned int tv_usec, void *user_data)
{
tdm_private_output *private_output;
private_display = private_output->private_display;
LIST_FOR_EACH_ENTRY(private_output, &private_display->output_list, link)
{
- if (private_output->output == output)
+ if (private_output->output_backend == output_backend)
private_display_backend = private_output->private_display;
}
pthread_mutex_unlock(&private_display_backend->lock);
if (commit_handler->func)
- commit_handler->func(commit_handler->private_output, sequence, tv_sec, tv_usec, commit_handler->user_data);
+ commit_handler->func(commit_handler->private_output, sequence,
+ tv_sec, tv_usec, commit_handler->user_data);
pthread_mutex_lock(&private_display_backend->lock);
}
EXTERN tdm_error
-tdm_output_wait_vblank(tdm_output *output, int interval, int sync, tdm_output_vblank_handler func, void *user_data)
+tdm_output_wait_vblank(tdm_output *output, int interval, int sync,
+ tdm_output_vblank_handler func, void *user_data)
{
tdm_func_display *func_display;
tdm_private_vblank_handler *vblank_handler;
vblank_handler->func = func;
vblank_handler->user_data = user_data;
- ret = func_display->output_wait_vblank(private_output->output, interval, sync, vblank_handler);
+ ret = func_display->output_wait_vblank(private_output->output_backend, interval,
+ sync, vblank_handler);
if (ret != TDM_ERROR_NONE)
{
pthread_mutex_unlock(&private_display->lock);
if (!private_output->regist_vblank_cb)
{
private_output->regist_vblank_cb = 1;
- ret = func_display->output_set_vblank_handler(private_output->output, _tdm_output_cb_vblank);
+ ret = func_display->output_set_vblank_handler(private_output->output_backend,
+ _tdm_output_cb_vblank);
}
pthread_mutex_unlock(&private_display->lock);
commit_handler->func = func;
commit_handler->user_data = user_data;
- ret = func_display->output_commit(private_output->output, sync, commit_handler);
+ ret = func_display->output_commit(private_output->output_backend, sync, commit_handler);
if (ret != TDM_ERROR_NONE)
{
pthread_mutex_unlock(&private_display->lock);
if (!private_output->regist_commit_cb)
{
private_output->regist_commit_cb = 1;
- ret = func_display->output_set_commit_handler(private_output->output, _tdm_output_cb_commit);
+ ret = func_display->output_set_commit_handler(private_output->output_backend,
+ _tdm_output_cb_commit);
}
pthread_mutex_unlock(&private_display->lock);
return TDM_ERROR_NONE;
}
- ret = func_display->output_set_mode(private_output->output, mode);
+ ret = func_display->output_set_mode(private_output->output_backend, mode);
pthread_mutex_unlock(&private_display->lock);
return TDM_ERROR_NONE;
}
- ret = func_display->output_get_mode(private_output->output, mode);
+ ret = func_display->output_get_mode(private_output->output_backend, mode);
pthread_mutex_unlock(&private_display->lock);
return TDM_ERROR_NONE;
}
- ret = func_display->output_set_dpms(private_output->output, dpms_value);
+ ret = func_display->output_set_dpms(private_output->output_backend, dpms_value);
pthread_mutex_unlock(&private_display->lock);
return TDM_ERROR_NONE;
}
- ret = func_display->output_get_dpms(private_output->output, dpms_value);
+ ret = func_display->output_get_dpms(private_output->output_backend, dpms_value);
pthread_mutex_unlock(&private_display->lock);
return TDM_ERROR_NONE;
}
- ret = func_display->layer_set_property(private_layer->layer, id, value);
+ ret = func_display->layer_set_property(private_layer->layer_backend, id, value);
pthread_mutex_unlock(&private_display->lock);
return TDM_ERROR_NONE;
}
- ret = func_display->layer_get_property(private_layer->layer, id, value);
+ ret = func_display->layer_get_property(private_layer->layer_backend, id, value);
pthread_mutex_unlock(&private_display->lock);
return TDM_ERROR_NONE;
}
- ret = func_display->layer_set_info(private_layer->layer, info);
+ ret = func_display->layer_set_info(private_layer->layer_backend, info);
pthread_mutex_unlock(&private_display->lock);
return TDM_ERROR_NONE;
}
- ret = func_display->layer_get_info(private_layer->layer, info);
+ ret = func_display->layer_get_info(private_layer->layer_backend, info);
pthread_mutex_unlock(&private_display->lock);
private_layer->current_buffer = tdm_buffer_ref(buffer, NULL);
tdm_buffer_ref_backend(buffer);
- ret = func_display->layer_set_buffer(private_layer->layer,
+ ret = func_display->layer_set_buffer(private_layer->layer_backend,
tdm_buffer_get_surface(buffer));
pthread_mutex_unlock(&private_display->lock);
return TDM_ERROR_NONE;
}
- ret = func_display->layer_unset_buffer(private_layer->layer);
+ ret = func_display->layer_unset_buffer(private_layer->layer_backend);
pthread_mutex_unlock(&private_display->lock);
func_pp = private_pp->func_pp
static void
-_tdm_pp_cb_done(tdm_pp *pp, tbm_surface_h src, tbm_surface_h dst, void *user_data)
+_tdm_pp_cb_done(tdm_pp *pp_backend, tbm_surface_h src, tbm_surface_h dst, void *user_data)
{
tdm_buffer_unref_backend(tdm_buffer_get(src));
tdm_buffer_unref_backend(tdm_buffer_get(dst));
tdm_func_display *func_display;
tdm_func_pp *func_pp;
tdm_private_pp *private_pp = NULL;
- tdm_pp *pp = NULL;
+ tdm_pp *pp_backend = NULL;
tdm_error ret = TDM_ERROR_NONE;
func_display = &private_display->func_display;
return NULL;
}
- pp = func_display->display_create_pp(private_display->bdata, &ret);
+ pp_backend = func_display->display_create_pp(private_display->bdata, &ret);
if (ret != TDM_ERROR_NONE)
{
if (error)
if (!private_pp)
{
TDM_ERR("failed: alloc memory");
- func_pp->pp_destroy(pp);
+ func_pp->pp_destroy(pp_backend);
if (error)
*error = TDM_ERROR_OUT_OF_MEMORY;
return NULL;
}
- ret = func_pp->pp_set_done_handler(pp, _tdm_pp_cb_done, private_pp);
+ ret = func_pp->pp_set_done_handler(pp_backend, _tdm_pp_cb_done, private_pp);
if (ret != TDM_ERROR_NONE)
{
TDM_ERR("set pp_done_handler failed");
- func_pp->pp_destroy(pp);
+ func_pp->pp_destroy(pp_backend);
if (error)
*error = ret;
return NULL;
LIST_ADD(&private_pp->link, &private_display->pp_list);
private_pp->func_pp = func_pp;
private_pp->private_display = private_display;
- private_pp->pp = pp;
+ private_pp->pp_backend = pp_backend;
if (error)
*error = TDM_ERROR_NONE;
LIST_DEL(&private_pp->link);
- func_pp->pp_destroy(private_pp->pp);
+ func_pp->pp_destroy(private_pp->pp_backend);
free(private_pp);
}
EXTERN void
tdm_pp_destroy(tdm_pp *pp)
{
+ tdm_private_pp *private_pp = pp;
tdm_private_display *private_display;
- tdm_private_pp *private_pp;
- if (!pp)
+ if (!private_pp)
return;
- private_pp = (tdm_private_pp*)pp;
private_display = private_pp->private_display;
pthread_mutex_lock(&private_display->lock);
return TDM_ERROR_NONE;
}
- ret = func_pp->pp_set_info(private_pp->pp, info);
+ ret = func_pp->pp_set_info(private_pp->pp_backend, info);
pthread_mutex_unlock(&private_display->lock);
tdm_buffer_ref_backend(src);
tdm_buffer_ref_backend(dst);
- ret = func_pp->pp_attach(private_pp->pp,
+ ret = func_pp->pp_attach(private_pp->pp_backend,
tdm_buffer_get_surface(src),
tdm_buffer_get_surface(dst));
return TDM_ERROR_NONE;
}
- ret = func_pp->pp_commit(private_pp->pp);
+ ret = func_pp->pp_commit(private_pp->pp_backend);
pthread_mutex_unlock(&private_display->lock);
tdm_private_display *private_display;
tdm_caps_output caps;
- tdm_output *output;
+ tdm_output *output_backend;
unsigned int pipe;
tdm_private_output *private_output;
tdm_caps_layer caps;
- tdm_layer *layer;
+ tdm_layer *layer_backend;
tdm_buffer *current_buffer;
tdm_func_pp *func_pp;
tdm_private_display *private_display;
- tdm_pp *pp;
+ tdm_pp *pp_backend;
};
struct _tdm_private_capture
tdm_private_output *private_output;
tdm_private_layer *private_layer;
- tdm_capture *capture;
+ tdm_capture *capture_backend;
};
struct _tdm_private_vblank_handler