From 41905377b07f3240402818a489d6b36956ba4e2a Mon Sep 17 00:00:00 2001 From: Boram Park Date: Sun, 14 Feb 2016 19:24:15 +0900 Subject: [PATCH] add maker, model, name to tdm_caps_output Change-Id: I12b393d4918e206a12392306a66b7b2006d05568 --- include/tdm.h | 10 ++++++++++ include/tdm_backend.h | 4 ++++ src/tdm.c | 3 +++ src/tdm_display.c | 19 +++++++++++++++++++ 4 files changed, 36 insertions(+) diff --git a/include/tdm.h b/include/tdm.h index 8380c3c..8c20863 100644 --- a/include/tdm.h +++ b/include/tdm.h @@ -193,6 +193,16 @@ tdm_output* tdm_display_get_output(tdm_display *dpy, int index, tdm_error *erro tdm_pp* tdm_display_create_pp(tdm_display *dpy, tdm_error *error); /** + * @brief Get the model information of a output object. + * @param[in] output A output object + * @param[out] maker The output maker. + * @param[out] model The output model. + * @param[out] name The output name. + * @return #TDM_ERROR_NONE if success. Otherwise, error value. + */ +tdm_error tdm_output_get_model_info(tdm_output *output, const char **maker, const char **model, const char **name); + +/** * @brief Get the connection status of a output object. * @param[in] output A output object * @param[out] status The connection status. diff --git a/include/tdm_backend.h b/include/tdm_backend.h index 951746c..f6b67ce 100644 --- a/include/tdm_backend.h +++ b/include/tdm_backend.h @@ -77,6 +77,10 @@ typedef struct _tdm_caps_display */ typedef struct _tdm_caps_output { + char maker[TDM_NAME_LEN]; /**< The output maker */ + char model[TDM_NAME_LEN]; /**< The output model */ + char name[TDM_NAME_LEN]; /**< The output name */ + tdm_output_conn_status status; /**< The connection status */ tdm_output_type type; /**< The connection type */ unsigned int type_id; /**< The connection type id */ diff --git a/src/tdm.c b/src/tdm.c index aaecef0..7562d4c 100644 --- a/src/tdm.c +++ b/src/tdm.c @@ -302,6 +302,9 @@ _tdm_display_update_caps_output(tdm_private_display *private_display, return TDM_ERROR_BAD_MODULE; } + TDM_DBG("output maker: %s", caps->maker); + TDM_DBG("output model: %s", caps->model); + TDM_DBG("output name: %s", caps->name); TDM_DBG("output status: %d", caps->status); TDM_DBG("output type : %d", caps->type); for (i = 0; i < caps->prop_count; i++) diff --git a/src/tdm_display.c b/src/tdm_display.c index e8c6484..d28cf94 100644 --- a/src/tdm_display.c +++ b/src/tdm_display.c @@ -365,6 +365,25 @@ tdm_display_create_pp(tdm_display *dpy, tdm_error *error) } EXTERN tdm_error +tdm_output_get_model_info(tdm_output *output, const char **maker, const char **model, const char **name) +{ + OUTPUT_FUNC_ENTRY(); + + pthread_mutex_lock(&private_display->lock); + + if (maker) + *maker = private_output->caps.maker; + if (model) + *model = private_output->caps.model; + if (name) + *name = private_output->caps.name; + + pthread_mutex_unlock(&private_display->lock); + + return ret; +} + +EXTERN tdm_error tdm_output_get_conn_status(tdm_output *output, tdm_output_conn_status *status) { OUTPUT_FUNC_ENTRY(); -- 2.7.4