Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/i915: Pass dev_priv to intel_get_crtc_for_pipe()

Unify our approach to things by passing around dev_priv instead of dev.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1477946245-14134-11-git-send-email-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

+17 -20
+1 -2
drivers/gpu/drm/i915/i915_debugfs.c
··· 4131 4131 enum pipe pipe, 4132 4132 enum intel_pipe_crc_source source) 4133 4133 { 4134 - struct drm_device *dev = &dev_priv->drm; 4135 4134 struct intel_pipe_crc *pipe_crc = &dev_priv->pipe_crc[pipe]; 4136 - struct intel_crtc *crtc = intel_get_crtc_for_pipe(dev, pipe); 4135 + struct intel_crtc *crtc = intel_get_crtc_for_pipe(dev_priv, pipe); 4137 4136 enum intel_display_power_domain power_domain; 4138 4137 u32 val = 0; /* shut up gcc */ 4139 4138 int ret;
+3 -2
drivers/gpu/drm/i915/i915_irq.c
··· 965 965 struct timeval *vblank_time, 966 966 unsigned flags) 967 967 { 968 + struct drm_i915_private *dev_priv = to_i915(dev); 968 969 struct intel_crtc *crtc; 969 970 970 - if (pipe >= INTEL_INFO(dev)->num_pipes) { 971 + if (pipe >= INTEL_INFO(dev_priv)->num_pipes) { 971 972 DRM_ERROR("Invalid crtc %u\n", pipe); 972 973 return -EINVAL; 973 974 } 974 975 975 976 /* Get drm_crtc to timestamp: */ 976 - crtc = intel_get_crtc_for_pipe(dev, pipe); 977 + crtc = intel_get_crtc_for_pipe(dev_priv, pipe); 977 978 if (crtc == NULL) { 978 979 DRM_ERROR("Invalid crtc %u\n", pipe); 979 980 return -EINVAL;
+3 -3
drivers/gpu/drm/i915/intel_display.c
··· 7072 7072 if (pipe_config->fdi_lanes <= 2) 7073 7073 return 0; 7074 7074 7075 - other_crtc = intel_get_crtc_for_pipe(dev, PIPE_C); 7075 + other_crtc = intel_get_crtc_for_pipe(dev_priv, PIPE_C); 7076 7076 other_crtc_state = 7077 7077 intel_atomic_get_crtc_state(state, other_crtc); 7078 7078 if (IS_ERR(other_crtc_state)) ··· 7091 7091 return -EINVAL; 7092 7092 } 7093 7093 7094 - other_crtc = intel_get_crtc_for_pipe(dev, PIPE_B); 7094 + other_crtc = intel_get_crtc_for_pipe(dev_priv, PIPE_B); 7095 7095 other_crtc_state = 7096 7096 intel_atomic_get_crtc_state(state, other_crtc); 7097 7097 if (IS_ERR(other_crtc_state)) ··· 8106 8106 int vlv_force_pll_on(struct drm_i915_private *dev_priv, enum pipe pipe, 8107 8107 const struct dpll *dpll) 8108 8108 { 8109 - struct intel_crtc *crtc = intel_get_crtc_for_pipe(&dev_priv->drm, pipe); 8109 + struct intel_crtc *crtc = intel_get_crtc_for_pipe(dev_priv, pipe); 8110 8110 struct intel_crtc_state *pipe_config; 8111 8111 8112 8112 pipe_config = kzalloc(sizeof(*pipe_config), GFP_KERNEL);
+3 -5
drivers/gpu/drm/i915/intel_drv.h
··· 1029 1029 } 1030 1030 1031 1031 static inline struct intel_crtc * 1032 - intel_get_crtc_for_pipe(struct drm_device *dev, int pipe) 1032 + intel_get_crtc_for_pipe(struct drm_i915_private *dev_priv, enum pipe pipe) 1033 1033 { 1034 - struct drm_i915_private *dev_priv = to_i915(dev); 1035 1034 return dev_priv->pipe_to_crtc_mapping[pipe]; 1036 1035 } 1037 1036 1038 1037 static inline struct intel_crtc * 1039 - intel_get_crtc_for_plane(struct drm_device *dev, int plane) 1038 + intel_get_crtc_for_plane(struct drm_i915_private *dev_priv, enum plane plane) 1040 1039 { 1041 - struct drm_i915_private *dev_priv = to_i915(dev); 1042 1040 return dev_priv->plane_to_crtc_mapping[plane]; 1043 1041 } 1044 1042 ··· 1249 1251 static inline void 1250 1252 intel_wait_for_vblank_if_active(struct drm_i915_private *dev_priv, int pipe) 1251 1253 { 1252 - const struct intel_crtc *crtc = intel_get_crtc_for_pipe(&dev_priv->drm, pipe); 1254 + const struct intel_crtc *crtc = intel_get_crtc_for_pipe(dev_priv, pipe); 1253 1255 1254 1256 if (crtc->active) 1255 1257 intel_wait_for_vblank(dev_priv, pipe);
+1 -1
drivers/gpu/drm/i915/intel_dvo.c
··· 396 396 struct intel_crtc *crtc; 397 397 int pipe = (dvo_val & DVO_PIPE_B_SELECT) ? 1 : 0; 398 398 399 - crtc = intel_get_crtc_for_pipe(dev, pipe); 399 + crtc = intel_get_crtc_for_pipe(dev_priv, pipe); 400 400 if (crtc) { 401 401 mode = intel_crtc_mode_get(dev, &crtc->base); 402 402 if (mode) {
+1 -1
drivers/gpu/drm/i915/intel_lvds.c
··· 1163 1163 goto failed; 1164 1164 1165 1165 pipe = (lvds & LVDS_PIPEB_SELECT) ? 1 : 0; 1166 - crtc = intel_get_crtc_for_pipe(dev, pipe); 1166 + crtc = intel_get_crtc_for_pipe(dev_priv, pipe); 1167 1167 1168 1168 if (crtc && (lvds & LVDS_PORT_EN)) { 1169 1169 fixed_mode = intel_crtc_mode_get(dev, &crtc->base);
+5 -6
drivers/gpu/drm/i915/intel_pm.c
··· 728 728 int line_time_us, line_count; 729 729 int entries, tlb_miss; 730 730 731 - crtc = intel_get_crtc_for_plane(&dev_priv->drm, plane); 731 + crtc = intel_get_crtc_for_plane(dev_priv, plane); 732 732 if (!intel_crtc_active(crtc)) { 733 733 *cursor_wm = cursor->guard_size; 734 734 *plane_wm = display->guard_size; ··· 823 823 return false; 824 824 } 825 825 826 - crtc = intel_get_crtc_for_plane(&dev_priv->drm, plane); 826 + crtc = intel_get_crtc_for_plane(dev_priv, plane); 827 827 adjusted_mode = &crtc->config->base.adjusted_mode; 828 828 fb = crtc->base.primary->state->fb; 829 829 clock = adjusted_mode->crtc_clock; ··· 1393 1393 1394 1394 static void g4x_update_wm(struct intel_crtc *crtc) 1395 1395 { 1396 - struct drm_device *dev = crtc->base.dev; 1396 + struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); 1397 1397 static const int sr_latency_ns = 12000; 1398 - struct drm_i915_private *dev_priv = to_i915(dev); 1399 1398 int planea_wm, planeb_wm, cursora_wm, cursorb_wm; 1400 1399 int plane_sr, cursor_sr; 1401 1400 unsigned int enabled = 0; ··· 1545 1546 wm_info = &i830_a_wm_info; 1546 1547 1547 1548 fifo_size = dev_priv->display.get_fifo_size(dev, 0); 1548 - crtc = intel_get_crtc_for_plane(dev, 0); 1549 + crtc = intel_get_crtc_for_plane(dev_priv, 0); 1549 1550 if (intel_crtc_active(crtc)) { 1550 1551 const struct drm_display_mode *adjusted_mode = 1551 1552 &crtc->config->base.adjusted_mode; ··· 1572 1573 wm_info = &i830_bc_wm_info; 1573 1574 1574 1575 fifo_size = dev_priv->display.get_fifo_size(dev, 1); 1575 - crtc = intel_get_crtc_for_plane(dev, 1); 1576 + crtc = intel_get_crtc_for_plane(dev_priv, 1); 1576 1577 if (intel_crtc_active(crtc)) { 1577 1578 const struct drm_display_mode *adjusted_mode = 1578 1579 &crtc->config->base.adjusted_mode;