resource: display: Fix error when get_fps_info return null 90/270990/1
authorChanwoo Choi <cw00.choi@samsung.com>
Thu, 10 Feb 2022 10:13:48 +0000 (19:13 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Mon, 14 Feb 2022 03:18:04 +0000 (12:18 +0900)
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 <cw00.choi@samsung.com>
src/resource/resource-display.c

index 7434721..7210af2 100644 (file)
@@ -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)