aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>2016-05-04 05:11:57 -0400
committerAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>2016-05-13 04:34:50 -0400
commit9e2c84751ed29991d776d955cbd52f4b8e6e3266 (patch)
treefae19fa2221a4c8a5fd2a20eae2cd94acac5c230
parent57bf5c81e9f393908d767638c09c7a19fc50d900 (diff)
drm/i915: Remove intel_clock_t typedef
Just use "struct dpll" everywhere. That's actually shorter than intel_clock_t. Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> Reviewed-by: Jani Nikula <jani.nikula@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1462353119-9738-1-git-send-email-ander.conselvan.de.oliveira@intel.com
-rw-r--r--drivers/gpu/drm/i915/intel_ddi.c2
-rw-r--r--drivers/gpu/drm/i915/intel_display.c62
-rw-r--r--drivers/gpu/drm/i915/intel_dpll_mgr.c2
-rw-r--r--drivers/gpu/drm/i915/intel_drv.h8
4 files changed, 37 insertions, 37 deletions
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index 01e523df363b..c454744dda0b 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -948,7 +948,7 @@ static int bxt_calc_pll_link(struct drm_i915_private *dev_priv,
948{ 948{
949 struct intel_shared_dpll *pll; 949 struct intel_shared_dpll *pll;
950 struct intel_dpll_hw_state *state; 950 struct intel_dpll_hw_state *state;
951 intel_clock_t clock; 951 struct dpll clock;
952 952
953 /* For DDI ports we always use a shared PLL. */ 953 /* For DDI ports we always use a shared PLL. */
954 if (WARN_ON(dpll == DPLL_ID_PRIVATE)) 954 if (WARN_ON(dpll == DPLL_ID_PRIVATE))
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 44b15d38f56b..5674ce11dad5 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -582,7 +582,7 @@ static bool intel_pipe_will_have_type(const struct intel_crtc_state *crtc_state,
582 * divided-down version of it. 582 * divided-down version of it.
583 */ 583 */
584/* m1 is reserved as 0 in Pineview, n is a ring counter */ 584/* m1 is reserved as 0 in Pineview, n is a ring counter */
585static int pnv_calc_dpll_params(int refclk, intel_clock_t *clock) 585static int pnv_calc_dpll_params(int refclk, struct dpll *clock)
586{ 586{
587 clock->m = clock->m2 + 2; 587 clock->m = clock->m2 + 2;
588 clock->p = clock->p1 * clock->p2; 588 clock->p = clock->p1 * clock->p2;
@@ -599,7 +599,7 @@ static uint32_t i9xx_dpll_compute_m(struct dpll *dpll)
599 return 5 * (dpll->m1 + 2) + (dpll->m2 + 2); 599 return 5 * (dpll->m1 + 2) + (dpll->m2 + 2);
600} 600}
601 601
602static int i9xx_calc_dpll_params(int refclk, intel_clock_t *clock) 602static int i9xx_calc_dpll_params(int refclk, struct dpll *clock)
603{ 603{
604 clock->m = i9xx_dpll_compute_m(clock); 604 clock->m = i9xx_dpll_compute_m(clock);
605 clock->p = clock->p1 * clock->p2; 605 clock->p = clock->p1 * clock->p2;
@@ -611,7 +611,7 @@ static int i9xx_calc_dpll_params(int refclk, intel_clock_t *clock)
611 return clock->dot; 611 return clock->dot;
612} 612}
613 613
614static int vlv_calc_dpll_params(int refclk, intel_clock_t *clock) 614static int vlv_calc_dpll_params(int refclk, struct dpll *clock)
615{ 615{
616 clock->m = clock->m1 * clock->m2; 616 clock->m = clock->m1 * clock->m2;
617 clock->p = clock->p1 * clock->p2; 617 clock->p = clock->p1 * clock->p2;
@@ -623,7 +623,7 @@ static int vlv_calc_dpll_params(int refclk, intel_clock_t *clock)
623 return clock->dot / 5; 623 return clock->dot / 5;
624} 624}
625 625
626int chv_calc_dpll_params(int refclk, intel_clock_t *clock) 626int chv_calc_dpll_params(int refclk, struct dpll *clock)
627{ 627{
628 clock->m = clock->m1 * clock->m2; 628 clock->m = clock->m1 * clock->m2;
629 clock->p = clock->p1 * clock->p2; 629 clock->p = clock->p1 * clock->p2;
@@ -644,7 +644,7 @@ int chv_calc_dpll_params(int refclk, intel_clock_t *clock)
644 644
645static bool intel_PLL_is_valid(struct drm_device *dev, 645static bool intel_PLL_is_valid(struct drm_device *dev,
646 const intel_limit_t *limit, 646 const intel_limit_t *limit,
647 const intel_clock_t *clock) 647 const struct dpll *clock)
648{ 648{
649 if (clock->n < limit->n.min || limit->n.max < clock->n) 649 if (clock->n < limit->n.min || limit->n.max < clock->n)
650 INTELPllInvalid("n out of range\n"); 650 INTELPllInvalid("n out of range\n");
@@ -716,11 +716,11 @@ i9xx_select_p2_div(const intel_limit_t *limit,
716static bool 716static bool
717i9xx_find_best_dpll(const intel_limit_t *limit, 717i9xx_find_best_dpll(const intel_limit_t *limit,
718 struct intel_crtc_state *crtc_state, 718 struct intel_crtc_state *crtc_state,
719 int target, int refclk, intel_clock_t *match_clock, 719 int target, int refclk, struct dpll *match_clock,
720 intel_clock_t *best_clock) 720 struct dpll *best_clock)
721{ 721{
722 struct drm_device *dev = crtc_state->base.crtc->dev; 722 struct drm_device *dev = crtc_state->base.crtc->dev;
723 intel_clock_t clock; 723 struct dpll clock;
724 int err = target; 724 int err = target;
725 725
726 memset(best_clock, 0, sizeof(*best_clock)); 726 memset(best_clock, 0, sizeof(*best_clock));
@@ -773,11 +773,11 @@ i9xx_find_best_dpll(const intel_limit_t *limit,
773static bool 773static bool
774pnv_find_best_dpll(const intel_limit_t *limit, 774pnv_find_best_dpll(const intel_limit_t *limit,
775 struct intel_crtc_state *crtc_state, 775 struct intel_crtc_state *crtc_state,
776 int target, int refclk, intel_clock_t *match_clock, 776 int target, int refclk, struct dpll *match_clock,
777 intel_clock_t *best_clock) 777 struct dpll *best_clock)
778{ 778{
779 struct drm_device *dev = crtc_state->base.crtc->dev; 779 struct drm_device *dev = crtc_state->base.crtc->dev;
780 intel_clock_t clock; 780 struct dpll clock;
781 int err = target; 781 int err = target;
782 782
783 memset(best_clock, 0, sizeof(*best_clock)); 783 memset(best_clock, 0, sizeof(*best_clock));
@@ -828,11 +828,11 @@ pnv_find_best_dpll(const intel_limit_t *limit,
828static bool 828static bool
829g4x_find_best_dpll(const intel_limit_t *limit, 829g4x_find_best_dpll(const intel_limit_t *limit,
830 struct intel_crtc_state *crtc_state, 830 struct intel_crtc_state *crtc_state,
831 int target, int refclk, intel_clock_t *match_clock, 831 int target, int refclk, struct dpll *match_clock,
832 intel_clock_t *best_clock) 832 struct dpll *best_clock)
833{ 833{
834 struct drm_device *dev = crtc_state->base.crtc->dev; 834 struct drm_device *dev = crtc_state->base.crtc->dev;
835 intel_clock_t clock; 835 struct dpll clock;
836 int max_n; 836 int max_n;
837 bool found = false; 837 bool found = false;
838 /* approximately equals target * 0.00585 */ 838 /* approximately equals target * 0.00585 */
@@ -878,8 +878,8 @@ g4x_find_best_dpll(const intel_limit_t *limit,
878 * best configuration and error found so far. Return the calculated error. 878 * best configuration and error found so far. Return the calculated error.
879 */ 879 */
880static bool vlv_PLL_is_optimal(struct drm_device *dev, int target_freq, 880static bool vlv_PLL_is_optimal(struct drm_device *dev, int target_freq,
881 const intel_clock_t *calculated_clock, 881 const struct dpll *calculated_clock,
882 const intel_clock_t *best_clock, 882 const struct dpll *best_clock,
883 unsigned int best_error_ppm, 883 unsigned int best_error_ppm,
884 unsigned int *error_ppm) 884 unsigned int *error_ppm)
885{ 885{
@@ -921,12 +921,12 @@ static bool vlv_PLL_is_optimal(struct drm_device *dev, int target_freq,
921static bool 921static bool
922vlv_find_best_dpll(const intel_limit_t *limit, 922vlv_find_best_dpll(const intel_limit_t *limit,
923 struct intel_crtc_state *crtc_state, 923 struct intel_crtc_state *crtc_state,
924 int target, int refclk, intel_clock_t *match_clock, 924 int target, int refclk, struct dpll *match_clock,
925 intel_clock_t *best_clock) 925 struct dpll *best_clock)
926{ 926{
927 struct intel_crtc *crtc = to_intel_crtc(crtc_state->base.crtc); 927 struct intel_crtc *crtc = to_intel_crtc(crtc_state->base.crtc);
928 struct drm_device *dev = crtc->base.dev; 928 struct drm_device *dev = crtc->base.dev;
929 intel_clock_t clock; 929 struct dpll clock;
930 unsigned int bestppm = 1000000; 930 unsigned int bestppm = 1000000;
931 /* min update 19.2 MHz */ 931 /* min update 19.2 MHz */
932 int max_n = min(limit->n.max, refclk / 19200); 932 int max_n = min(limit->n.max, refclk / 19200);
@@ -980,13 +980,13 @@ vlv_find_best_dpll(const intel_limit_t *limit,
980static bool 980static bool
981chv_find_best_dpll(const intel_limit_t *limit, 981chv_find_best_dpll(const intel_limit_t *limit,
982 struct intel_crtc_state *crtc_state, 982 struct intel_crtc_state *crtc_state,
983 int target, int refclk, intel_clock_t *match_clock, 983 int target, int refclk, struct dpll *match_clock,
984 intel_clock_t *best_clock) 984 struct dpll *best_clock)
985{ 985{
986 struct intel_crtc *crtc = to_intel_crtc(crtc_state->base.crtc); 986 struct intel_crtc *crtc = to_intel_crtc(crtc_state->base.crtc);
987 struct drm_device *dev = crtc->base.dev; 987 struct drm_device *dev = crtc->base.dev;
988 unsigned int best_error_ppm; 988 unsigned int best_error_ppm;
989 intel_clock_t clock; 989 struct dpll clock;
990 uint64_t m2; 990 uint64_t m2;
991 int found = false; 991 int found = false;
992 992
@@ -1036,7 +1036,7 @@ chv_find_best_dpll(const intel_limit_t *limit,
1036} 1036}
1037 1037
1038bool bxt_find_best_dpll(struct intel_crtc_state *crtc_state, int target_clock, 1038bool bxt_find_best_dpll(struct intel_crtc_state *crtc_state, int target_clock,
1039 intel_clock_t *best_clock) 1039 struct dpll *best_clock)
1040{ 1040{
1041 int refclk = 100000; 1041 int refclk = 100000;
1042 const intel_limit_t *limit = &intel_limits_bxt; 1042 const intel_limit_t *limit = &intel_limits_bxt;
@@ -7057,7 +7057,7 @@ static uint32_t i9xx_dpll_compute_fp(struct dpll *dpll)
7057 7057
7058static void i9xx_update_pll_dividers(struct intel_crtc *crtc, 7058static void i9xx_update_pll_dividers(struct intel_crtc *crtc,
7059 struct intel_crtc_state *crtc_state, 7059 struct intel_crtc_state *crtc_state,
7060 intel_clock_t *reduced_clock) 7060 struct dpll *reduced_clock)
7061{ 7061{
7062 struct drm_device *dev = crtc->base.dev; 7062 struct drm_device *dev = crtc->base.dev;
7063 u32 fp, fp2 = 0; 7063 u32 fp, fp2 = 0;
@@ -7481,7 +7481,7 @@ void vlv_force_pll_off(struct drm_device *dev, enum pipe pipe)
7481 7481
7482static void i9xx_compute_dpll(struct intel_crtc *crtc, 7482static void i9xx_compute_dpll(struct intel_crtc *crtc,
7483 struct intel_crtc_state *crtc_state, 7483 struct intel_crtc_state *crtc_state,
7484 intel_clock_t *reduced_clock) 7484 struct dpll *reduced_clock)
7485{ 7485{
7486 struct drm_device *dev = crtc->base.dev; 7486 struct drm_device *dev = crtc->base.dev;
7487 struct drm_i915_private *dev_priv = dev->dev_private; 7487 struct drm_i915_private *dev_priv = dev->dev_private;
@@ -7557,7 +7557,7 @@ static void i9xx_compute_dpll(struct intel_crtc *crtc,
7557 7557
7558static void i8xx_compute_dpll(struct intel_crtc *crtc, 7558static void i8xx_compute_dpll(struct intel_crtc *crtc,
7559 struct intel_crtc_state *crtc_state, 7559 struct intel_crtc_state *crtc_state,
7560 intel_clock_t *reduced_clock) 7560 struct dpll *reduced_clock)
7561{ 7561{
7562 struct drm_device *dev = crtc->base.dev; 7562 struct drm_device *dev = crtc->base.dev;
7563 struct drm_i915_private *dev_priv = dev->dev_private; 7563 struct drm_i915_private *dev_priv = dev->dev_private;
@@ -8028,7 +8028,7 @@ static void vlv_crtc_clock_get(struct intel_crtc *crtc,
8028 struct drm_device *dev = crtc->base.dev; 8028 struct drm_device *dev = crtc->base.dev;
8029 struct drm_i915_private *dev_priv = dev->dev_private; 8029 struct drm_i915_private *dev_priv = dev->dev_private;
8030 int pipe = pipe_config->cpu_transcoder; 8030 int pipe = pipe_config->cpu_transcoder;
8031 intel_clock_t clock; 8031 struct dpll clock;
8032 u32 mdiv; 8032 u32 mdiv;
8033 int refclk = 100000; 8033 int refclk = 100000;
8034 8034
@@ -8125,7 +8125,7 @@ static void chv_crtc_clock_get(struct intel_crtc *crtc,
8125 struct drm_i915_private *dev_priv = dev->dev_private; 8125 struct drm_i915_private *dev_priv = dev->dev_private;
8126 int pipe = pipe_config->cpu_transcoder; 8126 int pipe = pipe_config->cpu_transcoder;
8127 enum dpio_channel port = vlv_pipe_to_channel(pipe); 8127 enum dpio_channel port = vlv_pipe_to_channel(pipe);
8128 intel_clock_t clock; 8128 struct dpll clock;
8129 u32 cmn_dw13, pll_dw0, pll_dw1, pll_dw2, pll_dw3; 8129 u32 cmn_dw13, pll_dw0, pll_dw1, pll_dw2, pll_dw3;
8130 int refclk = 100000; 8130 int refclk = 100000;
8131 8131
@@ -8788,7 +8788,7 @@ static bool ironlake_needs_fb_cb_tune(struct dpll *dpll, int factor)
8788 8788
8789static void ironlake_compute_dpll(struct intel_crtc *intel_crtc, 8789static void ironlake_compute_dpll(struct intel_crtc *intel_crtc,
8790 struct intel_crtc_state *crtc_state, 8790 struct intel_crtc_state *crtc_state,
8791 intel_clock_t *reduced_clock) 8791 struct dpll *reduced_clock)
8792{ 8792{
8793 struct drm_crtc *crtc = &intel_crtc->base; 8793 struct drm_crtc *crtc = &intel_crtc->base;
8794 struct drm_device *dev = crtc->dev; 8794 struct drm_device *dev = crtc->dev;
@@ -8896,7 +8896,7 @@ static int ironlake_crtc_compute_clock(struct intel_crtc *crtc,
8896{ 8896{
8897 struct drm_device *dev = crtc->base.dev; 8897 struct drm_device *dev = crtc->base.dev;
8898 struct drm_i915_private *dev_priv = dev->dev_private; 8898 struct drm_i915_private *dev_priv = dev->dev_private;
8899 intel_clock_t reduced_clock; 8899 struct dpll reduced_clock;
8900 bool has_reduced_clock = false; 8900 bool has_reduced_clock = false;
8901 struct intel_shared_dpll *pll; 8901 struct intel_shared_dpll *pll;
8902 const intel_limit_t *limit; 8902 const intel_limit_t *limit;
@@ -10626,7 +10626,7 @@ static void i9xx_crtc_clock_get(struct intel_crtc *crtc,
10626 int pipe = pipe_config->cpu_transcoder; 10626 int pipe = pipe_config->cpu_transcoder;
10627 u32 dpll = pipe_config->dpll_hw_state.dpll; 10627 u32 dpll = pipe_config->dpll_hw_state.dpll;
10628 u32 fp; 10628 u32 fp;
10629 intel_clock_t clock; 10629 struct dpll clock;
10630 int port_clock; 10630 int port_clock;
10631 int refclk = i9xx_pll_refclk(dev, pipe_config); 10631 int refclk = i9xx_pll_refclk(dev, pipe_config);
10632 10632
diff --git a/drivers/gpu/drm/i915/intel_dpll_mgr.c b/drivers/gpu/drm/i915/intel_dpll_mgr.c
index 3ac705936b04..c283ba4babe8 100644
--- a/drivers/gpu/drm/i915/intel_dpll_mgr.c
+++ b/drivers/gpu/drm/i915/intel_dpll_mgr.c
@@ -1508,7 +1508,7 @@ bxt_get_dpll(struct intel_crtc *crtc, struct intel_crtc_state *crtc_state,
1508 int clock = crtc_state->port_clock; 1508 int clock = crtc_state->port_clock;
1509 1509
1510 if (encoder->type == INTEL_OUTPUT_HDMI) { 1510 if (encoder->type == INTEL_OUTPUT_HDMI) {
1511 intel_clock_t best_clock; 1511 struct dpll best_clock;
1512 1512
1513 /* Calculate HDMI div */ 1513 /* Calculate HDMI div */
1514 /* 1514 /*
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index cf0e6a6b8b2f..ab9307555312 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -266,7 +266,7 @@ struct intel_connector {
266 struct intel_dp *mst_port; 266 struct intel_dp *mst_port;
267}; 267};
268 268
269typedef struct dpll { 269struct dpll {
270 /* given values */ 270 /* given values */
271 int n; 271 int n;
272 int m1, m2; 272 int m1, m2;
@@ -276,7 +276,7 @@ typedef struct dpll {
276 int vco; 276 int vco;
277 int m; 277 int m;
278 int p; 278 int p;
279} intel_clock_t; 279};
280 280
281struct intel_atomic_state { 281struct intel_atomic_state {
282 struct drm_atomic_state base; 282 struct drm_atomic_state base;
@@ -1255,8 +1255,8 @@ void intel_dp_get_m_n(struct intel_crtc *crtc,
1255void intel_dp_set_m_n(struct intel_crtc *crtc, enum link_m_n_set m_n); 1255void intel_dp_set_m_n(struct intel_crtc *crtc, enum link_m_n_set m_n);
1256int intel_dotclock_calculate(int link_freq, const struct intel_link_m_n *m_n); 1256int intel_dotclock_calculate(int link_freq, const struct intel_link_m_n *m_n);
1257bool bxt_find_best_dpll(struct intel_crtc_state *crtc_state, int target_clock, 1257bool bxt_find_best_dpll(struct intel_crtc_state *crtc_state, int target_clock,
1258 intel_clock_t *best_clock); 1258 struct dpll *best_clock);
1259int chv_calc_dpll_params(int refclk, intel_clock_t *pll_clock); 1259int chv_calc_dpll_params(int refclk, struct dpll *pll_clock);
1260 1260
1261bool intel_crtc_active(struct drm_crtc *crtc); 1261bool intel_crtc_active(struct drm_crtc *crtc);
1262void hsw_enable_ips(struct intel_crtc *crtc); 1262void hsw_enable_ips(struct intel_crtc *crtc);