]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm: s/drm_crtc_get_hv_timings/drm_mode_get_hv_timings/
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 25 Jan 2017 06:26:56 +0000 (07:26 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 26 Jan 2017 09:46:28 +0000 (10:46 +0100)
The function operates on modes, not CRTCs. Also move it into
drm_modes.[hc]. Spotted while reviewing CRTC docs.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170125062657.19270-15-daniel.vetter@ffwll.ch
drivers/gpu/drm/drm_atomic_helper.c
drivers/gpu/drm/drm_crtc.c
drivers/gpu/drm/drm_modes.c
drivers/gpu/drm/i915/intel_display.c
include/drm/drm_crtc.h
include/drm/drm_modes.h

index 03ac27bafba79f4d4976095891cd80d9234e767b..43049882b811e93da0bc7b5f5beabcb8ed005667 100644 (file)
@@ -2367,7 +2367,7 @@ int __drm_atomic_helper_set_config(struct drm_mode_set *set,
        if (ret != 0)
                return ret;
 
-       drm_crtc_get_hv_timing(set->mode, &hdisplay, &vdisplay);
+       drm_mode_get_hv_timing(set->mode, &hdisplay, &vdisplay);
 
        drm_atomic_set_fb_for_plane(primary_state, set->fb);
        primary_state->crtc_x = 0;
index 5b522092d4bb24ef902cd770ecab1a29ddaecb7a..6915f897bd8e73d42342d21ea1c1bd4e0bb16b2a 100644 (file)
@@ -481,27 +481,6 @@ int drm_mode_set_config_internal(struct drm_mode_set *set)
 }
 EXPORT_SYMBOL(drm_mode_set_config_internal);
 
-/**
- * drm_crtc_get_hv_timing - Fetches hdisplay/vdisplay for given mode
- * @mode: mode to query
- * @hdisplay: hdisplay value to fill in
- * @vdisplay: vdisplay value to fill in
- *
- * The vdisplay value will be doubled if the specified mode is a stereo mode of
- * the appropriate layout.
- */
-void drm_crtc_get_hv_timing(const struct drm_display_mode *mode,
-                           int *hdisplay, int *vdisplay)
-{
-       struct drm_display_mode adjusted;
-
-       drm_mode_copy(&adjusted, mode);
-       drm_mode_set_crtcinfo(&adjusted, CRTC_STEREO_DOUBLE_ONLY);
-       *hdisplay = adjusted.crtc_hdisplay;
-       *vdisplay = adjusted.crtc_vdisplay;
-}
-EXPORT_SYMBOL(drm_crtc_get_hv_timing);
-
 /**
  * drm_crtc_check_viewport - Checks that a framebuffer is big enough for the
  *     CRTC viewport
@@ -519,7 +498,7 @@ int drm_crtc_check_viewport(const struct drm_crtc *crtc,
 {
        int hdisplay, vdisplay;
 
-       drm_crtc_get_hv_timing(mode, &hdisplay, &vdisplay);
+       drm_mode_get_hv_timing(mode, &hdisplay, &vdisplay);
 
        if (crtc->state &&
            drm_rotation_90_or_270(crtc->primary->state->rotation))
index ac6a35212501eb56784cf14c25867fbfeda88f47..1d9d4ca086a8fdf2b4a2f16251e8435a82ae44b9 100644 (file)
@@ -796,6 +796,27 @@ int drm_mode_vrefresh(const struct drm_display_mode *mode)
 }
 EXPORT_SYMBOL(drm_mode_vrefresh);
 
+/**
+ * drm_mode_get_hv_timing - Fetches hdisplay/vdisplay for given mode
+ * @mode: mode to query
+ * @hdisplay: hdisplay value to fill in
+ * @vdisplay: vdisplay value to fill in
+ *
+ * The vdisplay value will be doubled if the specified mode is a stereo mode of
+ * the appropriate layout.
+ */
+void drm_mode_get_hv_timing(const struct drm_display_mode *mode,
+                           int *hdisplay, int *vdisplay)
+{
+       struct drm_display_mode adjusted;
+
+       drm_mode_copy(&adjusted, mode);
+       drm_mode_set_crtcinfo(&adjusted, CRTC_STEREO_DOUBLE_ONLY);
+       *hdisplay = adjusted.crtc_hdisplay;
+       *vdisplay = adjusted.crtc_vdisplay;
+}
+EXPORT_SYMBOL(drm_mode_get_hv_timing);
+
 /**
  * drm_mode_set_crtcinfo - set CRTC modesetting timing parameters
  * @p: mode
index e2150a64860c37f81d1db4f43b6eddff0664abe1..1eb63699e115257db3cc205d58b9c2471d0d459f 100644 (file)
@@ -11105,7 +11105,7 @@ static int intel_modeset_setup_plane_state(struct drm_atomic_state *state,
                return PTR_ERR(plane_state);
 
        if (mode)
-               drm_crtc_get_hv_timing(mode, &hdisplay, &vdisplay);
+               drm_mode_get_hv_timing(mode, &hdisplay, &vdisplay);
        else
                hdisplay = vdisplay = 0;
 
@@ -12990,7 +12990,7 @@ intel_modeset_pipe_config(struct drm_crtc *crtc,
         * computation to clearly distinguish it from the adjusted mode, which
         * can be changed by the connectors in the below retry loop.
         */
-       drm_crtc_get_hv_timing(&pipe_config->base.mode,
+       drm_mode_get_hv_timing(&pipe_config->base.mode,
                               &pipe_config->pipe_src_w,
                               &pipe_config->pipe_src_h);
 
index 2404b23cddb457334f12361a61803dd1498ac302..c2f9fdaf2a66315a535bc964e6444856eb051489 100644 (file)
@@ -824,8 +824,6 @@ static inline uint32_t drm_crtc_mask(const struct drm_crtc *crtc)
        return 1 << drm_crtc_index(crtc);
 }
 
-void drm_crtc_get_hv_timing(const struct drm_display_mode *mode,
-                           int *hdisplay, int *vdisplay);
 int drm_crtc_force_disable(struct drm_crtc *crtc);
 int drm_crtc_force_disable_all(struct drm_device *dev);
 
index 9934d91619c1823c80d277a50cc025873903b3a1..6dd34280e892d7d4016ef6b26f79a1e2f9fd6e3e 100644 (file)
@@ -459,6 +459,8 @@ int of_get_drm_display_mode(struct device_node *np,
 void drm_mode_set_name(struct drm_display_mode *mode);
 int drm_mode_hsync(const struct drm_display_mode *mode);
 int drm_mode_vrefresh(const struct drm_display_mode *mode);
+void drm_mode_get_hv_timing(const struct drm_display_mode *mode,
+                           int *hdisplay, int *vdisplay);
 
 void drm_mode_set_crtcinfo(struct drm_display_mode *p,
                           int adjust_flags);