intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/6] drm: Store the calculated vrefresh in the user mode
@ 2018-06-28 19:42 Ville Syrjala
  2018-06-28 19:42 ` [PATCH 2/6] drm: Set mode->vrefresh before mode validation Ville Syrjala
                   ` (7 more replies)
  0 siblings, 8 replies; 13+ messages in thread
From: Ville Syrjala @ 2018-06-28 19:42 UTC (permalink / raw)
  To: dri-devel; +Cc: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Ignore the vrefresh in the mode the user passed in and instead
calculate the value based on the actual timings. This way we can
actually trust mode->vrefresh to some degree.

Or should we compare the user's idea of vrefresh with the one
we get from the timings and return an error if they differ? We
can't really be sure what the user is asking in that case.

v2: Set it before mode validation

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/drm_modes.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index 7f552d5fa88e..11d8224535ca 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -1702,7 +1702,11 @@ int drm_mode_convert_umode(struct drm_device *dev,
 	out->vsync_end = in->vsync_end;
 	out->vtotal = in->vtotal;
 	out->vscan = in->vscan;
-	out->vrefresh = in->vrefresh;
+	 /*
+	  * Ignore what the user is saying here and instead
+	  * calculate vrefresh based on the actual timings.
+	  */
+	out->vrefresh = 0;
 	out->flags = in->flags;
 	/*
 	 * Old xf86-video-vmware (possibly others too) used to
@@ -1738,6 +1742,8 @@ int drm_mode_convert_umode(struct drm_device *dev,
 		break;
 	}
 
+	out->vrefresh = drm_mode_vrefresh(out);
+
 	out->status = drm_mode_validate_driver(dev, out);
 	if (out->status != MODE_OK)
 		return -EINVAL;
-- 
2.16.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2018-07-03  9:19 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-28 19:42 [PATCH 1/6] drm: Store the calculated vrefresh in the user mode Ville Syrjala
2018-06-28 19:42 ` [PATCH 2/6] drm: Set mode->vrefresh before mode validation Ville Syrjala
2018-06-28 19:42 ` [PATCH 3/6] drm/i915/sdvo: Fix multi function encoder stuff Ville Syrjala
2018-06-28 19:42 ` [PATCH 4/6] drm/i915/sdvo: Utilize intel_panel for fixed_mode Ville Syrjala
2018-06-28 19:43 ` [PATCH 5/6] drm/i915: Make sure panel fixed_mode has vrefresh populated Ville Syrjala
2018-06-28 19:43 ` [PATCH 6/6] drm/i915: Filter out modes that don't match the fixed mode vrefresh Ville Syrjala
2018-07-02  7:46   ` Daniel Vetter
2018-07-02  9:52     ` Ville Syrjälä
2018-07-03  7:03       ` Daniel Vetter
2018-07-03  9:19         ` Chris Wilson
2018-06-28 19:57 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/6] drm: Store the calculated vrefresh in the user mode Patchwork
2018-06-28 20:14 ` ✓ Fi.CI.BAT: success " Patchwork
2018-06-28 22:51 ` ✓ Fi.CI.IGT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).