Commit ef0f5e93 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Pass dev_priv to .get_fifo_size()

Unify our approach to things by passing around dev_priv instead of dev.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1477946245-14134-19-git-send-email-ville.syrjala@linux.intel.comReviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
parent 148ac1f3
...@@ -495,7 +495,7 @@ struct dpll; ...@@ -495,7 +495,7 @@ struct dpll;
struct drm_i915_display_funcs { struct drm_i915_display_funcs {
int (*get_display_clock_speed)(struct drm_i915_private *dev_priv); int (*get_display_clock_speed)(struct drm_i915_private *dev_priv);
int (*get_fifo_size)(struct drm_device *dev, int plane); int (*get_fifo_size)(struct drm_i915_private *dev_priv, int plane);
int (*compute_pipe_wm)(struct intel_crtc_state *cstate); int (*compute_pipe_wm)(struct intel_crtc_state *cstate);
int (*compute_intermediate_wm)(struct drm_device *dev, int (*compute_intermediate_wm)(struct drm_device *dev,
struct intel_crtc *intel_crtc, struct intel_crtc *intel_crtc,
......
...@@ -375,10 +375,9 @@ static const int pessimal_latency_ns = 5000; ...@@ -375,10 +375,9 @@ static const int pessimal_latency_ns = 5000;
#define VLV_FIFO_START(dsparb, dsparb2, lo_shift, hi_shift) \ #define VLV_FIFO_START(dsparb, dsparb2, lo_shift, hi_shift) \
((((dsparb) >> (lo_shift)) & 0xff) | ((((dsparb2) >> (hi_shift)) & 0x1) << 8)) ((((dsparb) >> (lo_shift)) & 0xff) | ((((dsparb2) >> (hi_shift)) & 0x1) << 8))
static int vlv_get_fifo_size(struct drm_device *dev, static int vlv_get_fifo_size(struct drm_i915_private *dev_priv,
enum pipe pipe, int plane) enum pipe pipe, int plane)
{ {
struct drm_i915_private *dev_priv = to_i915(dev);
int sprite0_start, sprite1_start, size; int sprite0_start, sprite1_start, size;
switch (pipe) { switch (pipe) {
...@@ -427,9 +426,8 @@ static int vlv_get_fifo_size(struct drm_device *dev, ...@@ -427,9 +426,8 @@ static int vlv_get_fifo_size(struct drm_device *dev,
return size; return size;
} }
static int i9xx_get_fifo_size(struct drm_device *dev, int plane) static int i9xx_get_fifo_size(struct drm_i915_private *dev_priv, int plane)
{ {
struct drm_i915_private *dev_priv = to_i915(dev);
uint32_t dsparb = I915_READ(DSPARB); uint32_t dsparb = I915_READ(DSPARB);
int size; int size;
...@@ -443,9 +441,8 @@ static int i9xx_get_fifo_size(struct drm_device *dev, int plane) ...@@ -443,9 +441,8 @@ static int i9xx_get_fifo_size(struct drm_device *dev, int plane)
return size; return size;
} }
static int i830_get_fifo_size(struct drm_device *dev, int plane) static int i830_get_fifo_size(struct drm_i915_private *dev_priv, int plane)
{ {
struct drm_i915_private *dev_priv = to_i915(dev);
uint32_t dsparb = I915_READ(DSPARB); uint32_t dsparb = I915_READ(DSPARB);
int size; int size;
...@@ -460,9 +457,8 @@ static int i830_get_fifo_size(struct drm_device *dev, int plane) ...@@ -460,9 +457,8 @@ static int i830_get_fifo_size(struct drm_device *dev, int plane)
return size; return size;
} }
static int i845_get_fifo_size(struct drm_device *dev, int plane) static int i845_get_fifo_size(struct drm_i915_private *dev_priv, int plane)
{ {
struct drm_i915_private *dev_priv = to_i915(dev);
uint32_t dsparb = I915_READ(DSPARB); uint32_t dsparb = I915_READ(DSPARB);
int size; int size;
...@@ -1541,7 +1537,7 @@ static void i9xx_update_wm(struct intel_crtc *unused_crtc) ...@@ -1541,7 +1537,7 @@ static void i9xx_update_wm(struct intel_crtc *unused_crtc)
else else
wm_info = &i830_a_wm_info; wm_info = &i830_a_wm_info;
fifo_size = dev_priv->display.get_fifo_size(dev, 0); fifo_size = dev_priv->display.get_fifo_size(dev_priv, 0);
crtc = intel_get_crtc_for_plane(dev_priv, 0); crtc = intel_get_crtc_for_plane(dev_priv, 0);
if (intel_crtc_active(crtc)) { if (intel_crtc_active(crtc)) {
const struct drm_display_mode *adjusted_mode = const struct drm_display_mode *adjusted_mode =
...@@ -1568,7 +1564,7 @@ static void i9xx_update_wm(struct intel_crtc *unused_crtc) ...@@ -1568,7 +1564,7 @@ static void i9xx_update_wm(struct intel_crtc *unused_crtc)
if (IS_GEN2(dev_priv)) if (IS_GEN2(dev_priv))
wm_info = &i830_bc_wm_info; wm_info = &i830_bc_wm_info;
fifo_size = dev_priv->display.get_fifo_size(dev, 1); fifo_size = dev_priv->display.get_fifo_size(dev_priv, 1);
crtc = intel_get_crtc_for_plane(dev_priv, 1); crtc = intel_get_crtc_for_plane(dev_priv, 1);
if (intel_crtc_active(crtc)) { if (intel_crtc_active(crtc)) {
const struct drm_display_mode *adjusted_mode = const struct drm_display_mode *adjusted_mode =
...@@ -1686,7 +1682,7 @@ static void i845_update_wm(struct intel_crtc *unused_crtc) ...@@ -1686,7 +1682,7 @@ static void i845_update_wm(struct intel_crtc *unused_crtc)
adjusted_mode = &crtc->config->base.adjusted_mode; adjusted_mode = &crtc->config->base.adjusted_mode;
planea_wm = intel_calculate_wm(adjusted_mode->crtc_clock, planea_wm = intel_calculate_wm(adjusted_mode->crtc_clock,
&i845_wm_info, &i845_wm_info,
dev_priv->display.get_fifo_size(dev, 0), dev_priv->display.get_fifo_size(dev_priv, 0),
4, pessimal_latency_ns); 4, pessimal_latency_ns);
fwater_lo = I915_READ(FW_BLC) & ~0xfff; fwater_lo = I915_READ(FW_BLC) & ~0xfff;
fwater_lo |= (3<<8) | planea_wm; fwater_lo |= (3<<8) | planea_wm;
...@@ -4556,11 +4552,11 @@ void vlv_wm_get_hw_state(struct drm_device *dev) ...@@ -4556,11 +4552,11 @@ void vlv_wm_get_hw_state(struct drm_device *dev)
plane->wm.fifo_size = 63; plane->wm.fifo_size = 63;
break; break;
case DRM_PLANE_TYPE_PRIMARY: case DRM_PLANE_TYPE_PRIMARY:
plane->wm.fifo_size = vlv_get_fifo_size(dev, plane->pipe, 0); plane->wm.fifo_size = vlv_get_fifo_size(dev_priv, plane->pipe, 0);
break; break;
case DRM_PLANE_TYPE_OVERLAY: case DRM_PLANE_TYPE_OVERLAY:
sprite = plane->plane; sprite = plane->plane;
plane->wm.fifo_size = vlv_get_fifo_size(dev, plane->pipe, sprite + 1); plane->wm.fifo_size = vlv_get_fifo_size(dev_priv, plane->pipe, sprite + 1);
break; break;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment