From: Seunghun Lee Date: Thu, 3 Mar 2022 09:03:25 +0000 (+0900) Subject: examples: Use output mode instead of arbitrary size X-Git-Tag: submit/tizen/20220720.024540~101 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7f7bb930fcef308974d56fb0fd0d2e37e9347ceb;p=platform%2Fcore%2Fuifw%2Flibds-tizen.git examples: Use output mode instead of arbitrary size Change-Id: I46b576bccbd469ed386dc4d284a7a71311e557af --- diff --git a/src/examples/tinyds-tdm.c b/src/examples/tinyds-tdm.c index 4207fb1..3841b84 100644 --- a/src/examples/tinyds-tdm.c +++ b/src/examples/tinyds-tdm.c @@ -22,9 +22,6 @@ #define TINYDS_UNUSED __attribute__((unused)) -#define OUTPUT_WIDTH 1280 -#define OUTPUT_HEIGHT 720 - struct tinyds_output { struct tinyds_server *server; @@ -223,6 +220,7 @@ backend_handle_new_output(struct wl_listener *listener, void *data) struct tinyds_server *server; struct tinyds_output *output; struct ds_output *ds_output; + const struct ds_output_mode *mode; server = wl_container_of(listener, server, new_output); ds_output = data; @@ -232,6 +230,9 @@ backend_handle_new_output(struct wl_listener *listener, void *data) if (server->output) return; + mode = ds_output_preferred_mode(ds_output); + ds_output_set_mode(ds_output, mode); + output = calloc(1, sizeof *output); if (!output) return; @@ -243,7 +244,7 @@ backend_handle_new_output(struct wl_listener *listener, void *data) } output->swapchain = ds_swapchain_create(output->allocator, - OUTPUT_WIDTH, OUTPUT_HEIGHT, DRM_FORMAT_XRGB8888); // FIXME output mode + mode->width, mode->height, DRM_FORMAT_XRGB8888); if (!output->swapchain) { ds_allocator_destroy(output->allocator); free(output);