提交 4f2d9934 编写于 作者: V Ville Syrjälä

drm/i915: Pass drm_frambuffer to intel_compute_page_offset()

intel_compute_page_offsets() gets passed a bunch of the framebuffer
metadate sepearately. Just pass the framebuffer itself to make life
simpler for the caller, and make it less likely they would make a
mistake in the order of the arguments (as most as just unsigned ints and
such).

We still pass the pitch explicitly since for 90/270 degree rotation
the caller has to pass in the right thing.
Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1455569699-27905-7-git-send-email-ville.syrjala@linux.intel.com
上级 3465c580
...@@ -2496,13 +2496,14 @@ static u32 intel_adjust_tile_offset(int *x, int *y, ...@@ -2496,13 +2496,14 @@ static u32 intel_adjust_tile_offset(int *x, int *y,
* to be already rotated to match the rotated GTT view, and * to be already rotated to match the rotated GTT view, and
* pitch is the tile_height aligned framebuffer height. * pitch is the tile_height aligned framebuffer height.
*/ */
u32 intel_compute_tile_offset(struct drm_i915_private *dev_priv, u32 intel_compute_tile_offset(int *x, int *y,
int *x, int *y, const struct drm_framebuffer *fb, int plane,
uint64_t fb_modifier,
unsigned int cpp,
unsigned int pitch, unsigned int pitch,
unsigned int rotation) unsigned int rotation)
{ {
const struct drm_i915_private *dev_priv = to_i915(fb->dev);
uint64_t fb_modifier = fb->modifier[plane];
unsigned int cpp = drm_format_plane_cpp(fb->pixel_format, plane);
u32 offset, offset_aligned, alignment; u32 offset, offset_aligned, alignment;
alignment = intel_surf_alignment(dev_priv, fb_modifier); alignment = intel_surf_alignment(dev_priv, fb_modifier);
...@@ -2845,8 +2846,7 @@ static void i9xx_update_primary_plane(struct drm_plane *primary, ...@@ -2845,8 +2846,7 @@ static void i9xx_update_primary_plane(struct drm_plane *primary,
if (INTEL_INFO(dev)->gen >= 4) { if (INTEL_INFO(dev)->gen >= 4) {
intel_crtc->dspaddr_offset = intel_crtc->dspaddr_offset =
intel_compute_tile_offset(dev_priv, &x, &y, intel_compute_tile_offset(&x, &y, fb, 0,
fb->modifier[0], cpp,
fb->pitches[0], rotation); fb->pitches[0], rotation);
linear_offset -= intel_crtc->dspaddr_offset; linear_offset -= intel_crtc->dspaddr_offset;
} else { } else {
...@@ -2953,8 +2953,7 @@ static void ironlake_update_primary_plane(struct drm_plane *primary, ...@@ -2953,8 +2953,7 @@ static void ironlake_update_primary_plane(struct drm_plane *primary,
linear_offset = y * fb->pitches[0] + x * cpp; linear_offset = y * fb->pitches[0] + x * cpp;
intel_crtc->dspaddr_offset = intel_crtc->dspaddr_offset =
intel_compute_tile_offset(dev_priv, &x, &y, intel_compute_tile_offset(&x, &y, fb, 0,
fb->modifier[0], cpp,
fb->pitches[0], rotation); fb->pitches[0], rotation);
linear_offset -= intel_crtc->dspaddr_offset; linear_offset -= intel_crtc->dspaddr_offset;
if (rotation == BIT(DRM_ROTATE_180)) { if (rotation == BIT(DRM_ROTATE_180)) {
......
...@@ -1194,10 +1194,8 @@ void assert_fdi_rx_pll(struct drm_i915_private *dev_priv, ...@@ -1194,10 +1194,8 @@ void assert_fdi_rx_pll(struct drm_i915_private *dev_priv,
void assert_pipe(struct drm_i915_private *dev_priv, enum pipe pipe, bool state); void assert_pipe(struct drm_i915_private *dev_priv, enum pipe pipe, bool state);
#define assert_pipe_enabled(d, p) assert_pipe(d, p, true) #define assert_pipe_enabled(d, p) assert_pipe(d, p, true)
#define assert_pipe_disabled(d, p) assert_pipe(d, p, false) #define assert_pipe_disabled(d, p) assert_pipe(d, p, false)
u32 intel_compute_tile_offset(struct drm_i915_private *dev_priv, u32 intel_compute_tile_offset(int *x, int *y,
int *x, int *y, const struct drm_framebuffer *fb, int plane,
uint64_t fb_modifier,
unsigned int cpp,
unsigned int pitch, unsigned int pitch,
unsigned int rotation); unsigned int rotation);
void intel_prepare_reset(struct drm_device *dev); void intel_prepare_reset(struct drm_device *dev);
......
...@@ -423,8 +423,7 @@ vlv_update_plane(struct drm_plane *dplane, ...@@ -423,8 +423,7 @@ vlv_update_plane(struct drm_plane *dplane,
crtc_h--; crtc_h--;
linear_offset = y * fb->pitches[0] + x * cpp; linear_offset = y * fb->pitches[0] + x * cpp;
sprsurf_offset = intel_compute_tile_offset(dev_priv, &x, &y, sprsurf_offset = intel_compute_tile_offset(&x, &y, fb, 0,
fb->modifier[0], cpp,
fb->pitches[0], rotation); fb->pitches[0], rotation);
linear_offset -= sprsurf_offset; linear_offset -= sprsurf_offset;
...@@ -557,8 +556,7 @@ ivb_update_plane(struct drm_plane *plane, ...@@ -557,8 +556,7 @@ ivb_update_plane(struct drm_plane *plane,
sprscale = SPRITE_SCALE_ENABLE | (src_w << 16) | src_h; sprscale = SPRITE_SCALE_ENABLE | (src_w << 16) | src_h;
linear_offset = y * fb->pitches[0] + x * cpp; linear_offset = y * fb->pitches[0] + x * cpp;
sprsurf_offset = intel_compute_tile_offset(dev_priv, &x, &y, sprsurf_offset = intel_compute_tile_offset(&x, &y, fb, 0,
fb->modifier[0], cpp,
fb->pitches[0], rotation); fb->pitches[0], rotation);
linear_offset -= sprsurf_offset; linear_offset -= sprsurf_offset;
...@@ -695,8 +693,7 @@ ilk_update_plane(struct drm_plane *plane, ...@@ -695,8 +693,7 @@ ilk_update_plane(struct drm_plane *plane,
dvsscale = DVS_SCALE_ENABLE | (src_w << 16) | src_h; dvsscale = DVS_SCALE_ENABLE | (src_w << 16) | src_h;
linear_offset = y * fb->pitches[0] + x * cpp; linear_offset = y * fb->pitches[0] + x * cpp;
dvssurf_offset = intel_compute_tile_offset(dev_priv, &x, &y, dvssurf_offset = intel_compute_tile_offset(&x, &y, fb, 0,
fb->modifier[0], cpp,
fb->pitches[0], rotation); fb->pitches[0], rotation);
linear_offset -= dvssurf_offset; linear_offset -= dvssurf_offset;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册