From: Chanwoo Choi Date: Thu, 10 Feb 2022 10:13:48 +0000 (+0900) Subject: resource: display: Fix error when get_fps_info return null X-Git-Tag: accepted/tizen/unified/20220302.131908~23 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F90%2F270990%2F1;p=platform%2Fcore%2Fsystem%2Fpass.git 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 --- 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)