ivi-shell: remove ivi_layout_get_screens API
The compositor data struct already has a list of weston outputs. Therefore, this API is not required. Signed-off-by: Emre Ucan <eucan@de.adit-jv.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Acked-by: Wataru Natsume <wnatsume@jp.adit-jv.com>
This commit is contained in:
committed by
Pekka Paalanen
parent
ff6a9f8474
commit
3a8521e005
@@ -131,7 +131,6 @@ struct hmi_controller {
|
||||
struct ui_setting ui_setting;
|
||||
|
||||
int32_t screen_num;
|
||||
struct ivi_layout_screen **pp_screen;
|
||||
};
|
||||
|
||||
struct launcher_info {
|
||||
@@ -521,22 +520,6 @@ switch_mode(struct hmi_controller *hmi_ctrl,
|
||||
free(pp_surface);
|
||||
}
|
||||
|
||||
/**
|
||||
* Internal method to get screens from weston core
|
||||
* TODO: shall support hotplug of screens
|
||||
*/
|
||||
static int32_t
|
||||
get_screens(struct hmi_controller *hmi_ctrl)
|
||||
{
|
||||
hmi_ctrl->pp_screen = NULL;
|
||||
hmi_ctrl->screen_num = 0;
|
||||
ivi_layout_interface->get_screens(&hmi_ctrl->screen_num, &hmi_ctrl->pp_screen);
|
||||
|
||||
if (hmi_ctrl->pp_screen == NULL)
|
||||
return -1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Internal method to get ivi_layout_screen
|
||||
@@ -549,7 +532,7 @@ get_screen(int32_t screen_idx, struct hmi_controller *hmi_ctrl)
|
||||
if (screen_idx > hmi_ctrl->screen_num - 1)
|
||||
weston_log("Invalid index. Return NULL\n");
|
||||
else
|
||||
iviscrn = hmi_ctrl->pp_screen[screen_idx];
|
||||
iviscrn = ivi_layout_interface->get_screen_from_id(screen_idx);
|
||||
|
||||
return iviscrn;
|
||||
}
|
||||
@@ -767,7 +750,6 @@ hmi_controller_destroy(struct wl_listener *listener, void *data)
|
||||
|
||||
wl_array_release(&hmi_ctrl->ui_widgets);
|
||||
free(hmi_ctrl->hmi_setting);
|
||||
free(hmi_ctrl->pp_screen);
|
||||
free(hmi_ctrl);
|
||||
}
|
||||
|
||||
@@ -803,14 +785,9 @@ hmi_controller_create(struct weston_compositor *ec)
|
||||
hmi_ctrl->layout_mode = IVI_HMI_CONTROLLER_LAYOUT_MODE_TILING;
|
||||
hmi_ctrl->hmi_setting = hmi_server_setting_create(ec);
|
||||
hmi_ctrl->compositor = ec;
|
||||
hmi_ctrl->screen_num = wl_list_length(&ec->output_list);
|
||||
|
||||
/* TODO: shall support hotplug of screens */
|
||||
if (get_screens(hmi_ctrl) < 0) {
|
||||
weston_log("ivi-shell: Failed to get screens\n");
|
||||
hmi_ctrl = NULL;
|
||||
return hmi_ctrl;
|
||||
}
|
||||
|
||||
iviscrn = get_screen(0, hmi_ctrl);
|
||||
|
||||
/* init base ivi_layer*/
|
||||
|
||||
@@ -567,14 +567,6 @@ struct ivi_layout_interface {
|
||||
struct ivi_layout_screen *
|
||||
(*get_screen_from_id)(uint32_t id_screen);
|
||||
|
||||
/**
|
||||
* \brief Get the ivi_screens
|
||||
*
|
||||
* \return IVI_SUCCEEDED if the method call was successful
|
||||
* \return IVI_FAILED if the method call was failed
|
||||
*/
|
||||
int32_t (*get_screens)(int32_t *pLength, struct ivi_layout_screen ***ppArray);
|
||||
|
||||
/**
|
||||
* \brief Get the ivi_screens under the given ivi_layer
|
||||
*
|
||||
|
||||
@@ -1409,39 +1409,6 @@ ivi_layout_get_properties_of_layer(struct ivi_layout_layer *ivilayer)
|
||||
return &ivilayer->prop;
|
||||
}
|
||||
|
||||
static int32_t
|
||||
ivi_layout_get_screens(int32_t *pLength, struct ivi_layout_screen ***ppArray)
|
||||
{
|
||||
struct ivi_layout *layout = get_instance();
|
||||
struct ivi_layout_screen *iviscrn = NULL;
|
||||
int32_t length = 0;
|
||||
int32_t n = 0;
|
||||
|
||||
if (pLength == NULL || ppArray == NULL) {
|
||||
weston_log("ivi_layout_get_screens: invalid argument\n");
|
||||
return IVI_FAILED;
|
||||
}
|
||||
|
||||
length = wl_list_length(&layout->screen_list);
|
||||
|
||||
if (length != 0) {
|
||||
/* the Array must be free by module which called this function */
|
||||
*ppArray = calloc(length, sizeof(struct ivi_layout_screen *));
|
||||
if (*ppArray == NULL) {
|
||||
weston_log("fails to allocate memory\n");
|
||||
return IVI_FAILED;
|
||||
}
|
||||
|
||||
wl_list_for_each(iviscrn, &layout->screen_list, link) {
|
||||
(*ppArray)[n++] = iviscrn;
|
||||
}
|
||||
}
|
||||
|
||||
*pLength = length;
|
||||
|
||||
return IVI_SUCCEEDED;
|
||||
}
|
||||
|
||||
static int32_t
|
||||
ivi_layout_get_screens_under_layer(struct ivi_layout_layer *ivilayer,
|
||||
int32_t *pLength,
|
||||
@@ -2457,7 +2424,6 @@ static struct ivi_layout_interface ivi_layout_interface = {
|
||||
* screen controller interfaces part1
|
||||
*/
|
||||
.get_screen_from_id = ivi_layout_get_screen_from_id,
|
||||
.get_screens = ivi_layout_get_screens,
|
||||
.get_screens_under_layer = ivi_layout_get_screens_under_layer,
|
||||
.screen_add_layer = ivi_layout_screen_add_layer,
|
||||
.screen_set_render_order = ivi_layout_screen_set_render_order,
|
||||
|
||||
Reference in New Issue
Block a user