OSDN Git Service

drm/atomic-helper: Remove the timestamping constant update from drm_atomic_helper_upd...
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 7 Sep 2020 12:00:25 +0000 (15:00 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 14 Sep 2020 19:37:31 +0000 (22:37 +0300)
The timestamping constants have nothing to do with any legacy state
so should not be updated from
drm_atomic_helper_update_legacy_modeset_state().

Let's make everyone call drm_atomic_helper_calc_timestamping_constants()
directly instead of relying on
drm_atomic_helper_update_legacy_modeset_state() to call it.

@@
expression S;
@@
- drm_atomic_helper_calc_timestamping_constants(S);

@@
expression D, S;
@@
  drm_atomic_helper_update_legacy_modeset_state(D, S);
+ drm_atomic_helper_calc_timestamping_constants(S);

v2: Update drm_crtc_vblank_helper_get_vblank_timestamp{,_internal}() docs (Daniel)

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200907120026.6360-2-ville.syrjala@linux.intel.com
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
drivers/gpu/drm/drm_atomic_helper.c
drivers/gpu/drm/drm_vblank.c
drivers/gpu/drm/i915/display/intel_display.c
drivers/gpu/drm/nouveau/dispnv50/disp.c

index ec29376..b24c14b 100644 (file)
@@ -7496,6 +7496,7 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)
        bool mode_set_reset_required = false;
 
        drm_atomic_helper_update_legacy_modeset_state(dev, state);
+       drm_atomic_helper_calc_timestamping_constants(state);
 
        dm_state = dm_atomic_get_new_state(state);
        if (dm_state && dm_state->context) {
index 191d09e..f9170b4 100644 (file)
@@ -1115,9 +1115,7 @@ disable_outputs(struct drm_device *dev, struct drm_atomic_state *old_state)
  * @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().
+ * connectors, encoders and CRTCs.
  *
  * Drivers can use this for building their own atomic commit if they don't have
  * a pure helper-based modeset implementation.
@@ -1187,8 +1185,6 @@ drm_atomic_helper_update_legacy_modeset_state(struct drm_device *dev,
                        crtc->y = new_plane_state->src_y >> 16;
                }
        }
-
-       drm_atomic_helper_calc_timestamping_constants(old_state);
 }
 EXPORT_SYMBOL(drm_atomic_helper_update_legacy_modeset_state);
 
@@ -1295,6 +1291,7 @@ void drm_atomic_helper_commit_modeset_disables(struct drm_device *dev,
        disable_outputs(dev, old_state);
 
        drm_atomic_helper_update_legacy_modeset_state(dev, old_state);
+       drm_atomic_helper_calc_timestamping_constants(old_state);
 
        crtc_set_mode(dev, old_state);
 }
index b18e1ef..f135b79 100644 (file)
@@ -674,7 +674,7 @@ EXPORT_SYMBOL(drm_calc_timestamping_constants);
  *
  * Note that atomic drivers must call drm_calc_timestamping_constants() before
  * enabling a CRTC. The atomic helpers already take care of that in
- * drm_atomic_helper_update_legacy_modeset_state().
+ * drm_atomic_helper_calc_timestamping_constants().
  *
  * Returns:
  *
@@ -819,7 +819,7 @@ EXPORT_SYMBOL(drm_crtc_vblank_helper_get_vblank_timestamp_internal);
  *
  * Note that atomic drivers must call drm_calc_timestamping_constants() before
  * enabling a CRTC. The atomic helpers already take care of that in
- * drm_atomic_helper_update_legacy_modeset_state().
+ * drm_atomic_helper_calc_timestamping_constants().
  *
  * Returns:
  *
index ddb588f..c0f01bd 100644 (file)
@@ -15577,6 +15577,7 @@ static void intel_atomic_commit_tail(struct intel_atomic_state *state)
 
        if (state->modeset) {
                drm_atomic_helper_update_legacy_modeset_state(dev, &state->base);
+               drm_atomic_helper_calc_timestamping_constants(&state->base);
 
                intel_set_cdclk_pre_plane_update(state);
 
index 852e1b5..b111fe2 100644 (file)
@@ -2069,6 +2069,7 @@ nv50_disp_atomic_commit_tail(struct drm_atomic_state *state)
        drm_atomic_helper_wait_for_fences(dev, state, false);
        drm_atomic_helper_wait_for_dependencies(state);
        drm_atomic_helper_update_legacy_modeset_state(dev, state);
+       drm_atomic_helper_calc_timestamping_constants(state);
 
        if (atom->lock_core)
                mutex_lock(&disp->mutex);