diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-07-01 22:14:03 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-07-01 22:10:49 +0100 |
commit | afcd41820d7481912b49093670e9d7a4a6a2338f (patch) | |
tree | 70845ebb95e98ae9e53308b6fe1470591270d45c /src | |
parent | f8778b66a98d68e622cdf5b2d1fd959c4f7a2b2b (diff) |
Reduce front buffer stride prior to rejection
If we reject the front buffer because it has too large a stride, repeat
the allocation using untiled for the cases where we can utilize laxer
hardware restrictions.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r-- | src/intel_memory.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/intel_memory.c b/src/intel_memory.c index a3d67b47..8443c919 100644 --- a/src/intel_memory.c +++ b/src/intel_memory.c @@ -191,7 +191,19 @@ drm_intel_bo *intel_allocate_framebuffer(ScrnInfoPtr scrn, tiling_mode = I915_TILING_NONE; width = intel_pad_drawable_width(width); + if (!intel_check_display_stride(scrn, width * intel->cpp, + tiling_mode != I915_TILING_NONE)) + tiling_mode = I915_TILING_NONE; + if (!intel_check_display_stride(scrn, width * intel->cpp, + tiling_mode != I915_TILING_NONE)) { + xf86DrvMsg(scrn->scrnIndex, X_ERROR, + "Expected front buffer stride %d kB " + "will exceed display limit\n", + width * intel->cpp / 1024); + return NULL; + } +retry: front_buffer = drm_intel_bo_alloc_tiled(intel->bufmgr, "front buffer", width, height, intel->cpp, &tiling_mode, &pitch, 0); @@ -203,10 +215,15 @@ drm_intel_bo *intel_allocate_framebuffer(ScrnInfoPtr scrn, if (!intel_check_display_stride(scrn, pitch, tiling_mode != I915_TILING_NONE)) { + drm_intel_bo_unreference(front_buffer); + if (tiling_mode != I915_TILING_NONE) { + tiling_mode = I915_TILING_NONE; + goto retry; + } + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Front buffer stride %ld kB " "exceeds display limit\n", pitch / 1024); - drm_intel_bo_unreference(front_buffer); return NULL; } |