Skip to content

Commit 196cd5d

Browse files
committed
drm: s/drm_crtc_get_hv_timings/drm_mode_get_hv_timings/
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
1 parent 0683c0a commit 196cd5d

6 files changed

Lines changed: 27 additions & 27 deletions

File tree

‎drivers/gpu/drm/drm_atomic_helper.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2367,7 +2367,7 @@ int __drm_atomic_helper_set_config(struct drm_mode_set *set,
23672367
if (ret != 0)
23682368
return ret;
23692369

2370-
drm_crtc_get_hv_timing(set->mode, &hdisplay, &vdisplay);
2370+
drm_mode_get_hv_timing(set->mode, &hdisplay, &vdisplay);
23712371

23722372
drm_atomic_set_fb_for_plane(primary_state, set->fb);
23732373
primary_state->crtc_x = 0;

‎drivers/gpu/drm/drm_crtc.c‎

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -481,27 +481,6 @@ int drm_mode_set_config_internal(struct drm_mode_set *set)
481481
}
482482
EXPORT_SYMBOL(drm_mode_set_config_internal);
483483

484-
/**
485-
* drm_crtc_get_hv_timing - Fetches hdisplay/vdisplay for given mode
486-
* @mode: mode to query
487-
* @hdisplay: hdisplay value to fill in
488-
* @vdisplay: vdisplay value to fill in
489-
*
490-
* The vdisplay value will be doubled if the specified mode is a stereo mode of
491-
* the appropriate layout.
492-
*/
493-
void drm_crtc_get_hv_timing(const struct drm_display_mode *mode,
494-
int *hdisplay, int *vdisplay)
495-
{
496-
struct drm_display_mode adjusted;
497-
498-
drm_mode_copy(&adjusted, mode);
499-
drm_mode_set_crtcinfo(&adjusted, CRTC_STEREO_DOUBLE_ONLY);
500-
*hdisplay = adjusted.crtc_hdisplay;
501-
*vdisplay = adjusted.crtc_vdisplay;
502-
}
503-
EXPORT_SYMBOL(drm_crtc_get_hv_timing);
504-
505484
/**
506485
* drm_crtc_check_viewport - Checks that a framebuffer is big enough for the
507486
* CRTC viewport
@@ -519,7 +498,7 @@ int drm_crtc_check_viewport(const struct drm_crtc *crtc,
519498
{
520499
int hdisplay, vdisplay;
521500

522-
drm_crtc_get_hv_timing(mode, &hdisplay, &vdisplay);
501+
drm_mode_get_hv_timing(mode, &hdisplay, &vdisplay);
523502

524503
if (crtc->state &&
525504
drm_rotation_90_or_270(crtc->primary->state->rotation))

‎drivers/gpu/drm/drm_modes.c‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,27 @@ int drm_mode_vrefresh(const struct drm_display_mode *mode)
796796
}
797797
EXPORT_SYMBOL(drm_mode_vrefresh);
798798

799+
/**
800+
* drm_mode_get_hv_timing - Fetches hdisplay/vdisplay for given mode
801+
* @mode: mode to query
802+
* @hdisplay: hdisplay value to fill in
803+
* @vdisplay: vdisplay value to fill in
804+
*
805+
* The vdisplay value will be doubled if the specified mode is a stereo mode of
806+
* the appropriate layout.
807+
*/
808+
void drm_mode_get_hv_timing(const struct drm_display_mode *mode,
809+
int *hdisplay, int *vdisplay)
810+
{
811+
struct drm_display_mode adjusted;
812+
813+
drm_mode_copy(&adjusted, mode);
814+
drm_mode_set_crtcinfo(&adjusted, CRTC_STEREO_DOUBLE_ONLY);
815+
*hdisplay = adjusted.crtc_hdisplay;
816+
*vdisplay = adjusted.crtc_vdisplay;
817+
}
818+
EXPORT_SYMBOL(drm_mode_get_hv_timing);
819+
799820
/**
800821
* drm_mode_set_crtcinfo - set CRTC modesetting timing parameters
801822
* @p: mode

‎drivers/gpu/drm/i915/intel_display.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11105,7 +11105,7 @@ static int intel_modeset_setup_plane_state(struct drm_atomic_state *state,
1110511105
return PTR_ERR(plane_state);
1110611106

1110711107
if (mode)
11108-
drm_crtc_get_hv_timing(mode, &hdisplay, &vdisplay);
11108+
drm_mode_get_hv_timing(mode, &hdisplay, &vdisplay);
1110911109
else
1111011110
hdisplay = vdisplay = 0;
1111111111

@@ -12990,7 +12990,7 @@ intel_modeset_pipe_config(struct drm_crtc *crtc,
1299012990
* computation to clearly distinguish it from the adjusted mode, which
1299112991
* can be changed by the connectors in the below retry loop.
1299212992
*/
12993-
drm_crtc_get_hv_timing(&pipe_config->base.mode,
12993+
drm_mode_get_hv_timing(&pipe_config->base.mode,
1299412994
&pipe_config->pipe_src_w,
1299512995
&pipe_config->pipe_src_h);
1299612996

‎include/drm/drm_crtc.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -824,8 +824,6 @@ static inline uint32_t drm_crtc_mask(const struct drm_crtc *crtc)
824824
return 1 << drm_crtc_index(crtc);
825825
}
826826

827-
void drm_crtc_get_hv_timing(const struct drm_display_mode *mode,
828-
int *hdisplay, int *vdisplay);
829827
int drm_crtc_force_disable(struct drm_crtc *crtc);
830828
int drm_crtc_force_disable_all(struct drm_device *dev);
831829

‎include/drm/drm_modes.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,8 @@ int of_get_drm_display_mode(struct device_node *np,
459459
void drm_mode_set_name(struct drm_display_mode *mode);
460460
int drm_mode_hsync(const struct drm_display_mode *mode);
461461
int drm_mode_vrefresh(const struct drm_display_mode *mode);
462+
void drm_mode_get_hv_timing(const struct drm_display_mode *mode,
463+
int *hdisplay, int *vdisplay);
462464

463465
void drm_mode_set_crtcinfo(struct drm_display_mode *p,
464466
int adjust_flags);

0 commit comments

Comments
 (0)