From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Intel-gfx@lists.freedesktop.org
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
Daniel Vetter <daniel.vetter@intel.com>
Subject: [PATCH 07/13] drm/i915: Switch +intel_fb_align_height to fb format modifiers
Date: Tue, 10 Feb 2015 17:16:10 +0000 [thread overview]
Message-ID: <1423588576-11339-8-git-send-email-tvrtko.ursulin@linux.intel.com> (raw)
In-Reply-To: <1423588576-11339-1-git-send-email-tvrtko.ursulin@linux.intel.com>
From: Daniel Vetter <daniel.vetter@ffwll.ch>
With this we can treat the fb format modifier completely independently
from the fencing mode in obj->tiling_mode in the initial plane code.
Which means new tiling modes without any gtt fence are now fully
support in the core i915 driver code.
v2: Also add pixel_format while at it, we need this to compute the
height for the new tiling formats.
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
drivers/gpu/drm/i915/intel_display.c | 20 ++++++++++++++------
drivers/gpu/drm/i915/intel_drv.h | 3 ++-
drivers/gpu/drm/i915/intel_fbdev.c | 3 ++-
3 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index f2622e3..ec172f9 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2190,11 +2190,15 @@ static bool need_vtd_wa(struct drm_device *dev)
}
int
-intel_fb_align_height(struct drm_device *dev, int height, unsigned int tiling)
+intel_fb_align_height(struct drm_device *dev, int height,
+ uint32_t pixel_format,
+ uint64_t fb_format_modifier)
{
int tile_height;
- tile_height = tiling ? (IS_GEN2(dev) ? 16 : 8) : 1;
+ tile_height = fb_format_modifier == I915_FORMAT_MOD_X_TILED ?
+ (IS_GEN2(dev) ? 16 : 8) : 1;
+
return ALIGN(height, tile_height);
}
@@ -6658,7 +6662,8 @@ i9xx_get_initial_plane_config(struct intel_crtc *crtc,
fb->pitches[0] = val & 0xffffffc0;
aligned_height = intel_fb_align_height(dev, fb->height,
- plane_config->tiling);
+ fb->pixel_format,
+ fb->modifier[0]);
plane_config->size = PAGE_ALIGN(fb->pitches[0] * aligned_height);
@@ -7700,7 +7705,8 @@ skylake_get_initial_plane_config(struct intel_crtc *crtc,
fb->pitches[0] = (val & 0x3ff) * stride_mult;
aligned_height = intel_fb_align_height(dev, fb->height,
- plane_config->tiling);
+ fb->pixel_format,
+ fb->modifier[0]);
plane_config->size = ALIGN(fb->pitches[0] * aligned_height, PAGE_SIZE);
@@ -7796,7 +7802,8 @@ ironlake_get_initial_plane_config(struct intel_crtc *crtc,
fb->pitches[0] = val & 0xffffffc0;
aligned_height = intel_fb_align_height(dev, fb->height,
- plane_config->tiling);
+ fb->pixel_format,
+ fb->modifier[0]);
plane_config->size = PAGE_ALIGN(fb->pitches[0] * aligned_height);
@@ -12824,7 +12831,8 @@ static int intel_framebuffer_init(struct drm_device *dev,
return -EINVAL;
aligned_height = intel_fb_align_height(dev, mode_cmd->height,
- obj->tiling_mode);
+ mode_cmd->pixel_format,
+ mode_cmd->modifier[0]);
/* FIXME drm helper for size checks (especially planar formats)? */
if (obj->base.size < aligned_height * mode_cmd->pitches[0])
return -EINVAL;
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 76b3c20..b9598ba 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -879,7 +879,8 @@ void intel_frontbuffer_flip(struct drm_device *dev,
}
int intel_fb_align_height(struct drm_device *dev, int height,
- unsigned int tiling);
+ uint32_t pixel_format,
+ uint64_t fb_format_modifier);
void intel_fb_obj_flush(struct drm_i915_gem_object *obj, bool retire);
diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c
index 3001a867..234a699 100644
--- a/drivers/gpu/drm/i915/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/intel_fbdev.c
@@ -594,7 +594,8 @@ static bool intel_fbdev_init_bios(struct drm_device *dev,
cur_size = intel_crtc->config->base.adjusted_mode.crtc_vdisplay;
cur_size = intel_fb_align_height(dev, cur_size,
- plane_config->tiling);
+ fb->base.pixel_format,
+ fb->base.modifier[0]);
cur_size *= fb->base.pitches[0];
DRM_DEBUG_KMS("pipe %c area: %dx%d, bpp: %d, size: %d\n",
pipe_name(intel_crtc->pipe),
--
2.2.2
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-02-10 17:16 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-09 18:03 [PATCH 0/5] i915 fb modifier support, respun Daniel Vetter
2015-02-09 18:03 ` [PATCH 1/5] drm/i915: Add tiled framebuffer modifiers Daniel Vetter
2015-02-10 11:05 ` Tvrtko Ursulin
2015-02-10 11:28 ` [PATCH] " Daniel Vetter
2015-02-10 16:16 ` shuang.he
2015-02-10 11:50 ` [PATCH] drm/i915: Add fb format modifier support Daniel Vetter
2015-02-09 18:03 ` [PATCH 2/5] " Daniel Vetter
2015-02-10 11:09 ` Tvrtko Ursulin
2015-02-10 11:28 ` [PATCH] " Daniel Vetter
2015-02-09 18:03 ` [PATCH 3/5] drm/i915: Use fb format modifiers in skylake_update_primary_plane Daniel Vetter
2015-02-10 16:25 ` Damien Lespiau
2015-02-09 18:03 ` [PATCH 4/5] drm/i915: Announce support for framebuffer modifiers Daniel Vetter
2015-02-09 18:03 ` [PATCH 5/5] drm: Also check unused fields for addfb2 Daniel Vetter
2015-02-10 10:56 ` [PATCH 1/2] drm/i915: Set up fb format modifier for initial plane config Daniel Vetter
2015-02-10 10:56 ` [PATCH 2/2] drm/i915: Switch +intel_fb_align_height to fb format modifiers Daniel Vetter
2015-02-10 11:01 ` [PATCH 5/5] drm: Also check unused fields for addfb2 Chris Wilson
2015-02-10 11:36 ` Daniel Vetter
2015-02-10 11:51 ` Chris Wilson
2015-02-10 17:16 ` [PATCH v2 00/13] i915 fb modifier support, respun Tvrtko Ursulin
2015-02-10 17:16 ` [PATCH 01/13] RFC: drm: add support for tiled/compressed/etc modifier in addfb2 Tvrtko Ursulin
2015-02-10 17:16 ` [PATCH 02/13] drm/i915: Add tiled framebuffer modifiers Tvrtko Ursulin
2015-02-10 17:16 ` [PATCH 03/13] drm/i915: Add fb format modifier support Tvrtko Ursulin
2015-02-10 17:16 ` [PATCH 04/13] drm/i915: Show frame buffer modifier in debug info Tvrtko Ursulin
2015-02-11 7:34 ` Daniel Vetter
2015-02-10 17:16 ` [PATCH 05/13] drm: Also check unused fields for addfb2 Tvrtko Ursulin
2015-02-10 17:16 ` [PATCH 06/13] drm/i915: Set up fb format modifier for initial plane config Tvrtko Ursulin
2015-02-10 17:16 ` Tvrtko Ursulin [this message]
2015-02-10 17:16 ` [PATCH 08/13] drm/i915: Use fb format modifiers in skylake_update_primary_plane Tvrtko Ursulin
2015-02-10 17:16 ` [PATCH 09/13] drm/i915/skl: CS flips are not supported with execlists Tvrtko Ursulin
2015-02-11 7:40 ` Daniel Vetter
2015-02-11 9:58 ` Tvrtko Ursulin
2015-02-10 17:16 ` [PATCH 10/13] drm/i915/skl: Use fb modifiers for sprites Tvrtko Ursulin
2015-02-11 7:47 ` Daniel Vetter
2015-02-10 17:16 ` [PATCH 11/13] drm/i915: Use fb modifiers in intel_check_cursor_plane Tvrtko Ursulin
2015-02-11 7:53 ` Daniel Vetter
2015-02-10 17:16 ` [PATCH 12/13] drm/i915: Use fb modifiers in intel_pin_and_fence_fb_obj Tvrtko Ursulin
2015-02-10 17:16 ` [PATCH 13/13] drm/i915: Announce support for framebuffer modifiers Tvrtko Ursulin
2015-02-11 2:46 ` shuang.he
2015-02-11 7:56 ` Daniel Vetter
2015-02-11 7:58 ` Daniel Vetter
2015-02-11 9:57 ` Tvrtko Ursulin
2015-02-11 10:25 ` Daniel Vetter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1423588576-11339-8-git-send-email-tvrtko.ursulin@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=Intel-gfx@lists.freedesktop.org \
--cc=daniel.vetter@ffwll.ch \
--cc=daniel.vetter@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox