From df5d9204977983ae215d9e23325338016c893f09 Mon Sep 17 00:00:00 2001 From: Seunghun Lee Date: Fri, 3 Aug 2018 11:21:10 +0900 Subject: [PATCH 1/1] Revert "virtual (client): Added implementation for setting available format." This reverts commit 7e7fcd357fbec8140bb607ba4f9417baef49f747. Change-Id: Ieac70ebde6f66460664bbae1f10687368b0e64aa --- client/tdm_client.c | 56 ------------------------------------------ client/tdm_client.h | 3 --- haltests/src/tc_tdm_client.cpp | 22 ----------------- protocol/tdm.xml | 4 --- src/tdm_server.c | 31 ----------------------- 5 files changed, 116 deletions(-) diff --git a/client/tdm_client.c b/client/tdm_client.c index 9aac858..92b1626 100644 --- a/client/tdm_client.c +++ b/client/tdm_client.c @@ -97,12 +97,6 @@ typedef struct _tdm_private_client_voutput { struct { int count; - tbm_format *formats; - } available_formats; - - struct - { - int count; tdm_client_output_mode *modes; } available_modes; @@ -1792,9 +1786,6 @@ tdm_client_voutput_destroy(tdm_client_voutput *voutput) if (private_voutput->available_modes.modes) free(private_voutput->available_modes.modes); - if (private_voutput->available_formats.formats) - free(private_voutput->available_formats.formats); - LIST_FOR_EACH_ENTRY_SAFE(h, hh, &private_voutput->commit_handler_list, link) { LIST_DEL(&h->link); free(h); @@ -1835,35 +1826,6 @@ tdm_client_voutput_set_available_modes(tdm_client_voutput *voutput, const tdm_cl } tdm_error -tdm_client_voutput_set_available_formats(tdm_client_voutput *voutput, const tbm_format *formats, const int count) -{ - tdm_private_client_voutput *private_voutput; - - TDM_RETURN_VAL_IF_FAIL(voutput != NULL, TDM_ERROR_INVALID_PARAMETER); - - if ((count > 0) && (formats == NULL)) - return TDM_ERROR_INVALID_PARAMETER; - - private_voutput = (tdm_private_client_voutput *)voutput; - - if (private_voutput->base.connection == TDM_OUTPUT_CONN_STATUS_CONNECTED) - return TDM_ERROR_BAD_REQUEST; - - if (private_voutput->available_formats.formats) - free(private_voutput->available_formats.formats); - - private_voutput->available_formats.count = count; - - if (count != 0) - { - private_voutput->available_formats.formats = calloc(count, sizeof(tbm_format)); - memcpy(private_voutput->available_formats.formats, formats, sizeof(tbm_format) * count); - } - - return TDM_ERROR_NONE; -} - -tdm_error tdm_client_voutput_set_physical_size(tdm_client_voutput *voutput, unsigned int mmWidth, unsigned int mmHeight) { tdm_private_client_voutput *private_voutput; @@ -2011,23 +1973,6 @@ tdm_client_output_set_mode(tdm_client_output *output, const tdm_client_output_mo } void -_tdm_client_voutput_send_available_formats(tdm_private_client_voutput *private_voutput) -{ - tbm_format *format; - struct wl_array array; - int i, size; - - size = sizeof(tbm_format); - wl_array_init(&array); - for (i = 0; i < private_voutput->available_formats.count; i++) { - format = wl_array_add(&array, size); - *format = private_voutput->available_formats.formats[i]; - } - wl_tdm_voutput_set_available_formats(private_voutput->wl_voutput, &array); - wl_array_release(&array); -} - -void _tdm_client_voutput_send_available_modes(tdm_private_client_voutput *private_voutput) { tdm_client_output_mode *modes, *mode; @@ -2063,7 +2008,6 @@ tdm_client_output_connect(tdm_client_output *output) private_output->connection = TDM_OUTPUT_CONN_STATUS_CONNECTED; _tdm_client_voutput_send_available_modes(private_voutput); - _tdm_client_voutput_send_available_formats(private_voutput); wl_tdm_voutput_set_physical_size(private_voutput->wl_voutput, private_voutput->mmwidth, private_voutput->mmheight); diff --git a/client/tdm_client.h b/client/tdm_client.h index d6dc32a..f431f1c 100644 --- a/client/tdm_client.h +++ b/client/tdm_client.h @@ -442,9 +442,6 @@ tdm_error tdm_client_voutput_set_available_modes(tdm_client_voutput *voutput, const tdm_client_output_mode *modes, int count); tdm_error -tdm_client_voutput_set_available_formats(tdm_client_voutput *voutput, const tbm_format *formats, const int count); - -tdm_error tdm_client_voutput_set_physical_size(tdm_client_voutput *voutput, unsigned int mmWidth, unsigned int mmHeight); tdm_error diff --git a/haltests/src/tc_tdm_client.cpp b/haltests/src/tc_tdm_client.cpp index fc43491..3d4aa47 100644 --- a/haltests/src/tc_tdm_client.cpp +++ b/haltests/src/tc_tdm_client.cpp @@ -1413,7 +1413,6 @@ protected: static tdm_client *client; static tdm_client_voutput *voutput; const int MODE_COUNT = 2; - const int FORMAT_COUNT = 2; private: static pid_t server_pid; @@ -1541,7 +1540,6 @@ _tc_tdm_client_virutual_make_available_mode(tdm_client_output_mode *modes, int c } } - TEST_F(TDMVirtualOutput, SetAvailableModes) { tdm_error ret; @@ -1567,19 +1565,6 @@ TEST_F(TDMVirtualOutput, FailTestSetAvailableModes) ASSERT_EQ(ret, TDM_ERROR_INVALID_PARAMETER); } -TEST_F(TDMVirtualOutput, SetAvailableFormats) -{ - const int nformats = 2; - tdm_error ret; - tbm_format formats[nformats]; - - formats[0] = TBM_FORMAT_ARGB8888; - formats[1] = TBM_FORMAT_XRGB8888; - - ret = tdm_client_voutput_set_available_formats(this->voutput, formats, nformats); - ASSERT_EQ(ret, TDM_ERROR_NONE); -} - TEST_F(TDMVirtualOutput, SetPhysicalSize) { tdm_error ret; @@ -1642,12 +1627,10 @@ TEST_F(TDMVirtualOutput, GetClientOutput) TEST_F(TDMVirtualOutput, Connect) { - const int nformats = 2; tdm_error ret; tdm_client_output *output; unsigned int mmWidth = 300, mmHeight = 150; tdm_client_output_mode modes[this->MODE_COUNT]; - tbm_format formats[nformats]; int count = this->MODE_COUNT; output = tdm_client_voutput_get_client_output(this->voutput, &ret); @@ -1661,11 +1644,6 @@ TEST_F(TDMVirtualOutput, Connect) ret = tdm_client_voutput_set_available_modes(this->voutput, modes, count); ASSERT_EQ(ret, TDM_ERROR_NONE); - formats[0] = TBM_FORMAT_ARGB8888; - formats[1] = TBM_FORMAT_XRGB8888; - ret = tdm_client_voutput_set_available_formats(this->voutput, formats, nformats); - ASSERT_EQ(ret, TDM_ERROR_NONE); - ret = tdm_client_output_connect(output); ASSERT_EQ(ret, TDM_ERROR_NONE); diff --git a/protocol/tdm.xml b/protocol/tdm.xml index 3de2c0f..b1d6699 100644 --- a/protocol/tdm.xml +++ b/protocol/tdm.xml @@ -81,10 +81,6 @@ - - - - diff --git a/src/tdm_server.c b/src/tdm_server.c index b99980b..c86de65 100644 --- a/src/tdm_server.c +++ b/src/tdm_server.c @@ -79,11 +79,6 @@ typedef struct _tdm_server_voutput_info { int count; tdm_output_mode *modes; } available_modes; - struct - { - int count; - tbm_format *formats; - } available_formats; unsigned int mmwidth; unsigned int mmheight; @@ -754,31 +749,6 @@ _tdm_voutput_cb_set_available_modes(struct wl_client *client, } static void -_tdm_voutput_cb_set_available_formats(struct wl_client *client, - struct wl_resource *resource, - struct wl_array *formats) -{ - tdm_server_voutput_info *voutput_info; - tbm_format *f; - int count = 0, i = 0; - - voutput_info = wl_resource_get_user_data(resource); - - voutput_info->available_formats.count = 0; - if (voutput_info->available_formats.formats) - free(voutput_info->available_formats.formats); - - wl_array_for_each(f, formats) - count++; - - voutput_info->available_formats.formats = malloc(count * sizeof(tbm_format)); - voutput_info->available_formats.count = count; - - wl_array_for_each(f, formats) - voutput_info->available_formats.formats[i++] = *f; -} - -static void _tdm_voutput_cb_set_physical_size(struct wl_client *client, struct wl_resource *resource, unsigned int mmwidth, unsigned int mmheight) { @@ -837,7 +807,6 @@ _tdm_voutput_cb_commit_done(struct wl_client *client, struct wl_resource *resour static const struct wl_tdm_voutput_interface tdm_voutput_implementation = { _tdm_voutput_cb_destroy, _tdm_voutput_cb_set_available_modes, - _tdm_voutput_cb_set_available_formats, _tdm_voutput_cb_set_physical_size, _tdm_voutput_cb_connect, _tdm_voutput_cb_disconnect, -- 2.7.4