From e5ebebe4a4bb7ad10ccf8a0e5e205142ffad213e Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 25 Aug 2015 11:24:14 +1000 Subject: [PATCH] driver-hidpp10: read resolution/refresh rate on demand Signed-off-by: Peter Hutterer --- src/driver-hidpp10.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/driver-hidpp10.c b/src/driver-hidpp10.c index 6b84620d..d544485b 100644 --- a/src/driver-hidpp10.c +++ b/src/driver-hidpp10.c @@ -88,13 +88,15 @@ hidpp10drv_read_profile(struct ratbag_profile *profile, unsigned int index) struct ratbag_device *device = profile->device; struct hidpp10drv_data *drv_data; struct hidpp10_device *hidpp10; + uint16_t xres, yres, refresh; drv_data = ratbag_get_drv_data(device); hidpp10 = &drv_data->dev; - /* FIXME: read this from device */ - profile->current_dpi = hidpp10->xres; - profile->report_rate = hidpp10->refresh_rate; + hidpp10_get_current_resolution(device, hidpp10, &xres, &yres); + hidpp10_get_usb_refresh_rate(device, hidpp10, &refresh); + profile->current_dpi = xres; + profile->report_rate = refresh; } static int