hidpp20-drv: actually retrieve the current resolution value

The onboard profile do not store the current value but the default.
To retrieve the current value, we need to access the switchable resolution
feature.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
This commit is contained in:
Benjamin Tissoires
2016-05-10 11:35:17 +02:00
parent c1bf3be48e
commit 28438e638b

View File

@@ -592,7 +592,7 @@ hidpp20drv_read_profile_8100(struct ratbag_profile *profile, unsigned int index)
struct hidpp20drv_data *drv_data = ratbag_get_drv_data(device);
struct ratbag_resolution *res;
struct hidpp20_profile *p;
unsigned i, dpi;
unsigned i, dpi = 0;
hidpp20drv_read_onboard_profile(device, profile->index);
@@ -600,6 +600,10 @@ hidpp20drv_read_profile_8100(struct ratbag_profile *profile, unsigned int index)
if ((int)index == hidpp20drv_current_profile(device))
profile->is_active = true;
/* retrieve the resolution through 220X as the profile doesn't has it */
if (profile->is_active)
hidpp20drv_read_resolution_dpi(profile);
dpi = ratbag_resolution_get_dpi(profile->resolution.modes);
p = &drv_data->profiles->profiles[index];