drm/i915: Framebuffers need not be limited to 256MB on gen8+.
Subsystems (2)
RFC 1/1 drm/i915: Framebuffers need not be limited to 256MB on gen8+.
From: Deepak S <[email protected]>
The restriction of pinningFramebuffer to first 256MB is removed from gen8+. Removing the restriction so that FB can be pinned in any space within GTT/PPGTT. Also, for gen8+ no need to use pin_mappable for Framebuffer & also we do not take fence as Framebuffer compression is not enabled.
--- drivers/gpu/drm/i915/i915_gem.c | 9 +++++++-- drivers/gpu/drm/i915/intel_display.c | 11 +++++++---- 2 files changed, 14 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/i915_gem.c +7 -2
@@ -3941,6 +3941,7 @@ i915_gem_object_pin_to_display_plane(struct drm_i915_gem_object *obj, struct intel_engine_cs *pipelined) {u32 old_read_domains, old_write_domain; +struct drm_device *dev = obj->base.dev;bool was_pin_display;int ret;
@@ -3972,9 +3973,13 @@ i915_gem_object_pin_to_display_plane(struct drm_i915_gem_object *obj,/* As the user may map the buffer once pinned in the display plane * (e.g. libkms for the bootup splash), we have to ensure that we -* always use map_and_fenceable for all scanout buffers. +* always use map_and_fenceable for all scanout buffers. No need +* of map_fenceable for >= gen8 */ - ret =i915_gem_obj_ggtt_pin (obj, alignment,PIN_MAPPABLE ); +if ((INTEL_INFO (dev)->gen >=8 )) + ret =i915_gem_obj_ggtt_pin (obj, alignment,0 ); +else + ret =i915_gem_obj_ggtt_pin (obj, alignment,PIN_MAPPABLE );if (ret) goto err_unpin_display;
drivers/gpu/drm/i915/intel_display.c +7 -4
@@ -2267,11 +2267,14 @@ intel_pin_and_fence_fb_obj(struct drm_plane *plane,/* Install a fence for tiled scan-out. Pre-i965 always needs a * fence, whereas 965+ only requires a fence if using * framebuffer compression. For simplicity, we always install -* a fence as the cost is not that onerous. +* a fence as the cost is not that onerous. Fence is only required +* for gen 7 & below */ - ret =i915_gem_object_get_fence (obj); -if (ret) - goto err_unpin; +if ((INTEL_INFO (dev)->gen <=7 )) { + ret =i915_gem_object_get_fence (obj); +if (ret) + goto err_unpin; + }i915_gem_object_pin_fence (obj);
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 6 lines · On Thu, Feb 26, 2015 at 09:01:52PM +0530, [email protected] wrote:
From: Deepak S <[email protected]>
The restriction of pinningFramebuffer to first 256MB is removed from gen8+. Removing the restriction so that FB can be pinned in any space within GTT/PPGTT. Also, for gen8+ no need to use
pin_mappablefor Framebuffer & also we do not take fence as Framebuffer compression is not enabled.
Not quite, the reason why we restrict the framebuffer to mappable was that certain display servers depend upon being able to GTT mmap the framebuffer for direct access. Thus they would crash if we found that the framebuffer was already pinned in an unreachable location. That legacy code is currently still able to run on gen8+ and so you need to have userspace request an ABI break...
-Chris
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 8 lines · Chris Wilson
Quoted 6 lines · On Thu, Feb 26, 2015 at 09:01:52PM +0530, [email protected] wrote:
From: Deepak S <[email protected]>
The restriction of pinningFramebuffer to first 256MB is removed from gen8+. Removing the restriction so that FB can be pinned in any space within GTT/PPGTT. Also, for gen8+ no need to use
pin_mappablefor Framebuffer & also we do not take fence as Framebuffer compression is not enabled.
Quoted 6 lines
Not quite, the reason why we restrict the framebuffer to mappable was that certain display servers depend upon being able to GTT mmap the framebuffer for direct access. Thus they would crash if we found that the framebuffer was already pinned in an unreachable location. That legacy code is currently still able to run on gen8+ and so you need to have userspace request an ABI break...
Also, if we do that, we need to make sure we can't bind the buffer at the top of GGTT as we need to be able to prefetch 128 PTEs past the fb? (on SKL 136, "The end of the surface cannot be within 136 PTEs of the end of the graphics memory").
Signature · 5 lines
Damien _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx