From 9ae5ef8bf6b561c9dd6b5a05367b8f9a64ee0973 Mon Sep 17 00:00:00 2001 From: Chanwoo Choi Date: Thu, 10 Feb 2022 19:13:48 +0900 Subject: [PATCH] resource: display: Fix error when get_fps_info return null When enlightenment doesn't draw the anything, get_fps_info of enlightenment doesn't return the fps information with null. DISPLAY_FPS returns the 0.0 for handling this case. And add RESOURCE_DRIVER_NO_DEVICE flag to display resource driver. Change-Id: I4087e97f49231ab45bd1ce88a17a0cca5baf3441 Signed-off-by: Chanwoo Choi --- src/resource/resource-display.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/resource/resource-display.c b/src/resource/resource-display.c index 7434721..7210af2 100644 --- a/src/resource/resource-display.c +++ b/src/resource/resource-display.c @@ -93,8 +93,8 @@ static int display_get_fps(const struct resource *res, /* Parse the received data */ result = g_variant_get_child_value(g_dbus_message_get_body(reply), 0); if (g_variant_n_children(result) <= res->index) { - ret = -EINVAL; - goto err_reply; + fps_data.fps = 0.0; + goto out; } /* Get the fps information according to the index of resource_device */ @@ -103,6 +103,7 @@ static int display_get_fps(const struct resource *res, &fps_data.type, fps_data.output, &fps_data.zpos, &fps_data.window, &fps_data.fps); +out: *data = (void *)(intptr_t)fps_data.fps; err_reply: @@ -131,5 +132,6 @@ static const struct resource_driver display_resource_driver = { .type = RESOURCE_TYPE_DISPLAY, .attrs = display_attrs, .num_attrs = ARRAY_SIZE(display_attrs), + .flags = RESOURCE_DRIVER_NO_DEVICE, }; RESOURCE_DRIVER_REGISTER(&display_resource_driver) -- 2.7.4