/**************************************************************************
-
-libtdm
-
-Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
-
-Contact: Eunchul Kim <chulspro.kim@samsung.com>,
- JinYoung Jeon <jy0.jeon@samsung.com>,
- Taeheon Kim <th908.kim@samsung.com>,
- YoungJun Cho <yj44.cho@samsung.com>,
- SooChan Lim <sc1.lim@samsung.com>,
- Boram Park <sc1.lim@samsung.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+ *
+ * libtdm
+ *
+ * Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
+ *
+ * Contact: Eunchul Kim <chulspro.kim@samsung.com>,
+ * JinYoung Jeon <jy0.jeon@samsung.com>,
+ * Taeheon Kim <th908.kim@samsung.com>,
+ * YoungJun Cho <yj44.cho@samsung.com>,
+ * SooChan Lim <sc1.lim@samsung.com>,
+ * Boram Park <sc1.lim@samsung.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
**************************************************************************/
#ifdef HAVE_CONFIG_H
static void
_tdm_client_cb_global(void *data, struct wl_registry *registry,
- uint32_t name, const char *interface,
- uint32_t version)
+ uint32_t name, const char *interface,
+ uint32_t version)
{
tdm_private_client *private_client = data;
{
}
-static const struct wl_registry_listener tdm_client_registry_listener =
-{
- _tdm_client_cb_global,
- _tdm_client_cb_global_remove
+static const struct wl_registry_listener tdm_client_registry_listener = {
+ _tdm_client_cb_global,
+ _tdm_client_cb_global_remove
};
tdm_client*
if (debug && (strstr(debug, "1")))
tdm_debug = 1;
- private_client = calloc(1, sizeof *private_client);
+ private_client = calloc(1, sizeof * private_client);
if (!private_client) {
TDM_ERR("alloc failed");
if (error)
TDM_GOTO_IF_FAIL(private_client->registry != NULL, create_failed);
wl_registry_add_listener(private_client->registry,
- &tdm_client_registry_listener, private_client);
+ &tdm_client_registry_listener, private_client);
wl_display_roundtrip(private_client->display);
/* check global objects */
static void
_tdm_client_cb_vblank_done(void *data, struct wl_tdm_vblank *vblank,
- uint32_t sequence, uint32_t tv_sec, uint32_t tv_usec)
+ uint32_t sequence, uint32_t tv_sec, uint32_t tv_usec)
{
tdm_client_vblank_info *vblank_info = (tdm_client_vblank_info*)data;
TDM_NEVER_GET_HERE();
TDM_DBG("vblank_info(%p) wl_tbm_vblank@%d", vblank_info,
- wl_proxy_get_id((struct wl_proxy *)vblank));
+ wl_proxy_get_id((struct wl_proxy *)vblank));
- if (vblank_info->func) {
+ if (vblank_info->func)
vblank_info->func(sequence, tv_sec, tv_usec, vblank_info->user_data);
- }
if (vblank_info->need_free) {
LIST_DEL(&vblank_info->link);
tdm_client_error
tdm_client_wait_vblank(tdm_client *client, char *name,
- int sw_timer, int interval, int sync,
- tdm_client_vblank_handler func, void *user_data)
+ int sw_timer, int interval, int sync,
+ tdm_client_vblank_handler func, void *user_data)
{
tdm_private_client *private_client = (tdm_private_client*)client;
tdm_client_vblank_info *vblank_info;
TDM_RETURN_VAL_IF_FAIL(private_client != NULL, TDM_CLIENT_ERROR_INVALID_PARAMETER);
TDM_RETURN_VAL_IF_FAIL(private_client->tdm_client != NULL, TDM_CLIENT_ERROR_INVALID_PARAMETER);
- vblank_info = calloc(1, sizeof *vblank_info);
+ vblank_info = calloc(1, sizeof * vblank_info);
if (!vblank_info) {
TDM_ERR("alloc failed");
return TDM_CLIENT_ERROR_OUT_OF_MEMORY;
clock_gettime(CLOCK_MONOTONIC, &tp);
vblank_info->req_sec = (unsigned int)tp.tv_sec;
- vblank_info->req_usec = (unsigned int)(tp.tv_nsec/1000);
+ vblank_info->req_usec = (unsigned int)(tp.tv_nsec / 1000);
vblank_info->need_free = (sync) ? 0 : 1;
vblank_info->vblank =
wl_tdm_client_wait_vblank(private_client->tdm_client,
- name, sw_timer, interval,
- vblank_info->req_sec, vblank_info->req_usec);
+ name, sw_timer, interval,
+ vblank_info->req_sec, vblank_info->req_usec);
if (!vblank_info->vblank) {
TDM_ERR("couldn't create vblank resource");
free(vblank_info);
}
TDM_DBG("vblank_info(%p) wl_tbm_vblank@%d", vblank_info,
- wl_proxy_get_id((struct wl_proxy *)vblank_info->vblank));
+ wl_proxy_get_id((struct wl_proxy *)vblank_info->vblank));
wl_tdm_vblank_add_listener(vblank_info->vblank,
- &tdm_client_vblank_listener, vblank_info);
+ &tdm_client_vblank_listener, vblank_info);
vblank_info->func = func;
vblank_info->user_data = user_data;
clock_gettime(CLOCK_MONOTONIC, &tp);
TDM_DBG("block during %d us",
- ((unsigned int)(tp.tv_sec * 1000000) + (unsigned int)(tp.tv_nsec/1000))
- - (vblank_info->req_sec * 1000000 + vblank_info->req_usec));
+ ((unsigned int)(tp.tv_sec * 1000000) + (unsigned int)(tp.tv_nsec / 1000))
+ - (vblank_info->req_sec * 1000000 + vblank_info->req_usec));
LIST_DEL(&vblank_info->link);
free(vblank_info);
/**************************************************************************
-
-libtdm
-
-Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
-
-Contact: Eunchul Kim <chulspro.kim@samsung.com>,
- JinYoung Jeon <jy0.jeon@samsung.com>,
- Taeheon Kim <th908.kim@samsung.com>,
- YoungJun Cho <yj44.cho@samsung.com>,
- SooChan Lim <sc1.lim@samsung.com>,
- Boram Park <sc1.lim@samsung.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+ *
+ * libtdm
+ *
+ * Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
+ *
+ * Contact: Eunchul Kim <chulspro.kim@samsung.com>,
+ * JinYoung Jeon <jy0.jeon@samsung.com>,
+ * Taeheon Kim <th908.kim@samsung.com>,
+ * YoungJun Cho <yj44.cho@samsung.com>,
+ * SooChan Lim <sc1.lim@samsung.com>,
+ * Boram Park <sc1.lim@samsung.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
**************************************************************************/
#ifndef _TDM_CLIENT_H_
* @brief The header file for a client of TDM.
* @par Example
* @code
- #include <tdm_client.h> //for a client of TDM
+ * #include <tdm_client.h> //for a client of TDM
* @endcode
*/
/**
* @brief The client error enumeration
*/
-typedef enum
-{
+typedef enum {
TDM_CLIENT_ERROR_NONE = 0, /**< none */
TDM_CLIENT_ERROR_OPERATION_FAILED = -1, /**< operaion failed */
TDM_CLIENT_ERROR_INVALID_PARAMETER = -2, /**< wrong input parameter */
*/
typedef void
(*tdm_client_vblank_handler)(unsigned int sequence, unsigned int tv_sec,
- unsigned int tv_usec, void *user_data);
+ unsigned int tv_usec, void *user_data);
/**
* @brief Create a TDM client object.
* @see #tdm_client_handle_events
* @par Example
* @code
- #include <tdm_client.h> //for a client of TDM
-
- err = tdm_client_get_fd(client, &fd);
- if (err != TDM_CLIENT_ERROR_NONE) {
- //error handling
- }
-
- fds.events = POLLIN;
- fds.fd = fd;
- fds.revents = 0;
-
- while(1) {
- ret = poll(&fds, 1, -1);
- if (ret < 0) {
- if (errno == EBUSY)
- continue;
- else {
- //error handling
- }
- }
-
- err = tdm_client_handle_events(client);
- if (err != TDM_CLIENT_ERROR_NONE) {
- //error handling
- }
- }
+ * #include <tdm_client.h> //for a client of TDM
+ *
+ * err = tdm_client_get_fd(client, &fd);
+ * if (err != TDM_CLIENT_ERROR_NONE) {
+ * //error handling
+ * }
+ *
+ * fds.events = POLLIN;
+ * fds.fd = fd;
+ * fds.revents = 0;
+ *
+ * while(1) {
+ * ret = poll(&fds, 1, -1);
+ * if (ret < 0) {
+ * if (errno == EBUSY)
+ * continue;
+ * else {
+ * //error handling
+ * }
+ * }
+ *
+ * err = tdm_client_handle_events(client);
+ * if (err != TDM_CLIENT_ERROR_NONE) {
+ * //error handling
+ * }
+ * }
* @endcode
*/
tdm_client_error
*/
tdm_client_error
tdm_client_wait_vblank(tdm_client *client, char *name,
- int sw_timer, int interval, int sync,
- tdm_client_vblank_handler func, void *user_data);
+ int sw_timer, int interval, int sync,
+ tdm_client_vblank_handler func, void *user_data);
#ifdef __cplusplus
}
/**************************************************************************
-
-libtdm
-
-Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
-
-Contact: Eunchul Kim <chulspro.kim@samsung.com>,
- JinYoung Jeon <jy0.jeon@samsung.com>,
- Taeheon Kim <th908.kim@samsung.com>,
- YoungJun Cho <yj44.cho@samsung.com>,
- SooChan Lim <sc1.lim@samsung.com>,
- Boram Park <sc1.lim@samsung.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+ *
+ * libtdm
+ *
+ * Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
+ *
+ * Contact: Eunchul Kim <chulspro.kim@samsung.com>,
+ * JinYoung Jeon <jy0.jeon@samsung.com>,
+ * Taeheon Kim <th908.kim@samsung.com>,
+ * YoungJun Cho <yj44.cho@samsung.com>,
+ * SooChan Lim <sc1.lim@samsung.com>,
+ * Boram Park <sc1.lim@samsung.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
**************************************************************************/
#ifndef _TDM_DOC_H_
* #tdm_backend_register_func_display(), #tdm_backend_register_func_output(),
* #tdm_backend_register_func_layer() functions in initial time.\n
* @code
- #include <tdm_backend.h>
-
- static tdm_drm_data *drm_data;
-
- tdm_backend_data*
- tdm_drm_init(tdm_display *dpy, tdm_error *error)
- {
- tdm_func_display drm_func_display;
- tdm_func_output drm_func_output;
- tdm_func_layer drm_func_layer;
-
- ...
- drm_data = calloc(1, sizeof(tdm_drm_data));
- ...
-
- memset(&drm_func_display, 0, sizeof(drm_func_display));
- drm_func_display.display_get_capabilitiy = drm_display_get_capabilitiy;
- ...
- ret = tdm_backend_register_func_display(dpy, &drm_func_display);
- if (ret != TDM_ERROR_NONE)
- goto failed;
-
- memset(&drm_func_output, 0, sizeof(drm_func_output));
- drm_func_output.output_get_capability = drm_output_get_capability;
- ...
- ret = tdm_backend_register_func_output(dpy, &drm_func_output);
- if (ret != TDM_ERROR_NONE)
- goto failed;
-
- memset(&drm_func_layer, 0, sizeof(drm_func_layer));
- drm_func_layer.layer_get_capability = drm_layer_get_capability;
- ...
- ret = tdm_backend_register_func_layer(dpy, &drm_func_layer);
- if (ret != TDM_ERROR_NONE)
- goto failed;
- ...
- return (tdm_backend_data*)drm_data;
- }
-
- void
- tdm_drm_deinit(tdm_backend_data *bdata)
- {
- ...
- free(bdata);
- }
-
- tdm_backend_module tdm_backend_module_data =
- {
- "drm",
- "Samsung",
- TDM_BACKEND_SET_ABI_VERSION(1,2),
- tdm_drm_init,
- tdm_drm_deinit
- };
+ * #include <tdm_backend.h>
+ *
+ * static tdm_drm_data *drm_data;
+ *
+ * tdm_backend_data*
+ * tdm_drm_init(tdm_display *dpy, tdm_error *error)
+ * {
+ * tdm_func_display drm_func_display;
+ * tdm_func_output drm_func_output;
+ * tdm_func_layer drm_func_layer;
+ *
+ * ...
+ * drm_data = calloc(1, sizeof(tdm_drm_data));
+ * ...
+ *
+ * memset(&drm_func_display, 0, sizeof(drm_func_display));
+ * drm_func_display.display_get_capabilitiy = drm_display_get_capabilitiy;
+ * ...
+ * ret = tdm_backend_register_func_display(dpy, &drm_func_display);
+ * if (ret != TDM_ERROR_NONE)
+ * goto failed;
+ *
+ * memset(&drm_func_output, 0, sizeof(drm_func_output));
+ * drm_func_output.output_get_capability = drm_output_get_capability;
+ * ...
+ * ret = tdm_backend_register_func_output(dpy, &drm_func_output);
+ * if (ret != TDM_ERROR_NONE)
+ * goto failed;
+ *
+ * memset(&drm_func_layer, 0, sizeof(drm_func_layer));
+ * drm_func_layer.layer_get_capability = drm_layer_get_capability;
+ * ...
+ * ret = tdm_backend_register_func_layer(dpy, &drm_func_layer);
+ * if (ret != TDM_ERROR_NONE)
+ * goto failed;
+ * ...
+ * return (tdm_backend_data*)drm_data;
+ * }
+ *
+ * void
+ * tdm_drm_deinit(tdm_backend_data *bdata)
+ * {
+ * ...
+ * free(bdata);
+ * }
+ *
+ * tdm_backend_module tdm_backend_module_data =
+ * {
+ * "drm",
+ * "Samsung",
+ * TDM_BACKEND_SET_ABI_VERSION(1,2),
+ * tdm_drm_init,
+ * tdm_drm_deinit
+ * };
* @endcode
* \n
* A sample backend source code can be downloaded.
/**************************************************************************
-
-libtdm
-
-Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
-
-Contact: Eunchul Kim <chulspro.kim@samsung.com>,
- JinYoung Jeon <jy0.jeon@samsung.com>,
- Taeheon Kim <th908.kim@samsung.com>,
- YoungJun Cho <yj44.cho@samsung.com>,
- SooChan Lim <sc1.lim@samsung.com>,
- Boram Park <sc1.lim@samsung.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+ *
+ * libtdm
+ *
+ * Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
+ *
+ * Contact: Eunchul Kim <chulspro.kim@samsung.com>,
+ * JinYoung Jeon <jy0.jeon@samsung.com>,
+ * Taeheon Kim <th908.kim@samsung.com>,
+ * YoungJun Cho <yj44.cho@samsung.com>,
+ * SooChan Lim <sc1.lim@samsung.com>,
+ * Boram Park <sc1.lim@samsung.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
**************************************************************************/
#ifndef _TDM_H_
* @brief The header file for a frontend user.
* @par Example
* @code
- #include <tdm.h> //for a frontend user
+ * #include <tdm.h> //for a frontend user
* @endcode
*/
/**
* @brief The display capability enumeration
*/
-typedef enum
-{
- TDM_DISPLAY_CAPABILITY_PP = (1<<0), /**< if hardware supports pp operation */
- TDM_DISPLAY_CAPABILITY_CAPTURE = (1<<1), /**< if hardware supports capture operation */
+typedef enum {
+ TDM_DISPLAY_CAPABILITY_PP = (1 << 0), /**< if hardware supports pp operation */
+ TDM_DISPLAY_CAPABILITY_CAPTURE = (1 << 1), /**< if hardware supports capture operation */
} tdm_display_capability;
/**
* changed in runtime.
*/
typedef void (*tdm_output_change_handler)(tdm_output *output,
- tdm_output_change_type type,
- tdm_value value,
- void *user_data);
+ tdm_output_change_type type,
+ tdm_value value,
+ void *user_data);
/**
* @brief Initialize a display object
*/
tdm_error
tdm_display_get_capabilities(tdm_display *dpy,
- tdm_display_capability *capabilities);
+ tdm_display_capability *capabilities);
/**
* @brief Get the pp capabilities of a display object.
*/
tdm_error
tdm_display_get_pp_capabilities(tdm_display *dpy,
- tdm_pp_capability *capabilities);
+ tdm_pp_capability *capabilities);
/**
* @brief Get the pp available format array of a display object.
*/
tdm_error
tdm_display_get_pp_available_formats(tdm_display *dpy,
- const tbm_format **formats, int *count);
+ const tbm_format **formats, int *count);
/**
* @brief Get the pp available size of a display object.
*/
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);
+ int *max_w, int *max_h, int *preferred_align);
/**
* @brief Get the capture capabilities of a display object.
*/
tdm_error
tdm_display_get_capture_capabilities(tdm_display *dpy,
- tdm_capture_capability *capabilities);
+ tdm_capture_capability *capabilities);
/**
* @brief Get the capture available format array of a display object.
*/
tdm_error
tdm_display_get_catpure_available_formats(tdm_display *dpy,
- const tbm_format **formats, int *count);
+ const tbm_format **formats, int *count);
/**
* @brief Get the output counts which a display object has.
*/
tdm_error
tdm_output_get_model_info(tdm_output *output, const char **maker,
- const char **model, const char **name);
+ const char **model, const char **name);
/**
* @brief Get the connection status of a output object.
*/
tdm_error
tdm_output_add_change_handler(tdm_output *output,
- tdm_output_change_handler func,
- void *user_data);
+ tdm_output_change_handler func,
+ void *user_data);
/**
* @brief Remove a output change handler
*/
void
tdm_output_remove_change_handler(tdm_output *output,
- tdm_output_change_handler func,
- void *user_data);
+ tdm_output_change_handler func,
+ void *user_data);
/**
* @brief Get the connection type of a output object.
*/
tdm_error
tdm_output_get_available_properties(tdm_output *output, const tdm_prop **props,
- int *count);
+ int *count);
/**
* @brief Get the available mode array of a output object.
*/
tdm_error
tdm_output_get_available_modes(tdm_output *output,
- const tdm_output_mode **modes, int *count);
+ const tdm_output_mode **modes, int *count);
/**
* @brief Get the available size of a output object.
*/
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);
+ int *max_w, int *max_h, int *preferred_align);
/**
* @brief Get the physical size of a output object.
*/
tdm_error
tdm_output_get_physical_size(tdm_output *output, unsigned int *mmWidth,
- unsigned int *mmHeight);
+ unsigned int *mmHeight);
/**
* @brief Get the subpixel of a output object.
*/
tdm_error
tdm_output_wait_vblank(tdm_output *output, int interval, int sync,
- tdm_output_vblank_handler func, void *user_data);
+ tdm_output_vblank_handler func, void *user_data);
/**
* @brief Commit changes for a output object
*/
tdm_error
tdm_output_commit(tdm_output *output, int sync, tdm_output_commit_handler func,
- void *user_data);
+ void *user_data);
/**
* @brief Set one of available modes of a output object
*/
tdm_error
tdm_layer_get_capabilities(tdm_layer *layer,
- tdm_layer_capability *capabilities);
+ tdm_layer_capability *capabilities);
/**
* @brief Get the available format array of a layer object.
*/
tdm_error
tdm_layer_get_available_formats(tdm_layer *layer, const tbm_format **formats,
- int *count);
+ int *count);
/**
* @brief Get the available property array of a layer object.
*/
tdm_error
tdm_layer_get_available_properties(tdm_layer *layer, const tdm_prop **props,
- int *count);
+ int *count);
/**
* @brief Get the zpos of a layer object.
* @see tdm_buffer_add_release_handler, tdm_buffer_remove_release_handler
*/
typedef void (*tdm_buffer_release_handler)(tbm_surface_h buffer,
- void *user_data);
+ void *user_data);
/**
* @brief Add a release handler to a TDM buffer
*/
tdm_error
tdm_buffer_add_release_handler(tbm_surface_h buffer,
- tdm_buffer_release_handler func, void *user_data);
+ tdm_buffer_release_handler func, void *user_data);
/**
* @brief Remove a release handler from a TDM buffer
*/
void
tdm_buffer_remove_release_handler(tbm_surface_h buffer,
- tdm_buffer_release_handler func, void *user_data);
+ tdm_buffer_release_handler func, void *user_data);
#ifdef __cplusplus
}
/**************************************************************************
-
-libtdm
-
-Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
-
-Contact: Eunchul Kim <chulspro.kim@samsung.com>,
- JinYoung Jeon <jy0.jeon@samsung.com>,
- Taeheon Kim <th908.kim@samsung.com>,
- YoungJun Cho <yj44.cho@samsung.com>,
- SooChan Lim <sc1.lim@samsung.com>,
- Boram Park <sc1.lim@samsung.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+ *
+ * libtdm
+ *
+ * Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
+ *
+ * Contact: Eunchul Kim <chulspro.kim@samsung.com>,
+ * JinYoung Jeon <jy0.jeon@samsung.com>,
+ * Taeheon Kim <th908.kim@samsung.com>,
+ * YoungJun Cho <yj44.cho@samsung.com>,
+ * SooChan Lim <sc1.lim@samsung.com>,
+ * Boram Park <sc1.lim@samsung.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
**************************************************************************/
#ifndef _TDM_BACKEND_H_
* @brief The backend header file of TDM to implement a TDM backend module.
* @par Example
* @code
- #include <tdm_backend.h>
+ * #include <tdm_backend.h>
* @endcode
*/
* changed in runtime.
*/
typedef void (*tdm_output_status_handler)(tdm_output *output,
- tdm_output_conn_status status,
- void *user_data);
+ tdm_output_conn_status status,
+ void *user_data);
/**
* @brief The display capabilities structure of a backend module
int max_h; /**< The maximum height. -1 means "not defined" */
int preferred_align; /**< The prefered align. -1 means "not defined" */
- int max_attach_count; /**< The attach count which a PP object can handle.
- * -1 means "not defined".
- * @since 1.2.0
- */
+ /**< The attach count which a PP object can handle.
+ * -1 means "not defined".
+ * @since 1.2.0
+ */
+ int max_attach_count;
} tdm_caps_pp;
/**
int max_h; /**< The maximum height. -1 means "not defined" */
int preferred_align; /**< The prefered align. -1 means "not defined" */
- int max_attach_count; /**< The attach count which a capture object can handle.
- * -1 means "not defined".
- * @since 1.2.0
- */
+ /**< The attach count which a capture object can handle.
+ * -1 means "not defined".
+ * @since 1.2.0
+ */
+ int max_attach_count;
} tdm_caps_capture;
/**
* a backend module can set the max count to max_layer_count of #tdm_caps_display
* structure. Otherwise, set -1.
*/
- tdm_error (*display_get_capabilitiy)(tdm_backend_data *bdata,
- tdm_caps_display *caps);
+ tdm_error (*display_get_capabilitiy)(tdm_backend_data *bdata, tdm_caps_display *caps);
/**
* @brief Get the pp capabilities of a backend module
* @b SHOULD fill the #tdm_caps_pp data. #tdm_caps_pp contains the hardware
* restriction information which a converting device can handle. ie, format, size, etc.
*/
- tdm_error (*display_get_pp_capability)(tdm_backend_data *bdata,
- tdm_caps_pp *caps);
+ tdm_error (*display_get_pp_capability)(tdm_backend_data *bdata, tdm_caps_pp *caps);
/**
* @brief Get the capture capabilities of a backend module
* #tdm_caps_capture data. #tdm_caps_capture contains the hardware restriction
* information which a capture device can handle. ie, format, size, etc.
*/
- tdm_error (*display_get_capture_capability)(tdm_backend_data *bdata,
- tdm_caps_capture *caps);
+ tdm_error (*display_get_capture_capability)(tdm_backend_data *bdata, tdm_caps_capture *caps);
/**
* @brief Get a output array of a backend module
* "tdm_output*" data. It will be freed in frontend.
* @par Example
* @code
- tdm_output**
- drm_display_get_outputs(tdm_backend_data *bdata, int *count, tdm_error *error)
- {
- tdm_drm_data *drm_data = bdata;
- tdm_drm_output_data *output_data = NULL;
- tdm_output **outputs;
- int i;
-
- (*count) = 0;
- LIST_FOR_EACH_ENTRY(output_data, &drm_data->output_list, link)
- (*count)++;
-
- if ((*count) == 0)
- {
- if (error) *error = TDM_ERROR_NONE;
- return NULL;
- }
-
- // will be freed in frontend
- outputs = calloc(*count, sizeof(tdm_drm_output_data*));
- if (!outputs)
- {
- (*count) = 0;
- if (error) *error = TDM_ERROR_OUT_OF_MEMORY;
- return NULL;
- }
-
- i = 0;
- LIST_FOR_EACH_ENTRY(output_data, &drm_data->output_list, link)
- outputs[i++] = output_data;
-
- if (error) *error = TDM_ERROR_NONE;
-
- return outputs;
- }
+ * tdm_output**
+ * drm_display_get_outputs(tdm_backend_data *bdata, int *count, tdm_error *error)
+ * {
+ * tdm_drm_data *drm_data = bdata;
+ * tdm_drm_output_data *output_data = NULL;
+ * tdm_output **outputs;
+ * int i;
+ *
+ * (*count) = 0;
+ * LIST_FOR_EACH_ENTRY(output_data, &drm_data->output_list, link)
+ * (*count)++;
+ *
+ * if ((*count) == 0)
+ * {
+ * if (error) *error = TDM_ERROR_NONE;
+ * return NULL;
+ * }
+ *
+ * // will be freed in frontend
+ * outputs = calloc(*count, sizeof(tdm_drm_output_data*));
+ * if (!outputs)
+ * {
+ * (*count) = 0;
+ * if (error) *error = TDM_ERROR_OUT_OF_MEMORY;
+ * return NULL;
+ * }
+ *
+ * i = 0;
+ * LIST_FOR_EACH_ENTRY(output_data, &drm_data->output_list, link)
+ * outputs[i++] = output_data;
+ *
+ * if (error) *error = TDM_ERROR_NONE;
+ *
+ * return outputs;
+ * }
* @endcode
*/
tdm_output **(*display_get_outputs)(tdm_backend_data *bdata, int *count,
- tdm_error *error);
+ tdm_error *error);
/**
* @brief Get the file descriptor of a backend module
* "tdm_layer*" data. It will be freed in frontend.
*/
tdm_layer **(*output_get_layers)(tdm_output *output, int *count,
- tdm_error *error);
+ tdm_error *error);
/**
* @brief Set the property which has a given id
* @return #TDM_ERROR_NONE if success. Otherwise, error value.
*/
tdm_error (*output_set_property)(tdm_output *output, unsigned int id,
- tdm_value value);
+ tdm_value value);
/**
* @brief Get the property which has a given id
* @return #TDM_ERROR_NONE if success. Otherwise, error value.
*/
tdm_error (*output_get_property)(tdm_output *output, unsigned int id,
- tdm_value *value);
+ tdm_value *value);
/**
* @brief Wait for VBLANK
* vblanks.
*/
tdm_error (*output_wait_vblank)(tdm_output *output, int interval, int sync,
- void *user_data);
+ void *user_data);
/**
* @brief Set a user vblank handler
* @return #TDM_ERROR_NONE if success. Otherwise, error value.
*/
tdm_error (*output_set_vblank_handler)(tdm_output *output,
- tdm_output_vblank_handler func);
+ tdm_output_vblank_handler func);
/**
* @brief Commit changes for a output object
* @return #TDM_ERROR_NONE if success. Otherwise, error value.
*/
tdm_error (*output_set_commit_handler)(tdm_output *output,
- tdm_output_commit_handler func);
+ tdm_output_commit_handler func);
/**
* @brief Set DPMS of a output object
* @since 1.1.0
*/
tdm_error (*output_set_status_handler)(tdm_output *output,
- tdm_output_status_handler func,
- void *user_data);
+ tdm_output_status_handler func,
+ void *user_data);
void (*reserved1)(void);
void (*reserved2)(void);
* @return #TDM_ERROR_NONE if success. Otherwise, error value.
*/
tdm_error (*layer_set_property)(tdm_layer *layer, unsigned int id,
- tdm_value value);
+ tdm_value value);
/**
* @brief Get the property which has a given id.
* @return #TDM_ERROR_NONE if success. Otherwise, error value.
*/
tdm_error (*layer_get_property)(tdm_layer *layer, unsigned int id,
- tdm_value *value);
+ tdm_value *value);
/**
* @brief Set the geometry information to a layer object
* @brief The done handler of a pp object
*/
typedef void (*tdm_pp_done_handler)(tdm_pp *pp, tbm_surface_h src,
- tbm_surface_h dst, void *user_data);
+ tbm_surface_h dst, void *user_data);
/**
* @brief The pp functions for a backend module.
* @param[in] pp A pp object
* @see display_create_pp() function of #tdm_func_display
*/
- void (*pp_destroy)(tdm_pp *pp);
+ void (*pp_destroy)(tdm_pp *pp);
/**
* @brief Set the geometry information to a pp object
* @remark
* A backend module would apply the geometry information when committed.
*/
- tdm_error (*pp_set_info)(tdm_pp *pp, tdm_info_pp *info);
+ tdm_error (*pp_set_info)(tdm_pp *pp, tdm_info_pp *info);
/**
* @brief Attach a source buffer and a destination buffer to a pp object
* #pp_set_info() of #tdm_func_pp. When done, a backend module @b SHOULD
* return the source/destination buffer via tdm_pp_done_handler.
*/
- tdm_error (*pp_attach)(tdm_pp *pp, tbm_surface_h src, tbm_surface_h dst);
+ tdm_error (*pp_attach)(tdm_pp *pp, tbm_surface_h src, tbm_surface_h dst);
/**
* @brief Commit changes for a pp object
* @param[in] pp A pp object
* @return #TDM_ERROR_NONE if success. Otherwise, error value.
*/
- tdm_error (*pp_commit)(tdm_pp *pp);
+ tdm_error (*pp_commit)(tdm_pp *pp);
/**
* @brief Set a user done handler to a pp object
* @remark
* A backend module @b SHOULD call #tdm_pp_done_handler when converintg a image is done.
*/
- tdm_error (*pp_set_done_handler)(tdm_pp *pp, tdm_pp_done_handler func,
- void *user_data);
+ tdm_error (*pp_set_done_handler)(tdm_pp *pp, tdm_pp_done_handler func,
+ void *user_data);
void (*reserved1)(void);
void (*reserved2)(void);
* @brief The done handler of a capture object
*/
typedef void (*tdm_capture_done_handler)(tdm_capture *capture,
- tbm_surface_h buffer, void *user_data);
+ tbm_surface_h buffer, void *user_data);
/**
* @brief The capture functions for a backend module.
* @see output_create_capture() function of #tdm_func_output
* @see layer_create_capture() function of #tdm_func_layer
*/
- void (*capture_destroy)(tdm_capture *capture);
+ void (*capture_destroy)(tdm_capture *capture);
/**
* @brief Set the geometry information to a capture object
* @remark
* A backend module would apply the geometry information when committed.
*/
- tdm_error (*capture_set_info)(tdm_capture *capture, tdm_info_capture *info);
+ tdm_error (*capture_set_info)(tdm_capture *capture, tdm_info_capture *info);
/**
* @brief Attach a TDM buffer to a capture object
* of #tdm_func_capture. When done, a backend module @b SHOULD return the TDM
* buffer via tdm_capture_done_handler.
*/
- tdm_error (*capture_attach)(tdm_capture *capture, tbm_surface_h buffer);
+ tdm_error (*capture_attach)(tdm_capture *capture, tbm_surface_h buffer);
/**
* @brief Commit changes for a capture object
* @param[in] capture A capture object
* @return #TDM_ERROR_NONE if success. Otherwise, error value.
*/
- tdm_error (*capture_commit)(tdm_capture *capture);
+ tdm_error (*capture_commit)(tdm_capture *capture);
/**
* @brief Set a user done handler to a capture object
* @remark
* A backend module @b SHOULD call #tdm_capture_done_handler when capture operation is done.
*/
- tdm_error (*capture_set_done_handler)(tdm_capture *capture,
- tdm_capture_done_handler func, void *user_data);
+ tdm_error (*capture_set_done_handler)(tdm_capture *capture,
+ tdm_capture_done_handler func, void *user_data);
void (*reserved1)(void);
void (*reserved2)(void);
#define TDM_BACKEND_GET_ABI_MAJOR(v) (((v) & TDM_BACKEND_MAJOR_VERSION_MASK) >> 16)
/**
- * @brief
+ * @brief
* The ABI version of TDM backend module. It has a major and minor revision.
* Modules using lower minor revisions will work with TDM frontend of a higher
* minor revision. There is no compatibility between different major revisions.
* The minor revision mask is 0x0000FFFF and the major revision mask is 0xFFFF0000.
* @par Example
* @code
- tdm_backend_module tdm_backend_module_data = {
- "drm",
- "Samsung",
- TDM_BACKEND_SET_ABI_VERSION(1,1),
- tdm_drm_init,
- tdm_drm_deinit
- };
+ * tdm_backend_module tdm_backend_module_data = {
+ * "drm",
+ * "Samsung",
+ * TDM_BACKEND_SET_ABI_VERSION(1,1),
+ * tdm_drm_init,
+ * tdm_drm_deinit
+ * };
* @endcode
*/
#define TDM_BACKEND_SET_ABI_VERSION(major, minor) \
- (((major) << 16) & TDM_BACKEND_MAJOR_VERSION_MASK) | \
- ((major) & TDM_BACKEND_MINOR_VERSION_MASK)
+ (((major) << 16) & TDM_BACKEND_MAJOR_VERSION_MASK) | \
+ ((major) & TDM_BACKEND_MINOR_VERSION_MASK)
/**
* @brief
*/
tdm_error
tdm_backend_register_func_display(tdm_display *dpy,
- tdm_func_display *func_display);
+ tdm_func_display *func_display);
/**
* @brief Register the backend output functions to a display
*/
tdm_error
tdm_backend_register_func_output(tdm_display *dpy,
- tdm_func_output *func_output);
+ tdm_func_output *func_output);
/**
* @brief Register the backend layer functions to a display
*/
tdm_error
tdm_backend_register_func_capture(tdm_display *dpy,
- tdm_func_capture *func_capture);
+ tdm_func_capture *func_capture);
/**
* @brief Increase the ref_count of a TDM buffer
* @see tdm_buffer_add_destroy_handler, tdm_buffer_remove_destroy_handler
*/
typedef void (*tdm_buffer_destroy_handler)(tbm_surface_h buffer,
- void *user_data);
+ void *user_data);
/**
* @brief Add a destroy handler to a TDM buffer
*/
tdm_error
tdm_buffer_add_destroy_handler(tbm_surface_h buffer,
- tdm_buffer_destroy_handler func, void *user_data);
+ tdm_buffer_destroy_handler func, void *user_data);
/**
* @brief Remove a destroy handler from a TDM buffer
*/
void
tdm_buffer_remove_destroy_handler(tbm_surface_h buffer,
- tdm_buffer_destroy_handler func, void *user_data);
+ tdm_buffer_destroy_handler func, void *user_data);
/**
* @brief Add a FD handler for activity on the given file descriptor
*/
tdm_event_loop_source*
tdm_event_loop_add_fd_handler(tdm_display *dpy, int fd, tdm_event_loop_mask mask,
- tdm_event_loop_fd_handler func, void *user_data,
- tdm_error *error);
+ tdm_event_loop_fd_handler func, void *user_data,
+ tdm_error *error);
/**
* @brief Update the mask of the given FD event source
*/
tdm_event_loop_source*
tdm_event_loop_add_timer_handler(tdm_display *dpy, tdm_event_loop_timer_handler func,
- void *user_data, tdm_error *error);
+ void *user_data, tdm_error *error);
/**
* @brief Update the millisecond delay time of the given timer event source.
/**************************************************************************
-
-libtdm
-
-Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
-
-Contact: Eunchul Kim <chulspro.kim@samsung.com>,
- JinYoung Jeon <jy0.jeon@samsung.com>,
- Taeheon Kim <th908.kim@samsung.com>,
- YoungJun Cho <yj44.cho@samsung.com>,
- SooChan Lim <sc1.lim@samsung.com>,
- Boram Park <sc1.lim@samsung.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+ *
+ * libtdm
+ *
+ * Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
+ *
+ * Contact: Eunchul Kim <chulspro.kim@samsung.com>,
+ * JinYoung Jeon <jy0.jeon@samsung.com>,
+ * Taeheon Kim <th908.kim@samsung.com>,
+ * YoungJun Cho <yj44.cho@samsung.com>,
+ * SooChan Lim <sc1.lim@samsung.com>,
+ * Boram Park <sc1.lim@samsung.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
**************************************************************************/
#ifndef _TDM_HELPER_H_
#define LIST_LENGTH(__item) list_length(__item)
#define LIST_ENTRY(__type, __item, __field) \
- ((__type *)(((char *)(__item)) - offsetof(__type, __field)))
+ ((__type *)(((char *)(__item)) - offsetof(__type, __field)))
#define LIST_IS_EMPTY(__list) \
- ((__list)->next == (__list))
+ ((__list)->next == (__list))
#ifndef container_of
#define container_of(ptr, sample, member) \
- (void *)((char *)(ptr) \
+ (void *)((char *)(ptr) \
- ((char *)&(sample)->member - (char *)(sample)))
#endif
#define LIST_FOR_EACH_ENTRY(pos, head, member) \
- for (pos = container_of((head)->next, pos, member); \
+ for (pos = container_of((head)->next, pos, member); \
&pos->member != (head); \
pos = container_of(pos->member.next, pos, member))
#define LIST_FOR_EACH_ENTRY_SAFE(pos, storage, head, member) \
- for (pos = container_of((head)->next, pos, member), \
+ for (pos = container_of((head)->next, pos, member), \
storage = container_of(pos->member.next, pos, member); \
&pos->member != (head); \
pos = storage, storage = container_of(storage->member.next, storage, member))
#define LIST_FOR_EACH_ENTRY_SAFE_REV(pos, storage, head, member) \
- for (pos = container_of((head)->prev, pos, member), \
+ for (pos = container_of((head)->prev, pos, member), \
storage = container_of(pos->member.prev, pos, member); \
&pos->member != (head); \
pos = storage, storage = container_of(storage->member.prev, storage, member))
#define LIST_FOR_EACH_ENTRY_FROM(pos, start, head, member) \
- for (pos = container_of((start), pos, member); \
+ for (pos = container_of((start), pos, member); \
&pos->member != (head); \
pos = container_of(pos->member.next, pos, member))
#define LIST_FOR_EACH_ENTRY_FROM_REV(pos, start, head, member) \
- for (pos = container_of((start), pos, member); \
+ for (pos = container_of((start), pos, member); \
&pos->member != (head); \
pos = container_of(pos->member.prev, pos, member))
/**************************************************************************
-
-libtdm
-
-Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
-
-Contact: Eunchul Kim <chulspro.kim@samsung.com>,
- JinYoung Jeon <jy0.jeon@samsung.com>,
- Taeheon Kim <th908.kim@samsung.com>,
- YoungJun Cho <yj44.cho@samsung.com>,
- SooChan Lim <sc1.lim@samsung.com>,
- Boram Park <sc1.lim@samsung.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+ *
+ * libtdm
+ *
+ * Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
+ *
+ * Contact: Eunchul Kim <chulspro.kim@samsung.com>,
+ * JinYoung Jeon <jy0.jeon@samsung.com>,
+ * Taeheon Kim <th908.kim@samsung.com>,
+ * YoungJun Cho <yj44.cho@samsung.com>,
+ * SooChan Lim <sc1.lim@samsung.com>,
+ * Boram Park <sc1.lim@samsung.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
**************************************************************************/
#ifndef _TDM_LOG_H_
* The TDM debug log can be enable by setting "TDM_DEBUG" enviroment
* @par Example
* @code
- $ export TDM_DEBUG=1
+ * $ export TDM_DEBUG=1
* @endcode
*/
extern int tdm_debug;
#define LOG_TAG "TDM"
#define TDM_DBG(fmt, args...) \
- if (tdm_debug) \
+ if (tdm_debug) \
do { \
struct timespec ts; \
clock_gettime(CLOCK_MONOTONIC, &ts); \
#define COLOR_RESET "\x1b[0m"
#define TDM_DBG(fmt, args...) \
- if (tdm_debug) \
+ if (tdm_debug) \
do { \
struct timespec ts; \
clock_gettime(CLOCK_MONOTONIC, &ts); \
/**************************************************************************
-
-libtdm
-
-Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
-
-Contact: Eunchul Kim <chulspro.kim@samsung.com>,
- JinYoung Jeon <jy0.jeon@samsung.com>,
- Taeheon Kim <th908.kim@samsung.com>,
- YoungJun Cho <yj44.cho@samsung.com>,
- SooChan Lim <sc1.lim@samsung.com>,
- Boram Park <sc1.lim@samsung.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+ *
+ * libtdm
+ *
+ * Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
+ *
+ * Contact: Eunchul Kim <chulspro.kim@samsung.com>,
+ * JinYoung Jeon <jy0.jeon@samsung.com>,
+ * Taeheon Kim <th908.kim@samsung.com>,
+ * YoungJun Cho <yj44.cho@samsung.com>,
+ * SooChan Lim <sc1.lim@samsung.com>,
+ * Boram Park <sc1.lim@samsung.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
**************************************************************************/
#ifndef _TDM_TYPES_H_
* include @ref tdm_types.h
* @par Example
* @code
- #include <tdm.h> //for a frontend user
+ * #include <tdm.h> //for a frontend user
* @endcode
* @code
- #include <tdm_backend.h> //for a vendor to implement a backend module
+ * #include <tdm_backend.h> //for a vendor to implement a backend module
* @endcode
*/
/**
* @brief The error enumeration
*/
-typedef enum
-{
+typedef enum {
TDM_ERROR_NONE = 0, /**< none */
TDM_ERROR_BAD_REQUEST = -1, /**< bad request */
TDM_ERROR_OPERATION_FAILED = -2, /**< operaion failed */
* SCALE and TRANSFORM capability.\n
* @par Example
* @code
- //For example
- capabilities = TDM_LAYER_CAPABILITY_PRIMARY | TDM_LAYER_CAPABILITY_GRAPHIC;
- capabilities = TDM_LAYER_CAPABILITY_OVERLAY | TDM_LAYER_CAPABILITY_GRAPHIC | TDM_LAYER_CAPABILITY_SCALE;
- capabilities = TDM_LAYER_CAPABILITY_OVERLAY | TDM_LAYER_CAPABILITY_GRAPHIC | TDM_LAYER_CAPABILITY_SCALE | TDM_LAYER_CAPABILITY_TRANSFORM;
- capabilities = TDM_LAYER_CAPABILITY_CURSOR | TDM_LAYER_CAPABILITY_GRAPHIC;
- capabilities = TDM_LAYER_CAPABILITY_OVERLAY | TDM_LAYER_CAPABILITY_VIDEO;
+ * //For example
+ * capabilities = TDM_LAYER_CAPABILITY_PRIMARY | TDM_LAYER_CAPABILITY_GRAPHIC;
+ * capabilities = TDM_LAYER_CAPABILITY_OVERLAY | TDM_LAYER_CAPABILITY_GRAPHIC | TDM_LAYER_CAPABILITY_SCALE;
+ * capabilities = TDM_LAYER_CAPABILITY_OVERLAY | TDM_LAYER_CAPABILITY_GRAPHIC | TDM_LAYER_CAPABILITY_SCALE | TDM_LAYER_CAPABILITY_TRANSFORM;
+ * capabilities = TDM_LAYER_CAPABILITY_CURSOR | TDM_LAYER_CAPABILITY_GRAPHIC;
+ * capabilities = TDM_LAYER_CAPABILITY_OVERLAY | TDM_LAYER_CAPABILITY_VIDEO;
* @endcode
* @remark
* - When a video plays, in most of cases, video buffers will be displayed to
TDM_OUTPUT_MODE_FLAG_CLKDIV2 = (1 << 13),
} tdm_output_mode_flag;
-typedef enum
-{
+typedef enum {
TDM_EVENT_LOOP_READABLE = (1 << 0),
TDM_EVENT_LOOP_WRITABLE = (1 << 1),
TDM_EVENT_LOOP_HANGUP = (1 << 2),
* @see output_set_vblank_handler() function of #tdm_func_display
*/
typedef void (*tdm_output_vblank_handler)(tdm_output *output, unsigned int sequence,
- unsigned int tv_sec, unsigned int tv_usec,
- void *user_data);
+ unsigned int tv_sec, unsigned int tv_usec,
+ void *user_data);
/**
* @brief The commit handler
* @see output_set_commit_handler() function of #tdm_func_display
*/
typedef void (*tdm_output_commit_handler)(tdm_output *output, unsigned int sequence,
- unsigned int tv_sec, unsigned int tv_usec,
- void *user_data);
+ unsigned int tv_sec, unsigned int tv_usec,
+ void *user_data);
/**
* @brief The tdm event source
/**************************************************************************
-
-libtdm
-
-Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
-
-Contact: Eunchul Kim <chulspro.kim@samsung.com>,
- JinYoung Jeon <jy0.jeon@samsung.com>,
- Taeheon Kim <th908.kim@samsung.com>,
- YoungJun Cho <yj44.cho@samsung.com>,
- SooChan Lim <sc1.lim@samsung.com>,
- Boram Park <sc1.lim@samsung.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+ *
+ * libtdm
+ *
+ * Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
+ *
+ * Contact: Eunchul Kim <chulspro.kim@samsung.com>,
+ * JinYoung Jeon <jy0.jeon@samsung.com>,
+ * Taeheon Kim <th908.kim@samsung.com>,
+ * YoungJun Cho <yj44.cho@samsung.com>,
+ * SooChan Lim <sc1.lim@samsung.com>,
+ * Boram Park <sc1.lim@samsung.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
**************************************************************************/
#ifdef HAVE_CONFIG_H
static tdm_private_layer *
_tdm_display_find_private_layer(tdm_private_output *private_output,
- tdm_layer *layer_backend)
+ tdm_layer *layer_backend)
{
tdm_private_layer *private_layer = NULL;
static tdm_private_output *
_tdm_display_find_private_output(tdm_private_display *private_display,
- tdm_output *output_backend)
+ tdm_output *output_backend)
{
tdm_private_output *private_output = NULL;
INTERN tdm_private_output *
tdm_display_find_output_stamp(tdm_private_display *private_display,
- unsigned long stamp)
+ unsigned long stamp)
{
tdm_private_output *private_output = NULL;
static tdm_error
_tdm_display_update_caps_pp(tdm_private_display *private_display,
- tdm_caps_pp *caps)
+ tdm_caps_pp *caps)
{
tdm_func_display *func_display = &private_display->func_display;
char buf[1024];
static tdm_error
_tdm_display_update_caps_capture(tdm_private_display *private_display,
- tdm_caps_capture *caps)
+ tdm_caps_capture *caps)
{
tdm_func_display *func_display = &private_display->func_display;
char buf[1024];
return TDM_ERROR_BAD_MODULE;
}
- ret = func_display->display_get_capture_capability(private_display->bdata,
- caps);
+ ret = func_display->display_get_capture_capability(private_display->bdata, caps);
if (ret != TDM_ERROR_NONE) {
TDM_ERR("display_get_capture_capability() failed");
return TDM_ERROR_BAD_MODULE;
static tdm_error
_tdm_display_update_caps_layer(tdm_private_display *private_display,
- tdm_layer *layer_backend, tdm_caps_layer *caps)
+ tdm_layer *layer_backend, tdm_caps_layer *caps)
{
tdm_func_layer *func_layer = &private_display->func_layer;
char buf[1024];
static tdm_error
_tdm_display_update_caps_output(tdm_private_display *private_display, int pipe,
- tdm_output *output_backend, tdm_caps_output *caps)
+ tdm_output *output_backend, tdm_caps_output *caps)
{
tdm_func_output *func_output = &private_display->func_output;
char temp[TDM_NAME_LEN];
TDM_DBG("output props: %d, %s", caps->props[i].id, caps->props[i].name);
for (i = 0; i < caps->mode_count; i++) {
TDM_DBG("output modes: name(%s), clock(%d) vrefresh(%d), flags(%x), type(%d)",
- caps->modes[i].name, caps->modes[i].clock, caps->modes[i].vrefresh,
- caps->modes[i].flags, caps->modes[i].type);
+ caps->modes[i].name, caps->modes[i].clock, caps->modes[i].vrefresh,
+ caps->modes[i].flags, caps->modes[i].type);
TDM_DBG("\t\t %d, %d, %d, %d, %d",
- caps->modes[i].hdisplay, caps->modes[i].hsync_start, caps->modes[i].hsync_end,
- caps->modes[i].htotal, caps->modes[i].hskew);
+ caps->modes[i].hdisplay, caps->modes[i].hsync_start, caps->modes[i].hsync_end,
+ caps->modes[i].htotal, caps->modes[i].hskew);
TDM_DBG("\t\t %d, %d, %d, %d, %d",
- caps->modes[i].vdisplay, caps->modes[i].vsync_start, caps->modes[i].vsync_end,
- caps->modes[i].vtotal, caps->modes[i].vscan);
+ caps->modes[i].vdisplay, caps->modes[i].vsync_start, caps->modes[i].vsync_end,
+ caps->modes[i].vtotal, caps->modes[i].vscan);
}
TDM_DBG("output min : %dx%d", caps->min_w, caps->min_h);
TDM_DBG("output max : %dx%d", caps->max_w, caps->max_h);
static tdm_error
_tdm_display_update_layer(tdm_private_display *private_display,
- tdm_private_output *private_output,
- tdm_layer *layer_backend)
+ tdm_private_output *private_output,
+ tdm_layer *layer_backend)
{
tdm_private_layer *private_layer;
tdm_error ret;
_tdm_display_destroy_caps_layer(&private_layer->caps);
ret = _tdm_display_update_caps_layer(private_display, layer_backend,
- &private_layer->caps);
+ &private_layer->caps);
if (ret != TDM_ERROR_NONE)
goto failed_update;
INTERN tdm_error
tdm_display_update_output(tdm_private_display *private_display,
- tdm_output *output_backend, int pipe)
+ tdm_output *output_backend, int pipe)
{
tdm_func_output *func_output = &private_display->func_output;
tdm_private_output *private_output = NULL;
int layer_count = 0, i;
tdm_error ret;
- private_output = _tdm_display_find_private_output(private_display,
- output_backend);
+ private_output = _tdm_display_find_private_output(private_display, output_backend);
if (!private_output) {
private_output = calloc(1, sizeof(tdm_private_output));
TDM_RETURN_VAL_IF_FAIL(private_output != NULL, TDM_ERROR_OUT_OF_MEMORY);
if (func_output->output_set_status_handler) {
func_output->output_set_status_handler(private_output->output_backend,
- tdm_output_cb_status,
- private_output);
+ tdm_output_cb_status,
+ private_output);
private_output->regist_change_cb = 1;
}
_tdm_display_destroy_caps_output(&private_output->caps);
ret = _tdm_display_update_caps_output(private_display, pipe, output_backend,
- &private_output->caps);
+ &private_output->caps);
if (ret != TDM_ERROR_NONE)
return ret;
if (private_display->outputs)
return private_display->outputs;
- outputs = func_display->display_get_outputs(private_display->bdata,
- &output_count, &ret);
+ outputs = func_display->display_get_outputs(private_display->bdata, &output_count, &ret);
if (ret != TDM_ERROR_NONE)
goto failed_get_outputs;
output_hdmib = outputs[i];
index_hdmib = i;
break;
- default :
+ default:
break;
}
}
static tdm_error
_tdm_display_update_internal(tdm_private_display *private_display,
- int only_display)
+ int only_display)
{
tdm_output **outputs = NULL;
int output_count = 0, i;
goto failed_update;
ret = _tdm_display_update_caps_capture(private_display,
- &private_display->caps_capture);
+ &private_display->caps_capture);
if (ret != TDM_ERROR_NONE)
goto failed_update;
}
int major, minor;
TDM_INFO("TDM ABI version : %d.%d",
- TDM_MAJOR_VERSION, TDM_MINOR_VERSION);
+ TDM_MAJOR_VERSION, TDM_MINOR_VERSION);
name = module->name ? module->name : "unknown";
vendor = module->vendor ? module->vendor : "unknown";
if (major != TDM_MAJOR_VERSION) {
TDM_ERR("'%s' major version mismatch, %d != %d",
- name, major, TDM_MAJOR_VERSION);
+ name, major, TDM_MAJOR_VERSION);
return TDM_ERROR_BAD_MODULE;
}
if (minor > TDM_MINOR_VERSION) {
TDM_ERR("'%s' minor version(%d) is newer than %d",
- name, minor, TDM_MINOR_VERSION);
+ name, minor, TDM_MINOR_VERSION);
return TDM_ERROR_BAD_MODULE;
}
/* below functions should be implemented in backend side */
TDM_RETURN_VAL_IF_FAIL(func_display != NULL, TDM_ERROR_BAD_MODULE);
- TDM_RETURN_VAL_IF_FAIL(func_display->display_get_capabilitiy,
- TDM_ERROR_BAD_MODULE);
+ TDM_RETURN_VAL_IF_FAIL(func_display->display_get_capabilitiy, TDM_ERROR_BAD_MODULE);
TDM_RETURN_VAL_IF_FAIL(func_display->display_get_outputs, TDM_ERROR_BAD_MODULE);
- TDM_RETURN_VAL_IF_FAIL(func_output->output_get_capability,
- TDM_ERROR_BAD_MODULE);
+ TDM_RETURN_VAL_IF_FAIL(func_output->output_get_capability, TDM_ERROR_BAD_MODULE);
TDM_RETURN_VAL_IF_FAIL(func_output->output_get_layers, TDM_ERROR_BAD_MODULE);
TDM_RETURN_VAL_IF_FAIL(func_layer->layer_get_capability, TDM_ERROR_BAD_MODULE);
- ret = func_display->display_get_capabilitiy(private_display->bdata,
- &private_display->caps_display);
+ ret = func_display->display_get_capabilitiy(private_display->bdata, &private_display->caps_display);
if (ret != TDM_ERROR_NONE) {
TDM_ERR("display_get_capabilitiy() failed");
return TDM_ERROR_BAD_MODULE;
if (private_display->capabilities & TDM_DISPLAY_CAPABILITY_PP) {
tdm_func_pp *func_pp = &private_display->func_pp;
- TDM_RETURN_VAL_IF_FAIL(func_display->display_get_pp_capability,
- TDM_ERROR_BAD_MODULE);
+ TDM_RETURN_VAL_IF_FAIL(func_display->display_get_pp_capability, TDM_ERROR_BAD_MODULE);
TDM_RETURN_VAL_IF_FAIL(func_display->display_create_pp, TDM_ERROR_BAD_MODULE);
TDM_RETURN_VAL_IF_FAIL(func_pp->pp_destroy, TDM_ERROR_BAD_MODULE);
TDM_RETURN_VAL_IF_FAIL(func_pp->pp_commit, TDM_ERROR_BAD_MODULE);
if (private_display->capabilities & TDM_DISPLAY_CAPABILITY_CAPTURE) {
tdm_func_capture *func_capture = &private_display->func_capture;
- TDM_RETURN_VAL_IF_FAIL(func_display->display_get_capture_capability,
- TDM_ERROR_BAD_MODULE);
- TDM_RETURN_VAL_IF_FAIL(func_output->output_create_capture,
- TDM_ERROR_BAD_MODULE);
+ TDM_RETURN_VAL_IF_FAIL(func_display->display_get_capture_capability, TDM_ERROR_BAD_MODULE);
+ TDM_RETURN_VAL_IF_FAIL(func_output->output_create_capture, TDM_ERROR_BAD_MODULE);
TDM_RETURN_VAL_IF_FAIL(func_layer->layer_create_capture, TDM_ERROR_BAD_MODULE);
TDM_RETURN_VAL_IF_FAIL(func_capture->capture_destroy, TDM_ERROR_BAD_MODULE);
TDM_RETURN_VAL_IF_FAIL(func_capture->capture_commit, TDM_ERROR_BAD_MODULE);
- TDM_RETURN_VAL_IF_FAIL(func_capture->capture_set_done_handler,
- TDM_ERROR_BAD_MODULE);
+ TDM_RETURN_VAL_IF_FAIL(func_capture->capture_set_done_handler, TDM_ERROR_BAD_MODULE);
}
return TDM_ERROR_NONE;
static tdm_error
_tdm_display_load_module_with_file(tdm_private_display *private_display,
- const char *file)
+ const char *file)
{
char path[PATH_MAX] = {0,};
tdm_backend_module *module_data;
/* We don't care if backend_data is NULL or not. It's up to backend. */
TDM_TRACE_BEGIN(Init_Backend);
- private_display->bdata = module_data->init((tdm_display *)private_display,
- &ret);
+ private_display->bdata = module_data->init((tdm_display *)private_display, &ret);
TDM_TRACE_END();
if (ret != TDM_ERROR_NONE) {
TDM_ERR("'%s' init failed", file);
/**************************************************************************
-
-libtdm
-
-Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
-
-Contact: Eunchul Kim <chulspro.kim@samsung.com>,
- JinYoung Jeon <jy0.jeon@samsung.com>,
- Taeheon Kim <th908.kim@samsung.com>,
- YoungJun Cho <yj44.cho@samsung.com>,
- SooChan Lim <sc1.lim@samsung.com>,
- Boram Park <sc1.lim@samsung.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+ *
+ * libtdm
+ *
+ * Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
+ *
+ * Contact: Eunchul Kim <chulspro.kim@samsung.com>,
+ * JinYoung Jeon <jy0.jeon@samsung.com>,
+ * Taeheon Kim <th908.kim@samsung.com>,
+ * YoungJun Cho <yj44.cho@samsung.com>,
+ * SooChan Lim <sc1.lim@samsung.com>,
+ * Boram Park <sc1.lim@samsung.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
**************************************************************************/
#ifdef HAVE_CONFIG_H
#include "tdm_private.h"
#define BACKEND_FUNC_ENTRY() \
- tdm_private_display *private_display; \
- TDM_RETURN_VAL_IF_FAIL(dpy != NULL, TDM_ERROR_INVALID_PARAMETER); \
- private_display = (tdm_private_display*)dpy;
+ tdm_private_display *private_display; \
+ TDM_RETURN_VAL_IF_FAIL(dpy != NULL, TDM_ERROR_INVALID_PARAMETER); \
+ private_display = (tdm_private_display*)dpy;
static int
_check_abi_version(tdm_backend_module *module, int abimaj, int abimin)
return 1;
failed:
TDM_ERR("The ABI version(%d.%d) of '%s' is less than %d.%d",
- major, minor, module->name ? module->name : "unknown",
- abimaj, abimin);
+ major, minor, module->name ? module->name : "unknown",
+ abimaj, abimin);
return 0;
}
EXTERN tdm_error
tdm_backend_register_func_display(tdm_display *dpy,
- tdm_func_display *func_display)
+ tdm_func_display *func_display)
{
tdm_backend_module *module;
EXTERN tdm_error
tdm_backend_register_func_capture(tdm_display *dpy,
- tdm_func_capture *func_capture)
+ tdm_func_capture *func_capture)
{
TDM_RETURN_VAL_IF_FAIL(TDM_MUTEX_IS_LOCKED(), TDM_ERROR_OPERATION_FAILED);
/**************************************************************************
-
-libtdm
-
-Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
-
-Contact: Eunchul Kim <chulspro.kim@samsung.com>,
- JinYoung Jeon <jy0.jeon@samsung.com>,
- Taeheon Kim <th908.kim@samsung.com>,
- YoungJun Cho <yj44.cho@samsung.com>,
- SooChan Lim <sc1.lim@samsung.com>,
- Boram Park <sc1.lim@samsung.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+ *
+ * libtdm
+ *
+ * Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
+ *
+ * Contact: Eunchul Kim <chulspro.kim@samsung.com>,
+ * JinYoung Jeon <jy0.jeon@samsung.com>,
+ * Taeheon Kim <th908.kim@samsung.com>,
+ * YoungJun Cho <yj44.cho@samsung.com>,
+ * SooChan Lim <sc1.lim@samsung.com>,
+ * Boram Park <sc1.lim@samsung.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
**************************************************************************/
#ifdef HAVE_CONFIG_H
{
tdm_buffer_info *buf_info = NULL;
- if (!tbm_surface_internal_get_user_data(buffer, TDM_BUFFER_KEY,(void **)&buf_info)) {
+ if (!tbm_surface_internal_get_user_data(buffer, TDM_BUFFER_KEY, (void **)&buf_info)) {
buf_info = calloc(1, sizeof(tdm_buffer_info));
TDM_RETURN_VAL_IF_FAIL(buf_info != NULL, NULL);
EXTERN tdm_error
tdm_buffer_add_release_handler(tbm_surface_h buffer,
- tdm_buffer_release_handler func, void *user_data)
+ tdm_buffer_release_handler func, void *user_data)
{
tdm_buffer_info *buf_info;
tdm_buffer_func_info *func_info;
EXTERN void
tdm_buffer_remove_release_handler(tbm_surface_h buffer,
- tdm_buffer_release_handler func, void *user_data)
+ tdm_buffer_release_handler func, void *user_data)
{
tdm_buffer_info *buf_info;
tdm_buffer_func_info *func_info = NULL, *next = NULL;
EXTERN tdm_error
tdm_buffer_add_destroy_handler(tbm_surface_h buffer,
- tdm_buffer_destroy_handler func, void *user_data)
+ tdm_buffer_destroy_handler func, void *user_data)
{
tdm_buffer_info *buf_info;
tdm_buffer_func_info *func_info;
EXTERN void
tdm_buffer_remove_destroy_handler(tbm_surface_h buffer,
- tdm_buffer_destroy_handler func, void *user_data)
+ tdm_buffer_destroy_handler func, void *user_data)
{
tdm_buffer_info *buf_info;
tdm_buffer_func_info *func_info = NULL, *next = NULL;
{
tdm_buffer_info *buf_info = NULL;
char str[256], *p;
- int len = sizeof (str);
+ int len = sizeof(str);
TDM_RETURN_IF_FAIL(list != NULL);
int l = snprintf(p, len, " %p", buf_info->buffer);
p += l;
len -= l;
- }
- else
+ } else
break;
}
/**************************************************************************
-
-libtdm
-
-Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
-
-Contact: Eunchul Kim <chulspro.kim@samsung.com>,
- JinYoung Jeon <jy0.jeon@samsung.com>,
- Taeheon Kim <th908.kim@samsung.com>,
- YoungJun Cho <yj44.cho@samsung.com>,
- SooChan Lim <sc1.lim@samsung.com>,
- Boram Park <sc1.lim@samsung.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+ *
+ * libtdm
+ *
+ * Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
+ *
+ * Contact: Eunchul Kim <chulspro.kim@samsung.com>,
+ * JinYoung Jeon <jy0.jeon@samsung.com>,
+ * Taeheon Kim <th908.kim@samsung.com>,
+ * YoungJun Cho <yj44.cho@samsung.com>,
+ * SooChan Lim <sc1.lim@samsung.com>,
+ * Boram Park <sc1.lim@samsung.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
**************************************************************************/
#ifdef HAVE_CONFIG_H
#include "tdm_private.h"
#define CAPTURE_FUNC_ENTRY() \
- tdm_func_capture *func_capture; \
- tdm_private_display *private_display; \
- tdm_private_capture *private_capture; \
- tdm_error ret = TDM_ERROR_NONE; \
- TDM_RETURN_VAL_IF_FAIL(capture != NULL, TDM_ERROR_INVALID_PARAMETER); \
- private_capture = (tdm_private_capture*)capture; \
- private_display = private_capture->private_display; \
- func_capture = &private_display->func_capture
+ tdm_func_capture *func_capture; \
+ tdm_private_display *private_display; \
+ tdm_private_capture *private_capture; \
+ tdm_error ret = TDM_ERROR_NONE; \
+ TDM_RETURN_VAL_IF_FAIL(capture != NULL, TDM_ERROR_INVALID_PARAMETER); \
+ private_capture = (tdm_private_capture*)capture; \
+ private_display = private_capture->private_display; \
+ func_capture = &private_display->func_capture
static tdm_error
_tdm_capture_check_if_exist(tdm_private_capture *private_capture,
- tbm_surface_h buffer)
+ tbm_surface_h buffer)
{
tdm_buffer_info *buf_info = NULL;
INTERN void
tdm_capture_cb_done(tdm_capture *capture_backend, tbm_surface_h buffer,
- void *user_data)
+ void *user_data)
{
tdm_private_capture *private_capture = user_data;
tdm_private_display *private_display = private_capture->private_display;
INTERN tdm_private_capture *
tdm_capture_create_output_internal(tdm_private_output *private_output,
- tdm_error *error)
+ tdm_error *error)
{
tdm_private_display *private_display = private_output->private_display;
tdm_func_output *func_output = &private_display->func_output;
}
capture_backend = func_output->output_create_capture(
- private_output->output_backend, &ret);
+ private_output->output_backend, &ret);
if (ret != TDM_ERROR_NONE) {
if (error)
*error = ret;
}
ret = func_capture->capture_set_done_handler(capture_backend,
- tdm_capture_cb_done, private_capture);
+ tdm_capture_cb_done, private_capture);
if (ret != TDM_ERROR_NONE) {
TDM_ERR("capture(%p) set capture_done_handler failed", private_capture);
func_capture->capture_destroy(capture_backend);
INTERN tdm_private_capture *
tdm_capture_create_layer_internal(tdm_private_layer *private_layer,
- tdm_error *error)
+ tdm_error *error)
{
tdm_private_output *private_output = private_layer->private_output;
tdm_private_display *private_display = private_output->private_display;
}
capture_backend = func_layer->layer_create_capture(private_layer->layer_backend,
- &ret);
+ &ret);
if (ret != TDM_ERROR_NONE)
return NULL;
private_output = private_capture->private_output;
if (private_output->current_dpms_value > TDM_OUTPUT_DPMS_ON) {
TDM_ERR("output(%d) dpms: %s", private_output->pipe,
- dpms_str(private_output->current_dpms_value));
+ dpms_str(private_output->current_dpms_value));
_pthread_mutex_unlock(&private_display->lock);
return TDM_ERROR_BAD_REQUEST;
}
/**************************************************************************
-
-libtdm
-
-Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
-
-Contact: Eunchul Kim <chulspro.kim@samsung.com>,
- JinYoung Jeon <jy0.jeon@samsung.com>,
- Taeheon Kim <th908.kim@samsung.com>,
- YoungJun Cho <yj44.cho@samsung.com>,
- SooChan Lim <sc1.lim@samsung.com>,
- Boram Park <sc1.lim@samsung.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+ *
+ * libtdm
+ *
+ * Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
+ *
+ * Contact: Eunchul Kim <chulspro.kim@samsung.com>,
+ * JinYoung Jeon <jy0.jeon@samsung.com>,
+ * Taeheon Kim <th908.kim@samsung.com>,
+ * YoungJun Cho <yj44.cho@samsung.com>,
+ * SooChan Lim <sc1.lim@samsung.com>,
+ * Boram Park <sc1.lim@samsung.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
**************************************************************************/
#ifdef HAVE_CONFIG_H
#define COUNT_MAX 10
#define DISPLAY_FUNC_ENTRY() \
- tdm_private_display *private_display; \
- tdm_error ret = TDM_ERROR_NONE; /* default TDM_ERROR_NONE */\
- TDM_RETURN_VAL_IF_FAIL(dpy != NULL, TDM_ERROR_INVALID_PARAMETER); \
- private_display = (tdm_private_display*)dpy;
+ tdm_private_display *private_display; \
+ tdm_error ret = TDM_ERROR_NONE; /* default TDM_ERROR_NONE */\
+ TDM_RETURN_VAL_IF_FAIL(dpy != NULL, TDM_ERROR_INVALID_PARAMETER); \
+ private_display = (tdm_private_display*)dpy;
#define DISPLAY_FUNC_ENTRY_ERROR() \
- tdm_private_display *private_display; \
- tdm_error ret = TDM_ERROR_NONE; /* default TDM_ERROR_NONE */\
- TDM_RETURN_VAL_IF_FAIL_WITH_ERROR(dpy != NULL, TDM_ERROR_INVALID_PARAMETER, NULL); \
- private_display = (tdm_private_display*)dpy;
+ tdm_private_display *private_display; \
+ tdm_error ret = TDM_ERROR_NONE; /* default TDM_ERROR_NONE */\
+ TDM_RETURN_VAL_IF_FAIL_WITH_ERROR(dpy != NULL, TDM_ERROR_INVALID_PARAMETER, NULL); \
+ private_display = (tdm_private_display*)dpy;
#define OUTPUT_FUNC_ENTRY() \
- tdm_private_display *private_display; \
- tdm_private_output *private_output; \
- tdm_error ret = TDM_ERROR_NONE; /* default TDM_ERROR_NONE */\
- TDM_RETURN_VAL_IF_FAIL(output != NULL, TDM_ERROR_INVALID_PARAMETER); \
- private_output = (tdm_private_output*)output; \
- private_display = private_output->private_display
+ tdm_private_display *private_display; \
+ tdm_private_output *private_output; \
+ tdm_error ret = TDM_ERROR_NONE; /* default TDM_ERROR_NONE */\
+ TDM_RETURN_VAL_IF_FAIL(output != NULL, TDM_ERROR_INVALID_PARAMETER); \
+ private_output = (tdm_private_output*)output; \
+ private_display = private_output->private_display
#define OUTPUT_FUNC_ENTRY_ERROR() \
- tdm_private_display *private_display; \
- tdm_private_output *private_output; \
- tdm_error ret = TDM_ERROR_NONE; /* default TDM_ERROR_NONE */\
- TDM_RETURN_VAL_IF_FAIL_WITH_ERROR(output != NULL, TDM_ERROR_INVALID_PARAMETER, NULL); \
- private_output = (tdm_private_output*)output; \
- private_display = private_output->private_display
+ tdm_private_display *private_display; \
+ tdm_private_output *private_output; \
+ tdm_error ret = TDM_ERROR_NONE; /* default TDM_ERROR_NONE */\
+ TDM_RETURN_VAL_IF_FAIL_WITH_ERROR(output != NULL, TDM_ERROR_INVALID_PARAMETER, NULL); \
+ private_output = (tdm_private_output*)output; \
+ private_display = private_output->private_display
#define LAYER_FUNC_ENTRY() \
- tdm_private_display *private_display; \
- tdm_private_output *private_output; \
- tdm_private_layer *private_layer; \
- tdm_error ret = TDM_ERROR_NONE; /* default TDM_ERROR_NONE */\
- TDM_RETURN_VAL_IF_FAIL(layer != NULL, TDM_ERROR_INVALID_PARAMETER); \
- private_layer = (tdm_private_layer*)layer; \
- private_output = private_layer->private_output; \
- private_display = private_output->private_display
+ tdm_private_display *private_display; \
+ tdm_private_output *private_output; \
+ tdm_private_layer *private_layer; \
+ tdm_error ret = TDM_ERROR_NONE; /* default TDM_ERROR_NONE */\
+ TDM_RETURN_VAL_IF_FAIL(layer != NULL, TDM_ERROR_INVALID_PARAMETER); \
+ private_layer = (tdm_private_layer*)layer; \
+ private_output = private_layer->private_output; \
+ private_display = private_output->private_display
#define LAYER_FUNC_ENTRY_ERROR() \
- tdm_private_display *private_display; \
- tdm_private_output *private_output; \
- tdm_private_layer *private_layer; \
- tdm_error ret = TDM_ERROR_NONE; /* default TDM_ERROR_NONE */\
- TDM_RETURN_VAL_IF_FAIL_WITH_ERROR(layer != NULL, TDM_ERROR_INVALID_PARAMETER, NULL); \
- private_layer = (tdm_private_layer*)layer; \
- private_output = private_layer->private_output; \
- private_display = private_output->private_display
+ tdm_private_display *private_display; \
+ tdm_private_output *private_output; \
+ tdm_private_layer *private_layer; \
+ tdm_error ret = TDM_ERROR_NONE; /* default TDM_ERROR_NONE */\
+ TDM_RETURN_VAL_IF_FAIL_WITH_ERROR(layer != NULL, TDM_ERROR_INVALID_PARAMETER, NULL); \
+ private_layer = (tdm_private_layer*)layer; \
+ private_output = private_layer->private_output; \
+ private_display = private_output->private_display
#define LAYER_FUNC_ENTRY_VOID_RETURN() \
- tdm_private_display *private_display; \
- tdm_private_output *private_output; \
- tdm_private_layer *private_layer; \
- tdm_error ret = TDM_ERROR_NONE; /* default TDM_ERROR_NONE */\
- TDM_RETURN_IF_FAIL(layer != NULL); \
- private_layer = (tdm_private_layer*)layer; \
- private_output = private_layer->private_output; \
- private_display = private_output->private_display
+ tdm_private_display *private_display; \
+ tdm_private_output *private_output; \
+ tdm_private_layer *private_layer; \
+ tdm_error ret = TDM_ERROR_NONE; /* default TDM_ERROR_NONE */\
+ TDM_RETURN_IF_FAIL(layer != NULL); \
+ private_layer = (tdm_private_layer*)layer; \
+ private_output = private_layer->private_output; \
+ private_display = private_output->private_display
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
};
#define type_name_fn(res) \
-const char * res##_str(int type) { \
+const char * res##_str(int type) \
+{ \
unsigned int i; \
for (i = 0; i < ARRAY_SIZE(res##_names); i++) { \
if (res##_names[i].type == type) \
EXTERN tdm_error
tdm_display_get_capabilities(tdm_display *dpy,
- tdm_display_capability *capabilities)
+ tdm_display_capability *capabilities)
{
DISPLAY_FUNC_ENTRY();
EXTERN tdm_error
tdm_display_get_pp_capabilities(tdm_display *dpy,
- tdm_pp_capability *capabilities)
+ tdm_pp_capability *capabilities)
{
DISPLAY_FUNC_ENTRY();
EXTERN tdm_error
tdm_display_get_pp_available_formats(tdm_display *dpy,
- const tbm_format **formats, int *count)
+ const tbm_format **formats, int *count)
{
DISPLAY_FUNC_ENTRY();
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)
+ int *max_w, int *max_h, int *preferred_align)
{
DISPLAY_FUNC_ENTRY();
EXTERN tdm_error
tdm_display_get_capture_capabilities(tdm_display *dpy,
- tdm_capture_capability *capabilities)
+ tdm_capture_capability *capabilities)
{
DISPLAY_FUNC_ENTRY();
EXTERN tdm_error
tdm_display_get_catpure_available_formats(tdm_display *dpy,
- const tbm_format **formats, int *count)
+ const tbm_format **formats, int *count)
{
DISPLAY_FUNC_ENTRY();
EXTERN tdm_error
tdm_output_get_model_info(tdm_output *output, const char **maker,
- const char **model, const char **name)
+ const char **model, const char **name)
{
OUTPUT_FUNC_ENTRY();
INTERN void
tdm_output_cb_status(tdm_output *output_backend, tdm_output_conn_status status,
- void *user_data)
+ void *user_data)
{
tdm_private_display *private_display;
tdm_private_output *private_output = user_data;
value.u32 = status;
tdm_output_call_change_handler_internal(private_output,
- &private_output->change_handler_list_sub,
- TDM_OUTPUT_CHANGE_CONNECTION,
- value);
+ &private_output->change_handler_list_sub,
+ TDM_OUTPUT_CHANGE_CONNECTION,
+ value);
ret = tdm_thread_send_cb(private_display->private_loop, &output_status.base);
TDM_WARNING_IF_FAIL(ret == TDM_ERROR_NONE);
value.u32 = status;
tdm_output_call_change_handler_internal(private_output,
- &private_output->change_handler_list_main,
- TDM_OUTPUT_CHANGE_CONNECTION,
- value);
+ &private_output->change_handler_list_main,
+ TDM_OUTPUT_CHANGE_CONNECTION,
+ value);
}
EXTERN tdm_error
tdm_output_add_change_handler(tdm_output *output,
- tdm_output_change_handler func,
- void *user_data)
+ tdm_output_change_handler func,
+ void *user_data)
{
tdm_private_change_handler *change_handler;
OUTPUT_FUNC_ENTRY();
EXTERN void
tdm_output_remove_change_handler(tdm_output *output,
- tdm_output_change_handler func,
- void *user_data)
+ tdm_output_change_handler func,
+ void *user_data)
{
tdm_private_display *private_display;
tdm_private_output *private_output;
EXTERN tdm_error
tdm_output_get_available_properties(tdm_output *output, const tdm_prop **props,
- int *count)
+ int *count)
{
OUTPUT_FUNC_ENTRY();
EXTERN tdm_error
tdm_output_get_available_modes(tdm_output *output,
- const tdm_output_mode **modes, int *count)
+ const tdm_output_mode **modes, int *count)
{
OUTPUT_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)
+ int *max_w, int *max_h, int *preferred_align)
{
OUTPUT_FUNC_ENTRY();
EXTERN tdm_error
tdm_output_get_physical_size(tdm_output *output, unsigned int *mmWidth,
- unsigned int *mmHeight)
+ unsigned int *mmHeight)
{
OUTPUT_FUNC_ENTRY();
}
ret = func_output->output_set_property(private_output->output_backend, id,
- value);
+ value);
_pthread_mutex_unlock(&private_display->lock);
}
ret = func_output->output_get_property(private_output->output_backend, id,
- value);
+ value);
_pthread_mutex_unlock(&private_display->lock);
INTERN void
tdm_output_cb_vblank(tdm_output *output_backend, unsigned int sequence,
- unsigned int tv_sec, unsigned int tv_usec, void *user_data)
+ unsigned int tv_sec, unsigned int tv_usec, void *user_data)
{
tdm_private_vblank_handler *vblank_handler = user_data;
tdm_private_display *private_display;
if (vblank_handler->func) {
_pthread_mutex_unlock(&private_display->lock);
vblank_handler->func(vblank_handler->private_output, sequence,
- tv_sec, tv_usec, vblank_handler->user_data);
+ tv_sec, tv_usec, vblank_handler->user_data);
_pthread_mutex_lock(&private_display->lock);
}
INTERN void
tdm_output_cb_commit(tdm_output *output_backend, unsigned int sequence,
- unsigned int tv_sec, unsigned int tv_usec, void *user_data)
+ unsigned int tv_sec, unsigned int tv_usec, void *user_data)
{
tdm_private_commit_handler *commit_handler = user_data;
tdm_private_display *private_display;
if (private_layer->buffer_queue) {
tbm_surface_queue_release(private_layer->buffer_queue,
- private_layer->showing_buffer);
+ private_layer->showing_buffer);
}
}
if (tdm_debug_buffer)
TDM_INFO("layer(%p) waiting_buffer(%p) showing_buffer(%p)",
- private_layer, private_layer->waiting_buffer,
- private_layer->showing_buffer);
+ private_layer, private_layer->waiting_buffer,
+ private_layer->showing_buffer);
}
if (commit_handler->func) {
_pthread_mutex_unlock(&private_display->lock);
commit_handler->func(private_output, sequence,
- tv_sec, tv_usec, commit_handler->user_data);
+ tv_sec, tv_usec, commit_handler->user_data);
_pthread_mutex_lock(&private_display->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_vblank_handler func, void *user_data)
{
tdm_func_output *func_output;
tdm_private_vblank_handler *vblank_handler;
if (private_output->current_dpms_value > TDM_OUTPUT_DPMS_ON) {
TDM_ERR("output(%d) dpms: %s", private_output->pipe,
- dpms_str(private_output->current_dpms_value));
+ dpms_str(private_output->current_dpms_value));
_pthread_mutex_unlock(&private_display->lock);
return TDM_ERROR_BAD_REQUEST;
}
vblank_handler->owner_tid = syscall(SYS_gettid);
ret = func_output->output_wait_vblank(private_output->output_backend, interval,
- sync, vblank_handler);
+ sync, vblank_handler);
if (ret != TDM_ERROR_NONE) {
_pthread_mutex_unlock(&private_display->lock);
return ret;
if (!private_output->regist_vblank_cb) {
private_output->regist_vblank_cb = 1;
ret = func_output->output_set_vblank_handler(private_output->output_backend,
- tdm_output_cb_vblank);
+ tdm_output_cb_vblank);
}
_pthread_mutex_unlock(&private_display->lock);
static tdm_error
_tdm_output_commit(tdm_output *output, int sync, tdm_output_commit_handler func,
- void *user_data)
+ void *user_data)
{
tdm_func_output *func_output;
tdm_private_commit_handler *commit_handler;
commit_handler->owner_tid = syscall(SYS_gettid);
ret = func_output->output_commit(private_output->output_backend, sync,
- commit_handler);
+ commit_handler);
TDM_RETURN_VAL_IF_FAIL(ret == TDM_ERROR_NONE, ret);
if (!private_output->regist_commit_cb) {
private_output->regist_commit_cb = 1;
ret = func_output->output_set_commit_handler(private_output->output_backend,
- tdm_output_cb_commit);
+ tdm_output_cb_commit);
}
return ret;
EXTERN tdm_error
tdm_output_commit(tdm_output *output, int sync, tdm_output_commit_handler func,
- void *user_data)
+ void *user_data)
{
OUTPUT_FUNC_ENTRY();
if (private_output->current_dpms_value > TDM_OUTPUT_DPMS_ON) {
TDM_ERR("output(%d) dpms: %s", private_output->pipe,
- dpms_str(private_output->current_dpms_value));
+ dpms_str(private_output->current_dpms_value));
_pthread_mutex_unlock(&private_display->lock);
return TDM_ERROR_BAD_REQUEST;
}
value.u32 = dpms_value;
tdm_output_call_change_handler_internal(private_output,
- &private_output->change_handler_list_main,
- TDM_OUTPUT_CHANGE_DPMS,
- value);
+ &private_output->change_handler_list_main,
+ TDM_OUTPUT_CHANGE_DPMS,
+ value);
}
_pthread_mutex_unlock(&private_display->lock);
_pthread_mutex_lock(&private_display->lock);
- capture = (tdm_capture *)tdm_capture_create_output_internal(private_output,
- error);
+ capture = (tdm_capture *)tdm_capture_create_output_internal(private_output, error);
_pthread_mutex_unlock(&private_display->lock);
INTERN void
tdm_output_call_change_handler_internal(tdm_private_output *private_output,
- struct list_head *change_handler_list,
- tdm_output_change_type type,
- tdm_value value)
+ struct list_head *change_handler_list,
+ tdm_output_change_type type,
+ tdm_value value)
{
tdm_private_display *private_display;
tdm_private_change_handler *change_handler;
if (!tdm_thread_in_display_thread(syscall(SYS_gettid))) {
if (type & TDM_OUTPUT_CHANGE_CONNECTION)
TDM_INFO("output(%d) changed: %s (%d)",
- private_output->pipe, status_str(value.u32), value.u32);
+ private_output->pipe, status_str(value.u32), value.u32);
if (type & TDM_OUTPUT_CHANGE_DPMS)
TDM_INFO("output(%d) changed: dpms %s (%d)",
- private_output->pipe, dpms_str(value.u32), value.u32);
+ private_output->pipe, dpms_str(value.u32), value.u32);
}
if (LIST_IS_EMPTY(change_handler_list))
_pthread_mutex_unlock(&private_display->lock);
change_handler->func(private_output, type,
- value, change_handler->user_data);
+ value, change_handler->user_data);
_pthread_mutex_lock(&private_display->lock);
}
}
}
EXTERN tdm_error
-tdm_layer_get_available_formats(tdm_layer *layer, const tbm_format **formats,
- int *count)
+tdm_layer_get_available_formats(tdm_layer *layer, const tbm_format **formats, int *count)
{
LAYER_FUNC_ENTRY();
}
EXTERN tdm_error
-tdm_layer_get_available_properties(tdm_layer *layer, const tdm_prop **props,
- int *count)
+tdm_layer_get_available_properties(tdm_layer *layer, const tdm_prop **props, int *count)
{
LAYER_FUNC_ENTRY();
}
TDM_INFO("layer(%p) info: src(%dx%d %d,%d %dx%d %c%c%c%c) dst(%d,%d %dx%d) trans(%d)",
- private_layer, info->src_config.size.h, info->src_config.size.v,
- info->src_config.pos.x, info->src_config.pos.y,
- info->src_config.pos.w, info->src_config.pos.h,
- FOURCC_STR(info->src_config.format),
- info->dst_pos.x, info->dst_pos.y,
- info->dst_pos.w, info->dst_pos.h,
- info->transform);
+ private_layer, info->src_config.size.h, info->src_config.size.v,
+ info->src_config.pos.x, info->src_config.pos.y,
+ info->src_config.pos.w, info->src_config.pos.h,
+ FOURCC_STR(info->src_config.format),
+ info->dst_pos.x, info->dst_pos.y,
+ info->dst_pos.w, info->dst_pos.h,
+ info->transform);
ret = func_layer->layer_set_info(private_layer->layer_backend, info);
TDM_WARNING_IF_FAIL(ret == TDM_ERROR_NONE);
private_layer->waiting_buffer = tdm_buffer_ref_backend(buffer);
if (tdm_debug_buffer)
TDM_INFO("layer(%p) waiting_buffer(%p)",
- private_layer, private_layer->waiting_buffer);
+ private_layer, private_layer->waiting_buffer);
}
_pthread_mutex_unlock(&private_display->lock);
if (tdm_debug_buffer)
TDM_INFO("layer(%p) waiting_buffer(%p)",
- private_layer, private_layer->waiting_buffer);
+ private_layer, private_layer->waiting_buffer);
}
if (private_layer->showing_buffer) {
if (tdm_debug_buffer)
TDM_INFO("layer(%p) showing_buffer(%p)",
- private_layer, private_layer->showing_buffer);
+ private_layer, private_layer->showing_buffer);
}
private_layer->usable = 1;
if (error)
*error = TDM_ERROR_OPERATION_FAILED;
_pthread_mutex_unlock(&private_display->lock);
- TDM_ERR("layer(%p) showing_buffer is null",
- private_layer);
+ TDM_ERR("layer(%p) showing_buffer is null", private_layer);
return NULL;
}
_pthread_mutex_unlock(&private_display->lock);
return;
}
- if (TBM_SURFACE_QUEUE_ERROR_NONE != tbm_surface_queue_acquire(
- private_layer->buffer_queue, &surface) ||
- surface == NULL) {
+ if (TBM_SURFACE_QUEUE_ERROR_NONE != tbm_surface_queue_acquire(private_layer->buffer_queue, &surface) ||
+ surface == NULL) {
TDM_ERR("layer(%p) tbm_surface_queue_acquire() failed surface:%p",
- private_layer, surface);
+ private_layer, surface);
_pthread_mutex_unlock(&private_display->lock);
return;
}
_pthread_mutex_unlock(&private_display->lock);
tdm_buffer_unref_backend(private_layer->waiting_buffer);
tbm_surface_queue_release(private_layer->buffer_queue,
- private_layer->waiting_buffer);
+ private_layer->waiting_buffer);
_pthread_mutex_lock(&private_display->lock);
}
if (tdm_debug_buffer)
TDM_INFO("layer(%p) waiting_buffer(%p)",
- private_layer, private_layer->waiting_buffer);
+ private_layer, private_layer->waiting_buffer);
ret = _tdm_output_commit(private_layer->private_output, 0, NULL, NULL);
if (ret != TDM_ERROR_NONE)
_pthread_mutex_unlock(&private_display->lock);
tdm_buffer_unref_backend(private_layer->waiting_buffer);
tbm_surface_queue_release(private_layer->buffer_queue,
- private_layer->waiting_buffer);
+ private_layer->waiting_buffer);
_pthread_mutex_lock(&private_display->lock);
}
_pthread_mutex_unlock(&private_display->lock);
tdm_buffer_unref_backend(private_layer->waiting_buffer);
tbm_surface_queue_release(private_layer->buffer_queue,
- private_layer->waiting_buffer);
+ private_layer->waiting_buffer);
private_layer->waiting_buffer = NULL;
_pthread_mutex_lock(&private_display->lock);
if (tdm_debug_buffer)
TDM_INFO("layer(%p) waiting_buffer(%p)",
- private_layer, private_layer->waiting_buffer);
+ private_layer, private_layer->waiting_buffer);
}
private_layer->buffer_queue = buffer_queue;
tbm_surface_queue_add_acquirable_cb(private_layer->buffer_queue,
- _tbm_layer_queue_acquirable_cb,
- layer);
+ _tbm_layer_queue_acquirable_cb,
+ layer);
tbm_surface_queue_add_destroy_cb(private_layer->buffer_queue,
- _tbm_layer_queue_destroy_cb,
- layer);
+ _tbm_layer_queue_destroy_cb,
+ layer);
_pthread_mutex_unlock(&private_display->lock);
return ret;
_pthread_mutex_unlock(&private_display->lock);
tdm_buffer_unref_backend(private_layer->waiting_buffer);
tbm_surface_queue_release(private_layer->buffer_queue,
- private_layer->waiting_buffer);
+ private_layer->waiting_buffer);
private_layer->waiting_buffer = NULL;
_pthread_mutex_lock(&private_display->lock);
if (tdm_debug_buffer)
TDM_INFO("layer(%p) waiting_buffer(%p)",
- private_layer, private_layer->waiting_buffer);
+ private_layer, private_layer->waiting_buffer);
}
if (private_layer->showing_buffer) {
_pthread_mutex_unlock(&private_display->lock);
tdm_buffer_unref_backend(private_layer->showing_buffer);
tbm_surface_queue_release(private_layer->buffer_queue,
- private_layer->showing_buffer);
+ private_layer->showing_buffer);
_pthread_mutex_lock(&private_display->lock);
private_layer->showing_buffer = NULL;
if (tdm_debug_buffer)
TDM_INFO("layer(%p) showing_buffer(%p)",
- private_layer, private_layer->showing_buffer);
+ private_layer, private_layer->showing_buffer);
}
tbm_surface_queue_remove_acquirable_cb(private_layer->buffer_queue, _tbm_layer_queue_acquirable_cb, layer);
_pthread_mutex_lock(&private_display->lock);
- capture = (tdm_capture *)tdm_capture_create_layer_internal(private_layer,
- error);
+ capture = (tdm_capture *)tdm_capture_create_layer_internal(private_layer, error);
_pthread_mutex_unlock(&private_display->lock);
/**************************************************************************
-
-libtdm
-
-Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
-
-Contact: Eunchul Kim <chulspro.kim@samsung.com>,
- JinYoung Jeon <jy0.jeon@samsung.com>,
- Taeheon Kim <th908.kim@samsung.com>,
- YoungJun Cho <yj44.cho@samsung.com>,
- SooChan Lim <sc1.lim@samsung.com>,
- Boram Park <sc1.lim@samsung.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+ *
+ * libtdm
+ *
+ * Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
+ *
+ * Contact: Eunchul Kim <chulspro.kim@samsung.com>,
+ * JinYoung Jeon <jy0.jeon@samsung.com>,
+ * Taeheon Kim <th908.kim@samsung.com>,
+ * YoungJun Cho <yj44.cho@samsung.com>,
+ * SooChan Lim <sc1.lim@samsung.com>,
+ * Boram Park <sc1.lim@samsung.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
**************************************************************************/
#ifdef HAVE_CONFIG_H
#include <wayland-server-core.h>
-typedef struct _tdm_event_loop_source_base
-{
+typedef struct _tdm_event_loop_source_base {
struct wl_event_source *wl_source;
} tdm_event_loop_source_base;
-typedef struct _tdm_event_loop_source_fd
-{
+typedef struct _tdm_event_loop_source_fd {
tdm_event_loop_source_base base;
tdm_private_display *private_display;
tdm_event_loop_fd_handler func;
void *user_data;
} tdm_event_loop_source_fd;
-typedef struct _tdm_event_loop_source_timer
-{
+typedef struct _tdm_event_loop_source_timer {
tdm_event_loop_source_base base;
tdm_private_display *private_display;
tdm_event_loop_timer_handler func;
if (private_display->private_loop)
return TDM_ERROR_NONE;
- private_loop = calloc(1, sizeof *private_loop);
+ private_loop = calloc(1, sizeof * private_loop);
if (!private_loop) {
TDM_ERR("alloc failed");
return TDM_ERROR_OUT_OF_MEMORY;
private_loop->backend_source =
tdm_event_loop_add_fd_handler(private_display, fd,
- TDM_EVENT_LOOP_READABLE,
- _tdm_event_loop_main_fd_handler,
- private_display, &ret);
+ TDM_EVENT_LOOP_READABLE,
+ _tdm_event_loop_main_fd_handler,
+ private_display, &ret);
if (!private_loop->backend_source) {
TDM_ERR("no backend fd(%d) source", fd);
return;
TDM_INFO("dispatch");
if (tdm_thread_is_running() &&
- tdm_thread_in_display_thread(syscall(SYS_gettid))) {
+ tdm_thread_in_display_thread(syscall(SYS_gettid))) {
TDM_NEVER_GET_HERE();
return TDM_ERROR_OPERATION_FAILED;
}
TDM_RETURN_IF_FAIL(private_loop->wl_display != NULL);
if (tdm_thread_is_running() &&
- tdm_thread_in_display_thread(syscall(SYS_gettid))) {
+ tdm_thread_in_display_thread(syscall(SYS_gettid))) {
TDM_NEVER_GET_HERE();
return;
}
return 1;
}
-EXTERN tdm_event_loop_source*
+EXTERN tdm_event_loop_source *
tdm_event_loop_add_fd_handler(tdm_display *dpy, int fd, tdm_event_loop_mask mask,
- tdm_event_loop_fd_handler func, void *user_data,
- tdm_error *error)
+ tdm_event_loop_fd_handler func, void *user_data,
+ tdm_error *error)
{
tdm_private_display *private_display;
tdm_private_loop *private_loop;
fd_source->base.wl_source =
wl_event_loop_add_fd(private_loop->wl_loop,
- fd, wl_mask, _tdm_event_loop_fd_func, fd_source);
+ fd, wl_mask, _tdm_event_loop_fd_func, fd_source);
if (!fd_source->base.wl_source) {
if (error)
*error = TDM_ERROR_OUT_OF_MEMORY;
if (error)
*error = TDM_ERROR_NONE;
- return (tdm_event_loop_source*)fd_source;
+ return (tdm_event_loop_source *)fd_source;
}
EXTERN tdm_error
return 1;
}
-EXTERN tdm_event_loop_source*
+EXTERN tdm_event_loop_source *
tdm_event_loop_add_timer_handler(tdm_display *dpy, tdm_event_loop_timer_handler func,
- void *user_data, tdm_error *error)
+ void *user_data, tdm_error *error)
{
tdm_private_display *private_display;
tdm_private_loop *private_loop;
timer_source->base.wl_source =
wl_event_loop_add_timer(private_loop->wl_loop,
- _tdm_event_loop_timer_func, timer_source);
+ _tdm_event_loop_timer_func, timer_source);
if (!timer_source->base.wl_source) {
if (error)
*error = TDM_ERROR_OUT_OF_MEMORY;
if (error)
*error = TDM_ERROR_NONE;
- return (tdm_event_loop_source*)timer_source;
+ return (tdm_event_loop_source *)timer_source;
}
EXTERN tdm_error
+/**************************************************************************
+ *
+ * libtdm
+ *
+ * Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
+ *
+ * Contact: Eunchul Kim <chulspro.kim@samsung.com>,
+ * JinYoung Jeon <jy0.jeon@samsung.com>,
+ * Taeheon Kim <th908.kim@samsung.com>,
+ * YoungJun Cho <yj44.cho@samsung.com>,
+ * SooChan Lim <sc1.lim@samsung.com>,
+ * Boram Park <sc1.lim@samsung.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+**************************************************************************/
+
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
static void
_tdm_helper_dump_raw(const char *file, void *data1, int size1, void *data2,
- int size2, void *data3, int size3)
+ int size2, void *data3, int size3)
{
unsigned int *blocks;
FILE *fp = fopen(file, "w+");
static void
_tdm_helper_dump_png(const char *file, const void *data, int width,
- int height)
+ int height)
{
FILE *fp = fopen(file, "wb");
TDM_RETURN_IF_FAIL(fp != NULL);
png_structp pPngStruct =
- png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
+ png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
if (!pPngStruct) {
fclose(fp);
return;
png_init_io(pPngStruct, fp);
png_set_IHDR(pPngStruct,
- pPngInfo,
- width,
- height,
- PNG_DEPTH,
- PNG_COLOR_TYPE_RGBA,
- PNG_INTERLACE_NONE,
- PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
+ pPngInfo,
+ width,
+ height,
+ PNG_DEPTH,
+ PNG_COLOR_TYPE_RGBA,
+ PNG_INTERLACE_NONE,
+ PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
png_set_bgr(pPngStruct);
png_write_info(pPngStruct, pPngInfo);
const int pixel_size = 4; // RGBA
png_bytep *row_pointers =
- png_malloc(pPngStruct, height * sizeof(png_byte *));
+ png_malloc(pPngStruct, height * sizeof(png_byte *));
unsigned int *blocks = (unsigned int *)data;
int y = 0;
for (; y < height; ++y) {
png_bytep row =
- png_malloc(pPngStruct, sizeof(png_byte) * width * pixel_size);
+ png_malloc(pPngStruct, sizeof(png_byte) * width * pixel_size);
row_pointers[y] = (png_bytep)row;
for (x = 0; x < width; ++x) {
unsigned int curBlock = blocks[y * width + x];
case TBM_FORMAT_ARGB8888:
case TBM_FORMAT_XRGB8888:
_tdm_helper_dump_png(file, info.planes[0].ptr,
- info.planes[0].stride >> 2, info.height);
+ info.planes[0].stride >> 2, info.height);
break;
case TBM_FORMAT_YVU420:
case TBM_FORMAT_YUV420:
_tdm_helper_dump_raw(file,
- info.planes[0].ptr,
- info.planes[0].stride * info.height,
- info.planes[1].ptr,
- info.planes[1].stride * (info.height >> 1),
- info.planes[2].ptr,
- info.planes[2].stride * (info.height >> 1));
+ info.planes[0].ptr,
+ info.planes[0].stride * info.height,
+ info.planes[1].ptr,
+ info.planes[1].stride * (info.height >> 1),
+ info.planes[2].ptr,
+ info.planes[2].stride * (info.height >> 1));
break;
case TBM_FORMAT_NV12:
case TBM_FORMAT_NV21:
_tdm_helper_dump_raw(file,
- info.planes[0].ptr,
- info.planes[0].stride * info.height,
- info.planes[1].ptr,
- info.planes[1].stride * (info.height >> 1), NULL,
- 0);
+ info.planes[0].ptr,
+ info.planes[0].stride * info.height,
+ info.planes[1].ptr,
+ info.planes[1].stride * (info.height >> 1), NULL,
+ 0);
break;
case TBM_FORMAT_YUYV:
case TBM_FORMAT_UYVY:
_tdm_helper_dump_raw(file,
- info.planes[0].ptr,
- info.planes[0].stride * info.height, NULL, 0,
- NULL, 0);
+ info.planes[0].ptr,
+ info.planes[0].stride * info.height, NULL, 0,
+ NULL, 0);
break;
default:
- TDM_ERR("can't dump %c%c%c%c buffer", FOURCC_STR (info.format));
+ TDM_ERR("can't dump %c%c%c%c buffer", FOURCC_STR(info.format));
tbm_surface_unmap(buffer);
return;
}
/**************************************************************************
-
-libtdm
-
-Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
-
-Contact: Eunchul Kim <chulspro.kim@samsung.com>,
- JinYoung Jeon <jy0.jeon@samsung.com>,
- Taeheon Kim <th908.kim@samsung.com>,
- YoungJun Cho <yj44.cho@samsung.com>,
- SooChan Lim <sc1.lim@samsung.com>,
- Boram Park <sc1.lim@samsung.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+ *
+ * libtdm
+ *
+ * Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
+ *
+ * Contact: Eunchul Kim <chulspro.kim@samsung.com>,
+ * JinYoung Jeon <jy0.jeon@samsung.com>,
+ * Taeheon Kim <th908.kim@samsung.com>,
+ * YoungJun Cho <yj44.cho@samsung.com>,
+ * SooChan Lim <sc1.lim@samsung.com>,
+ * Boram Park <sc1.lim@samsung.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
**************************************************************************/
#ifndef _TDM_MACRO_H_
#endif
/* check condition */
-#define TDM_RETURN_IF_FAIL(cond) {\
- if (!(cond)) {\
- TDM_ERR ("'%s' failed", #cond);\
- return;\
- }\
+#define TDM_RETURN_IF_FAIL(cond) { \
+ if (!(cond)) { \
+ TDM_ERR("'%s' failed", #cond); \
+ return; \
+ } \
}
-#define TDM_RETURN_VAL_IF_FAIL(cond, val) {\
- if (!(cond)) {\
- TDM_ERR ("'%s' failed", #cond);\
- return val;\
- }\
+#define TDM_RETURN_VAL_IF_FAIL(cond, val) { \
+ if (!(cond)) { \
+ TDM_ERR("'%s' failed", #cond); \
+ return val; \
+ } \
}
-#define TDM_RETURN_VAL_IF_FAIL_WITH_ERROR(cond, error_v, val) {\
- if (!(cond)) {\
- TDM_ERR ("'%s' failed", #cond);\
- ret = error_v;\
- if (error) *error = ret;\
- return val;\
- }\
+#define TDM_RETURN_VAL_IF_FAIL_WITH_ERROR(cond, error_v, val) { \
+ if (!(cond)) { \
+ TDM_ERR("'%s' failed", #cond); \
+ ret = error_v; \
+ if (error) *error = ret; \
+ return val; \
+ } \
}
-#define TDM_WARNING_IF_FAIL(cond) {\
- if (!(cond))\
- TDM_ERR ("'%s' failed", #cond);\
+#define TDM_WARNING_IF_FAIL(cond) { \
+ if (!(cond)) \
+ TDM_ERR("'%s' failed", #cond); \
}
-#define TDM_GOTO_IF_FAIL(cond, dst) {\
- if (!(cond)) {\
- TDM_ERR ("'%s' failed", #cond);\
- goto dst;\
- }\
+#define TDM_GOTO_IF_FAIL(cond, dst) { \
+ if (!(cond)) { \
+ TDM_ERR("'%s' failed", #cond); \
+ goto dst; \
+ } \
}
#define TDM_NEVER_GET_HERE() TDM_ERR("** NEVER GET HERE **")
#define TDM_SNPRINTF(p, len, fmt, ARG...) \
- do { \
- if (p && len && *len > 0) \
- { \
- int s = snprintf(p, *len, fmt, ##ARG); \
- p += s; \
- *len -= s; \
- } \
- } while (0)
-
-#define C(b,m) (((b) >> (m)) & 0xFF)
-#define B(c,s) ((((unsigned int)(c)) & 0xff) << (s))
-#define FOURCC(a,b,c,d) (B(d,24) | B(c,16) | B(b,8) | B(a,0))
-#define FOURCC_STR(id) C(id,0), C(id,8), C(id,16), C(id,24)
-#define FOURCC_ID(str) FOURCC(((char*)str)[0],((char*)str)[1],((char*)str)[2],((char*)str)[3])
+ do { \
+ if (p && len && *len > 0) { \
+ int s = snprintf(p, *len, fmt, ##ARG); \
+ p += s; \
+ *len -= s; \
+ } \
+ } while (0)
+
+#define C(b, m) (((b) >> (m)) & 0xFF)
+#define B(c, s) ((((unsigned int)(c)) & 0xff) << (s))
+#define FOURCC(a, b, c, d) (B(d, 24) | B(c, 16) | B(b, 8) | B(a, 0))
+#define FOURCC_STR(id) C(id, 0), C(id, 8), C(id, 16), C(id, 24)
+#define FOURCC_ID(str) FOURCC(((char*)str)[0], ((char*)str)[1], ((char*)str)[2], ((char*)str)[3])
#ifdef __cplusplus
}
/**************************************************************************
-
-libtdm
-
-Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
-
-Contact: Eunchul Kim <chulspro.kim@samsung.com>,
- JinYoung Jeon <jy0.jeon@samsung.com>,
- Taeheon Kim <th908.kim@samsung.com>,
- YoungJun Cho <yj44.cho@samsung.com>,
- SooChan Lim <sc1.lim@samsung.com>,
- Boram Park <sc1.lim@samsung.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+ *
+ * libtdm
+ *
+ * Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
+ *
+ * Contact: Eunchul Kim <chulspro.kim@samsung.com>,
+ * JinYoung Jeon <jy0.jeon@samsung.com>,
+ * Taeheon Kim <th908.kim@samsung.com>,
+ * YoungJun Cho <yj44.cho@samsung.com>,
+ * SooChan Lim <sc1.lim@samsung.com>,
+ * Boram Park <sc1.lim@samsung.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
**************************************************************************/
#ifdef HAVE_CONFIG_H
#include "tdm_private.h"
#define PP_FUNC_ENTRY() \
- tdm_func_pp *func_pp; \
- tdm_private_display *private_display; \
- tdm_private_pp *private_pp; \
- tdm_error ret = TDM_ERROR_NONE; \
- TDM_RETURN_VAL_IF_FAIL(pp != NULL, TDM_ERROR_INVALID_PARAMETER); \
- private_pp = (tdm_private_pp*)pp; \
- private_display = private_pp->private_display; \
- func_pp = &private_display->func_pp
+ tdm_func_pp *func_pp; \
+ tdm_private_display *private_display; \
+ tdm_private_pp *private_pp; \
+ tdm_error ret = TDM_ERROR_NONE; \
+ TDM_RETURN_VAL_IF_FAIL(pp != NULL, TDM_ERROR_INVALID_PARAMETER); \
+ private_pp = (tdm_private_pp*)pp; \
+ private_display = private_pp->private_display; \
+ func_pp = &private_display->func_pp
static tdm_error
_tdm_pp_check_if_exist(tdm_private_pp *private_pp,
- tbm_surface_h src, tbm_surface_h dst)
+ tbm_surface_h src, tbm_surface_h dst)
{
tdm_buffer_info *buf_info = NULL;
INTERN void
tdm_pp_cb_done(tdm_pp *pp_backend, tbm_surface_h src, tbm_surface_h dst,
- void *user_data)
+ void *user_data)
{
tdm_private_pp *private_pp = user_data;
tdm_private_display *private_display = private_pp->private_display;
}
TDM_INFO("pp(%p) info: src(%dx%d %d,%d %dx%d %c%c%c%c) dst(%dx%d %d,%d %dx%d %c%c%c%c) trans(%d) sync(%d) flags(%x)",
- private_pp, info->src_config.size.h, info->src_config.size.v,
- info->src_config.pos.x, info->src_config.pos.y,
- info->src_config.pos.w, info->src_config.pos.h,
- FOURCC_STR(info->src_config.format),
- info->dst_config.size.h, info->dst_config.size.v,
- info->dst_config.pos.x, info->dst_config.pos.y,
- info->dst_config.pos.w, info->dst_config.pos.h,
- FOURCC_STR(info->dst_config.format),
- info->transform, info->sync, info->flags);
+ private_pp, info->src_config.size.h, info->src_config.size.v,
+ info->src_config.pos.x, info->src_config.pos.y,
+ info->src_config.pos.w, info->src_config.pos.h,
+ FOURCC_STR(info->src_config.format),
+ info->dst_config.size.h, info->dst_config.size.v,
+ info->dst_config.pos.x, info->dst_config.pos.y,
+ info->dst_config.pos.w, info->dst_config.pos.h,
+ FOURCC_STR(info->dst_config.format),
+ info->transform, info->sync, info->flags);
ret = func_pp->pp_set_info(private_pp->pp_backend, info);
TDM_WARNING_IF_FAIL(ret == TDM_ERROR_NONE);
if (tdm_display_check_module_abi(private_display, 1, 2) &&
private_display->caps_pp.max_attach_count > 0) {
int length = LIST_LENGTH(&private_pp->src_pending_buffer_list) +
- LIST_LENGTH(&private_pp->src_buffer_list);
+ LIST_LENGTH(&private_pp->src_buffer_list);
if (length >= private_display->caps_pp.max_attach_count) {
_pthread_mutex_unlock(&private_display->lock);
TDM_DBG("failed: too many attached!! max_attach_count(%d)",
- private_display->caps_pp.max_attach_count);
+ private_display->caps_pp.max_attach_count);
return TDM_ERROR_BAD_REQUEST;
}
}
/**************************************************************************
-
-libtdm
-
-Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
-
-Contact: Eunchul Kim <chulspro.kim@samsung.com>,
- JinYoung Jeon <jy0.jeon@samsung.com>,
- Taeheon Kim <th908.kim@samsung.com>,
- YoungJun Cho <yj44.cho@samsung.com>,
- SooChan Lim <sc1.lim@samsung.com>,
- Boram Park <sc1.lim@samsung.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+ *
+ * libtdm
+ *
+ * Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
+ *
+ * Contact: Eunchul Kim <chulspro.kim@samsung.com>,
+ * JinYoung Jeon <jy0.jeon@samsung.com>,
+ * Taeheon Kim <th908.kim@samsung.com>,
+ * YoungJun Cho <yj44.cho@samsung.com>,
+ * SooChan Lim <sc1.lim@samsung.com>,
+ * Boram Park <sc1.lim@samsung.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
**************************************************************************/
#ifndef _TDM_PRIVATE_H_
prototype_name_fn(status);
typedef enum {
- TDM_CAPTURE_TARGET_OUTPUT,
- TDM_CAPTURE_TARGET_LAYER,
+ TDM_CAPTURE_TARGET_OUTPUT,
+ TDM_CAPTURE_TARGET_LAYER,
} tdm_capture_target;
typedef struct _tdm_private_display tdm_private_display;
tdm_private_output *
tdm_display_find_output_stamp(tdm_private_display *private_display,
- unsigned long stamp);
+ unsigned long stamp);
tdm_private_pp *
tdm_pp_find_stamp(tdm_private_display *private_display, unsigned long stamp);
tdm_private_capture *
void
tdm_output_cb_vblank(tdm_output *output_backend, unsigned int sequence,
- unsigned int tv_sec, unsigned int tv_usec, void *user_data);
+ unsigned int tv_sec, unsigned int tv_usec, void *user_data);
void
tdm_output_cb_commit(tdm_output *output_backend, unsigned int sequence,
- unsigned int tv_sec, unsigned int tv_usec, void *user_data);
+ unsigned int tv_sec, unsigned int tv_usec, void *user_data);
void
tdm_output_cb_status(tdm_output *output_backend, tdm_output_conn_status status,
- void *user_data);
+ void *user_data);
void
tdm_pp_cb_done(tdm_pp *pp_backend, tbm_surface_h src, tbm_surface_h dst,
- void *user_data);
+ void *user_data);
void
tdm_capture_cb_done(tdm_capture *capture_backend, tbm_surface_h buffer,
- void *user_data);
+ void *user_data);
void
tdm_output_call_change_handler_internal(tdm_private_output *private_output,
- struct list_head *change_handler_list,
- tdm_output_change_type type,
- tdm_value value);
+ struct list_head *change_handler_list,
+ tdm_output_change_type type,
+ tdm_value value);
tdm_private_pp *
tdm_pp_create_internal(tdm_private_display *private_display, tdm_error *error);
tdm_private_capture *
tdm_capture_create_output_internal(tdm_private_output *private_output,
- tdm_error *error);
+ tdm_error *error);
tdm_private_capture *
tdm_capture_create_layer_internal(tdm_private_layer *private_layer,
- tdm_error *error);
+ tdm_error *error);
void
tdm_capture_destroy_internal(tdm_private_capture *private_capture);
tdm_error
tdm_display_update_output(tdm_private_display *private_display,
- tdm_output *output_backend, int pipe);
+ tdm_output *output_backend, int pipe);
#ifdef __cplusplus
}
/**************************************************************************
-
-libtdm
-
-Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
-
-Contact: Eunchul Kim <chulspro.kim@samsung.com>,
- JinYoung Jeon <jy0.jeon@samsung.com>,
- Taeheon Kim <th908.kim@samsung.com>,
- YoungJun Cho <yj44.cho@samsung.com>,
- SooChan Lim <sc1.lim@samsung.com>,
- Boram Park <sc1.lim@samsung.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+ *
+ * libtdm
+ *
+ * Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
+ *
+ * Contact: Eunchul Kim <chulspro.kim@samsung.com>,
+ * JinYoung Jeon <jy0.jeon@samsung.com>,
+ * Taeheon Kim <th908.kim@samsung.com>,
+ * YoungJun Cho <yj44.cho@samsung.com>,
+ * SooChan Lim <sc1.lim@samsung.com>,
+ * Boram Park <sc1.lim@samsung.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
**************************************************************************/
#ifdef HAVE_CONFIG_H
static void
_tdm_server_send_done(tdm_server_vblank_info *vblank_info, unsigned int sequence,
- unsigned int tv_sec, unsigned int tv_usec);
+ unsigned int tv_sec, unsigned int tv_usec);
static tdm_error
_tdm_server_cb_timer(void *user_data)
tdm_server_vblank_info *vblank_info = (tdm_server_vblank_info*)user_data;
_tdm_server_send_done(vblank_info, 0,
- vblank_info->timer_target_sec,
- vblank_info->timer_target_usec);
+ vblank_info->timer_target_sec,
+ vblank_info->timer_target_usec);
return TDM_ERROR_NONE;
}
if (!vblank_info->timer_source) {
vblank_info->timer_source =
tdm_event_loop_add_timer_handler(private_loop->dpy,
- _tdm_server_cb_timer,
- vblank_info,
- NULL);
+ _tdm_server_cb_timer,
+ vblank_info,
+ NULL);
if (!vblank_info->timer_source) {
TDM_ERR("couldn't add timer");
tdm_display_unlock(private_loop->dpy);
next += (unsigned long)client_info->vblank_gap;
TDM_DBG("last(%.6lu) req(%.6lu) curr(%.6lu) prev_req(%.6lu) next(%.6lu)",
- last, req, curr, prev_req, next);
+ last, req, curr, prev_req, next);
ms_delay = (unsigned int)ceil((double)(next - curr) / 1000);
if (ms_delay == 0)
static void
_tdm_server_send_done(tdm_server_vblank_info *vblank_info, unsigned int sequence,
- unsigned int tv_sec, unsigned int tv_usec)
+ unsigned int tv_sec, unsigned int tv_usec)
{
tdm_server_vblank_info *found;
tdm_server_client_info *client_info;
return;
LIST_FIND_ITEM(vblank_info, &keep_private_server->vblank_list,
- tdm_server_vblank_info, link, found);
+ tdm_server_vblank_info, link, found);
if (!found) {
TDM_DBG("vblank_info(%p) is destroyed", vblank_info);
return;
client_info->last_tv_usec = tv_usec;
TDM_DBG("wl_tdm_vblank@%d done. tv(%lu) curr(%lu)",
- wl_resource_get_id(vblank_info->resource), vtime, curr);
+ wl_resource_get_id(vblank_info->resource), vtime, curr);
if (tdm_debug_server) {
if (curr - vtime > 1000) /* 1ms */
static void
_tdm_server_cb_output_vblank(tdm_output *output, unsigned int sequence,
- unsigned int tv_sec, unsigned int tv_usec,
- void *user_data)
+ unsigned int tv_sec, unsigned int tv_usec,
+ void *user_data)
{
tdm_server_vblank_info *vblank_info = (tdm_server_vblank_info*)user_data;
static void
_tdm_server_client_cb_wait_vblank(struct wl_client *client,
- struct wl_resource *resource,
- uint32_t id, const char *name,
- int32_t sw_timer, int32_t interval,
- uint32_t req_sec, uint32_t req_usec)
+ struct wl_resource *resource,
+ uint32_t id, const char *name,
+ int32_t sw_timer, int32_t interval,
+ uint32_t req_sec, uint32_t req_usec)
{
tdm_server_client_info *client_info = wl_resource_get_user_data(resource);
tdm_private_server *private_server = client_info->private_server;
tdm_display_get_output_count(private_loop->dpy, &count);
for (i = 0; i < count; i++) {
- tdm_output *output= tdm_display_get_output(private_loop->dpy, i, NULL);
+ tdm_output *output = tdm_display_get_output(private_loop->dpy, i, NULL);
tdm_output_conn_status status;
ret = tdm_output_get_conn_status(output, &status);
if (!found) {
wl_resource_post_error(resource, WL_TDM_CLIENT_ERROR_INVALID_NAME,
- "There is no '%s' output", name);
+ "There is no '%s' output", name);
TDM_ERR("There is no '%s' output", name);
return;
}
tdm_output_get_mode(client_info->vblank_output, &mode);
if (!mode || mode->vrefresh <= 0) {
wl_resource_post_error(resource, WL_TDM_CLIENT_ERROR_OPERATION_FAILED,
- "couldn't get mode of %s", name);
+ "couldn't get mode of %s", name);
TDM_ERR("couldn't get mode of %s", name);
return;
}
if (dpms_value != TDM_OUTPUT_DPMS_ON && !sw_timer) {
wl_resource_post_error(resource, WL_TDM_CLIENT_ERROR_DPMS_OFF,
- "dpms '%s'", tdm_get_dpms_str(dpms_value));
+ "dpms '%s'", tdm_get_dpms_str(dpms_value));
TDM_ERR("dpms '%s'", tdm_get_dpms_str(dpms_value));
return;
}
- vblank_info = calloc(1, sizeof *vblank_info);
+ vblank_info = calloc(1, sizeof * vblank_info);
if (!vblank_info) {
wl_resource_post_no_memory(resource);
TDM_ERR("alloc failed");
vblank_resource =
wl_resource_create(client, &wl_tdm_vblank_interface,
- wl_resource_get_version(resource), id);
+ wl_resource_get_version(resource), id);
if (!vblank_resource) {
wl_resource_post_no_memory(resource);
TDM_ERR("wl_resource_create failed");
if (dpms_value == TDM_OUTPUT_DPMS_ON) {
ret = tdm_output_wait_vblank(found, interval, 0,
- _tdm_server_cb_output_vblank, vblank_info);
+ _tdm_server_cb_output_vblank, vblank_info);
if (ret != TDM_ERROR_NONE) {
wl_resource_post_error(resource, WL_TDM_CLIENT_ERROR_OPERATION_FAILED,
- "couldn't wait vblank for %s", name);
+ "couldn't wait vblank for %s", name);
TDM_ERR("couldn't wait vblank for %s", name);
goto destroy_resource;
}
ret = _tdm_server_update_timer(vblank_info, interval);
if (ret != TDM_ERROR_NONE) {
wl_resource_post_error(resource, WL_TDM_CLIENT_ERROR_OPERATION_FAILED,
- "couldn't update timer for %s", name);
+ "couldn't update timer for %s", name);
TDM_ERR("couldn't update timer for %s", name);
goto destroy_resource;
}
} else {
wl_resource_post_error(resource, WL_TDM_CLIENT_ERROR_OPERATION_FAILED,
- "bad implementation");
+ "bad implementation");
TDM_NEVER_GET_HERE();
goto destroy_resource;
}
wl_resource_set_implementation(vblank_resource, NULL, vblank_info,
- destroy_vblank_callback);
+ destroy_vblank_callback);
LIST_ADDTAIL(&vblank_info->link, &private_server->vblank_list);
return;
static void
_tdm_server_cb_create_client(struct wl_client *client,
- struct wl_resource *resource, uint32_t id)
+ struct wl_resource *resource, uint32_t id)
{
tdm_private_server *private_server = wl_resource_get_user_data(resource);
tdm_server_client_info *client_info;
struct wl_resource *client_resource;
- client_info = calloc(1, sizeof *client_info);
+ client_info = calloc(1, sizeof * client_info);
if (!client_info) {
wl_resource_post_no_memory(resource);
TDM_ERR("alloc failed");
client_resource =
wl_resource_create(client, &wl_tdm_client_interface,
- wl_resource_get_version(resource), id);
+ wl_resource_get_version(resource), id);
if (!client_resource) {
wl_resource_post_no_memory(resource);
free(client_info);
client_info->resource = client_resource;
wl_resource_set_implementation(client_resource, &tdm_client_implementation,
- client_info, destroy_client_callback);
+ client_info, destroy_client_callback);
LIST_ADDTAIL(&client_info->link, &private_server->client_list);
}
static void
_tdm_server_bind(struct wl_client *client, void *data,
- uint32_t version, uint32_t id)
+ uint32_t version, uint32_t id)
{
struct wl_resource *resource;
TDM_RETURN_VAL_IF_FAIL(private_loop, TDM_ERROR_OPERATION_FAILED);
TDM_RETURN_VAL_IF_FAIL(private_loop->wl_display, TDM_ERROR_OPERATION_FAILED);
- if(wl_display_add_socket(private_loop->wl_display, "tdm-socket")) {
+ if (wl_display_add_socket(private_loop->wl_display, "tdm-socket")) {
TDM_ERR("createing a tdm-socket failed");
return TDM_ERROR_OPERATION_FAILED;
}
- private_server = calloc(1, sizeof *private_server);
+ private_server = calloc(1, sizeof * private_server);
if (!private_server) {
TDM_ERR("alloc failed");
return TDM_ERROR_OUT_OF_MEMORY;
LIST_INITHEAD(&private_server->vblank_list);
if (!wl_global_create(private_loop->wl_display, &wl_tdm_interface, 1,
- private_server, _tdm_server_bind)) {
+ private_server, _tdm_server_bind)) {
TDM_ERR("creating a global resource failed");
free(private_server);
return TDM_ERROR_OUT_OF_MEMORY;
/**************************************************************************
-
-libtdm
-
-Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
-
-Contact: Eunchul Kim <chulspro.kim@samsung.com>,
- JinYoung Jeon <jy0.jeon@samsung.com>,
- Taeheon Kim <th908.kim@samsung.com>,
- YoungJun Cho <yj44.cho@samsung.com>,
- SooChan Lim <sc1.lim@samsung.com>,
- Boram Park <sc1.lim@samsung.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+ *
+ * libtdm
+ *
+ * Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
+ *
+ * Contact: Eunchul Kim <chulspro.kim@samsung.com>,
+ * JinYoung Jeon <jy0.jeon@samsung.com>,
+ * Taeheon Kim <th908.kim@samsung.com>,
+ * YoungJun Cho <yj44.cho@samsung.com>,
+ * SooChan Lim <sc1.lim@samsung.com>,
+ * Boram Park <sc1.lim@samsung.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
**************************************************************************/
#ifdef HAVE_CONFIG_H
private_thread->thread_tid = syscall(SYS_gettid);
TDM_INFO("display_tid:%d, thread_tid: %d",
- private_thread->display_tid, private_thread->thread_tid);
+ private_thread->display_tid, private_thread->thread_tid);
fd = tdm_event_loop_get_fd(private_loop->dpy);
if (fd < 0) {
/* enable as default */
thread = getenv("TDM_THREAD");
if (!thread || strncmp(thread, "1", 1)) {
- TDM_INFO("not using a TDM event thread: %s", (thread)?thread:"none");
+ TDM_INFO("not using a TDM event thread: %s", (thread) ? thread : "none");
return TDM_ERROR_NONE;
}
- private_thread = calloc(1, sizeof *private_thread);
+ private_thread = calloc(1, sizeof * private_thread);
if (!private_thread) {
TDM_ERR("alloc failed");
return TDM_ERROR_OUT_OF_MEMORY;
private_thread->display_tid = syscall(SYS_gettid);
pthread_create(&private_thread->event_thread, NULL, _tdm_thread_main,
- private_thread);
+ private_thread);
keep_private_thread = private_thread;
TDM_INFO("using a TDM event thread. pipe(%d,%d)",
- private_thread->pipe[0], private_thread->pipe[1]);
+ private_thread->pipe[0], private_thread->pipe[1]);
return TDM_ERROR_NONE;
}
if (tdm_debug_thread)
TDM_INFO("fd(%d) type(%d), length(%d)",
- private_thread->pipe[1], base->type, base->length);
+ private_thread->pipe[1], base->type, base->length);
len = write(private_thread->pipe[1], base, base->length);
if (len != base->length) {
if (len == 0)
return TDM_ERROR_NONE;
- if (len < sizeof *base) {
+ if (len < sizeof * base) {
TDM_NEVER_GET_HERE();
return TDM_ERROR_OPERATION_FAILED;
}
if (tdm_debug_thread)
TDM_INFO("type(%d), length(%d)", base->type, base->length);
switch (base->type) {
- case TDM_THREAD_CB_OUTPUT_COMMIT:
- {
+ case TDM_THREAD_CB_OUTPUT_COMMIT: {
tdm_thread_cb_output_commit *output_commit = (tdm_thread_cb_output_commit*)base;
tdm_output *output_backend =
tdm_display_find_output_stamp(private_loop->dpy, output_commit->output_stamp);
break;
}
tdm_output_cb_commit(output_backend, output_commit->sequence,
- output_commit->tv_sec, output_commit->tv_usec,
- output_commit->user_data);
+ output_commit->tv_sec, output_commit->tv_usec,
+ output_commit->user_data);
break;
}
- case TDM_THREAD_CB_OUTPUT_VBLANK:
- {
+ case TDM_THREAD_CB_OUTPUT_VBLANK: {
tdm_thread_cb_output_vblank *output_vblank = (tdm_thread_cb_output_vblank*)base;
tdm_output *output_backend =
tdm_display_find_output_stamp(private_loop->dpy, output_vblank->output_stamp);
break;
}
tdm_output_cb_vblank(output_backend, output_vblank->sequence,
- output_vblank->tv_sec, output_vblank->tv_usec,
- output_vblank->user_data);
+ output_vblank->tv_sec, output_vblank->tv_usec,
+ output_vblank->user_data);
break;
}
- case TDM_THREAD_CB_OUTPUT_STATUS:
- {
+ case TDM_THREAD_CB_OUTPUT_STATUS: {
tdm_thread_cb_output_status *output_status = (tdm_thread_cb_output_status*)base;
tdm_output *output_backend =
tdm_display_find_output_stamp(private_loop->dpy, output_status->output_stamp);
break;
}
tdm_output_cb_status(output_backend, output_status->status,
- output_status->user_data);
+ output_status->user_data);
break;
}
- case TDM_THREAD_CB_PP_DONE:
- {
+ case TDM_THREAD_CB_PP_DONE: {
tdm_thread_cb_pp_done *pp_done = (tdm_thread_cb_pp_done*)base;
tdm_pp *pp_backend =
tdm_pp_find_stamp(private_loop->dpy, pp_done->pp_stamp);
tdm_pp_cb_done(pp_backend, pp_done->src, pp_done->dst, pp_done->user_data);
break;
}
- case TDM_THREAD_CB_CAPTURE_DONE:
- {
+ case TDM_THREAD_CB_CAPTURE_DONE: {
tdm_thread_cb_capture_done *capture_done = (tdm_thread_cb_capture_done*)base;
tdm_capture *capture_backend =
tdm_capture_find_stamp(private_loop->dpy, capture_done->capture_stamp);
-/*
-Copyright (C) 2015 Samsung Electronics co., Ltd. All Rights Reserved.
-
-Contact:
- Changyeon Lee <cyeon.lee@samsung.com>,
- JunKyeong Kim <jk0430.kim@samsung.com>,
- Boram Park <boram1288.park@samsung.com>,
- SooChan Lim <sc1.lim@samsung.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without limitation
-the rights to use, copy, modify, merge, publish, distribute, sublicense,
-and/or sell copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice (including the next
-paragraph) shall be included in all copies or substantial portions of the
-Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
-*/
+/**************************************************************************
+ *
+ * libtdm
+ *
+ * Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
+ *
+ * Contact: Eunchul Kim <chulspro.kim@samsung.com>,
+ * JinYoung Jeon <jy0.jeon@samsung.com>,
+ * Taeheon Kim <th908.kim@samsung.com>,
+ * YoungJun Cho <yj44.cho@samsung.com>,
+ * SooChan Lim <sc1.lim@samsung.com>,
+ * Boram Park <sc1.lim@samsung.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+**************************************************************************/
#include <stdio.h>
#include <stdlib.h>
static void
_client_vblank_handler(unsigned int sequence, unsigned int tv_sec,
- unsigned int tv_usec, void *user_data)
+ unsigned int tv_usec, void *user_data)
{
int client, vblank;
static int prev = 0;
int ret;
error = tdm_client_wait_vblank(client, "unknown-0", 1, 1, sync,
- _client_vblank_handler, NULL);
+ _client_vblank_handler, NULL);
if (error != TDM_CLIENT_ERROR_NONE) {
printf("tdm_client_wait_vblank failed\n");
goto done;