All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/6] drm/i915: split aligned height calculation out v2
@ 2014-02-07 20:10 Jesse Barnes
  2014-02-07 20:10 ` [PATCH 2/6] drm/i915: get_plane_config for i9xx v10 Jesse Barnes
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Jesse Barnes @ 2014-02-07 20:10 UTC (permalink / raw)
  To: intel-gfx

For use by get_plane_config.

v2: cleanup tile_height bits (Chris)

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
---
 drivers/gpu/drm/i915/intel_display.c |   15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 4d4a0d9..5f0e4df 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -1929,6 +1929,14 @@ static bool need_vtd_wa(struct drm_device *dev)
 	return false;
 }
 
+static int intel_align_height(struct drm_device *dev, int height, bool tiled)
+{
+	int tile_height;
+
+	tile_height = tiled ? (IS_GEN2(dev) ? 16 : 8) : 1;
+	return ALIGN(height, tile_height);
+}
+
 int
 intel_pin_and_fence_fb_obj(struct drm_device *dev,
 			   struct drm_i915_gem_object *obj,
@@ -10559,7 +10567,7 @@ int intel_framebuffer_init(struct drm_device *dev,
 			   struct drm_mode_fb_cmd2 *mode_cmd,
 			   struct drm_i915_gem_object *obj)
 {
-	int aligned_height, tile_height;
+	int aligned_height;
 	int pitch_limit;
 	int ret;
 
@@ -10653,9 +10661,8 @@ int intel_framebuffer_init(struct drm_device *dev,
 	if (mode_cmd->offsets[0] != 0)
 		return -EINVAL;
 
-	tile_height = IS_GEN2(dev) ? 16 : 8;
-	aligned_height = ALIGN(mode_cmd->height,
-			       obj->tiling_mode ? tile_height : 1);
+	aligned_height = intel_align_height(dev, mode_cmd->height,
+					    obj->tiling_mode);
 	/* FIXME drm helper for size checks (especially planar formats)? */
 	if (obj->base.size < aligned_height * mode_cmd->pitches[0])
 		return -EINVAL;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2014-02-10 23:35 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-07 20:10 [PATCH 1/6] drm/i915: split aligned height calculation out v2 Jesse Barnes
2014-02-07 20:10 ` [PATCH 2/6] drm/i915: get_plane_config for i9xx v10 Jesse Barnes
2014-02-10 23:35   ` Daniel Vetter
2014-02-07 20:10 ` [PATCH 3/6] drm/i915: get_plane_config support for ILK+ Jesse Barnes
2014-02-07 20:10 ` [PATCH 4/6] drm/i915: alloc intel_fb in the intel_fbdev struct Jesse Barnes
2014-02-10  9:38   ` Daniel Vetter
2014-02-10 10:01   ` [PATCH 1/2] drm/i915: Use normal fb deref for the fbcon framebuffer Daniel Vetter
2014-02-10 10:01     ` [PATCH 2/2] drm/i915: Fix error path leak in fbdev fb allocation Daniel Vetter
2014-02-10 17:00   ` [PATCH 1/2] drm/i915: Use normal fb deref for the fbcon framebuffer Daniel Vetter
2014-02-10 17:00     ` [PATCH 2/2] drm/i915: Fix error path leak in fbdev fb allocation Daniel Vetter
2014-02-10 17:47       ` Jesse Barnes
2014-02-10 23:19         ` Daniel Vetter
2014-02-10 17:38     ` [PATCH 1/2] drm/i915: Use normal fb deref for the fbcon framebuffer Jesse Barnes
2014-02-07 20:10 ` [PATCH 5/6] drm/i915: allow re-use BIOS connector config for initial fbdev config Jesse Barnes
2014-02-10 10:22   ` Daniel Vetter
2014-02-07 20:10 ` [PATCH 6/6] drm/i915: Wrap the preallocated BIOS framebuffer and preserve for KMS fbcon v10 Jesse Barnes

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.