[PATCH 5/6] compositor-drm: Fix refresh rate selection in drm_output_switch_mode

Mario Kleiner mario.kleiner.de at gmail.com
Wed Apr 1 22:10:53 PDT 2015


The matching logic in choose_mode() compared refresh rate
of a drm_mode candidate mode expressed in Hz against the
requested refresh rate of the target weston_mode expressed
in milliHz, so the match always failed and the logic always
ended up the mode with the highest refresh rate for a given
resolution, instead of the one matching the requested rate.

Match proper fields to fix this.

Signed-off-by: Mario Kleiner <mario.kleiner.de at gmail.com>
---
 src/compositor-drm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/compositor-drm.c b/src/compositor-drm.c
index 9ddb6d6..396938f 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
@@ -1270,7 +1270,7 @@ choose_mode (struct drm_output *output, struct weston_mode *target_mode)
 	wl_list_for_each(mode, &output->base.mode_list, base.link) {
 		if (mode->mode_info.hdisplay == target_mode->width &&
 		    mode->mode_info.vdisplay == target_mode->height) {
-			if (mode->mode_info.vrefresh == target_mode->refresh || 
+			if (mode->base.refresh == target_mode->refresh ||
           		    target_mode->refresh == 0) {
 				return mode;
 			} else if (!tmp_mode) 
-- 
1.9.1



More information about the wayland-devel mailing list