drm/msm/dpu: make crtc get_mixer_width helper static
authorJeykumar Sankaran <jsanka@codeaurora.org>
Thu, 6 Sep 2018 02:08:19 +0000 (19:08 -0700)
committerRob Clark <robdclark@gmail.com>
Thu, 4 Oct 2018 00:24:51 +0000 (20:24 -0400)
Mark CRTC get_mixer_width helper API static as it is
not used outside the file.

changes in v4:
- Patch introduced in the series
changes in v5:
- Simplify the inline function (Sean)

Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h

index c6db877..448994f 100644 (file)
 #define LEFT_MIXER 0
 #define RIGHT_MIXER 1
 
+static inline int _dpu_crtc_get_mixer_width(struct dpu_crtc_state *cstate,
+                                           struct drm_display_mode *mode)
+{
+       return mode->hdisplay / cstate->num_mixers;
+}
+
 static inline struct dpu_kms *_dpu_crtc_get_kms(struct drm_crtc *crtc)
 {
        struct msm_drm_private *priv;
@@ -601,7 +607,7 @@ static void _dpu_crtc_setup_lm_bounds(struct drm_crtc *crtc,
        cstate = to_dpu_crtc_state(state);
 
        adj_mode = &state->adjusted_mode;
-       crtc_split_width = dpu_crtc_get_mixer_width(dpu_crtc, cstate, adj_mode);
+       crtc_split_width = _dpu_crtc_get_mixer_width(cstate, adj_mode);
 
        for (i = 0; i < dpu_crtc->num_mixers; i++) {
                struct drm_rect *r = &cstate->lm_bounds[i];
@@ -1283,7 +1289,7 @@ static int dpu_crtc_atomic_check(struct drm_crtc *crtc,
 
        memset(pipe_staged, 0, sizeof(pipe_staged));
 
-       mixer_width = dpu_crtc_get_mixer_width(dpu_crtc, cstate, mode);
+       mixer_width = _dpu_crtc_get_mixer_width(cstate, mode);
 
        _dpu_crtc_setup_lm_bounds(crtc, state);
 
@@ -1519,7 +1525,7 @@ static int _dpu_debugfs_status_show(struct seq_file *s, void *data)
 
        mutex_lock(&dpu_crtc->crtc_lock);
        mode = &crtc->state->adjusted_mode;
-       out_width = dpu_crtc_get_mixer_width(dpu_crtc, cstate, mode);
+       out_width = _dpu_crtc_get_mixer_width(cstate, mode);
 
        seq_printf(s, "crtc:%d width:%d height:%d\n", crtc->base.id,
                                mode->hdisplay, mode->vdisplay);
index ec9c538..5e4dc5c 100644 (file)
@@ -237,24 +237,6 @@ struct dpu_crtc_state {
 #define to_dpu_crtc_state(x) \
        container_of(x, struct dpu_crtc_state, base)
 
-/**
- * dpu_crtc_get_mixer_width - get the mixer width
- * Mixer width will be same as panel width(/2 for split)
- */
-static inline int dpu_crtc_get_mixer_width(struct dpu_crtc *dpu_crtc,
-       struct dpu_crtc_state *cstate, struct drm_display_mode *mode)
-{
-       u32 mixer_width;
-
-       if (!dpu_crtc || !cstate || !mode)
-               return 0;
-
-       mixer_width = (dpu_crtc->num_mixers == CRTC_DUAL_MIXERS ?
-                       mode->hdisplay / CRTC_DUAL_MIXERS : mode->hdisplay);
-
-       return mixer_width;
-}
-
 /**
  * dpu_crtc_get_mixer_height - get the mixer height
  * Mixer height will be same as panel height