Skip to contentSkip to conversation

drm/atomic-helpers: Update vblank timestamping constants

PATCH In review Daniel Vetter 3 participants 4 messages May 12, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm/atomic-helpers: Update vblank timestamping constants

The atomic helpers don't call drm_calc_timestamping_constants, which is a regression compared to the crtc helpers. Fix this.

Noticed while reviewing i915 atomic patches from Maarten.

Cc Maarten Lankhorst <[email protected]>
---
 drivers/gpu/drm/drm_atomic_helper.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/drm_atomic_helper.c +2 -0
index 5d30592c83cd..181bbc1ef1b9 100644
@@ -657,6 +657,8 @@ set_routing_links(struct drm_device *dev, struct drm_atomic_state *old_state)
 		crtc->enabled = crtc->state->enable;
 		crtc->x = crtc->primary->state->src_x >> 16;
 		crtc->y = crtc->primary->state->src_y >> 16;
+
+		drm_calc_timestamping_constants(crtc, &crtc->state->adjusted_mode);
 	}
 }
 
Signature · 6 lines
2.1.4

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

PATCH 2/2 drm/atomic-helpers: Export drm_atomic_helper_update_legacy_modeset_state

This is useful for drivers which have their own modeset infrastructure but want to reuse most of the legacy state frobbery from the helpers. i915 wants this.

Cc Maarten Lankhorst <[email protected]>
---
 drivers/gpu/drm/drm_atomic_helper.c | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)
drivers/gpu/drm/drm_atomic_helper.c +20 -3
index 181bbc1ef1b9..8ba5be8c754c 100644
@@ -619,8 +619,22 @@ disable_outputs(struct drm_device *dev, struct drm_atomic_state *old_state)
 	}
 }
 
-static void
-set_routing_links(struct drm_device *dev, struct drm_atomic_state *old_state)
+/**
+ * drm_atomic_helper_update_legacy_modeset_state - update legacy modeset state
+ * @dev: DRM device
+ * @old_state: atomic state object with old state structures
+ *
+ * This function updates all the various legacy modeset state pointers in
+ * connectors, encoders and crtcs. It also updates the timestamping constants
+ * used for precise vblank timestamps by calling
+ * drm_calc_timestamping_constants().
+ *
+ * Drivers can use this for building their own atomic commit if they don't have
+ * a pure helper-based modeset implementation.
+ */
+void
+drm_atomic_helper_update_legacy_modeset_state(struct drm_device *dev,
+					      struct drm_atomic_state *old_state)
 {
 	struct drm_connector *connector;
 	struct drm_connector_state *old_conn_state;
@@ -661,6 +675,7 @@ set_routing_links(struct drm_device *dev, struct drm_atomic_state *old_state)
 		drm_calc_timestamping_constants(crtc, &crtc->state->adjusted_mode);
 	}
 }
+EXPORT_SYMBOL(drm_atomic_helper_update_legacy_modeset_state);
 
 static void
 crtc_set_mode(struct drm_device *dev, struct drm_atomic_state *old_state)
@@ -739,7 +754,9 @@ void drm_atomic_helper_commit_modeset_disables(struct drm_device *dev,
 					       struct drm_atomic_state *old_state)
 {
 	disable_outputs(dev, old_state);
-	set_routing_links(dev, old_state);
+
+	drm_atomic_helper_update_legacy_modeset_state(dev, old_state);
+
 	crtc_set_mode(dev, old_state);
 }
 EXPORT_SYMBOL(drm_atomic_helper_commit_modeset_disables);
Signature · 6 lines
2.1.4

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] drm/atomic-helpers: Export drm_atomic_helper_update_legacy_modeset_state

Op 12-05-15 om 15:29 schreef Daniel Vetter:

Quoted 8 lines

This is useful for drivers which have their own modeset infrastructure but want to reuse most of the legacy state frobbery from the helpers. i915 wants this.

Cc Maarten Lankhorst <[email protected]>

---

For both patches:

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw

Re: [PATCH 2/2] drm/atomic-helpers: Export drm_atomic_helper_update_legacy_modeset_state

Quoted 5 lines · Maarten Lankhorst

Op 12-05-15 om 15:29 schreef Daniel Vetter:

Quoted 4 lines

This is useful for drivers which have their own modeset infrastructure but want to reuse most of the legacy state frobbery from the helpers. i915 wants this.

Quoted 7 lines
Quoted 4 lines
Cc Maarten Lankhorst <[email protected]>

---

For both patches:

Thanks, patches pulled into drm-misc.
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx