]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
drm/i915: don't allocate fbcon from stolen memory if it's too big
authorPaulo Zanoni <paulo.r.zanoni@intel.com>
Wed, 23 Sep 2015 15:52:23 +0000 (12:52 -0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 9 Oct 2015 07:31:58 +0000 (09:31 +0200)
commit3badb49f08f66fbdbf9da8335c5db4b05a1677c8
treea28a545f3914ccb62a1d9cfc5913cb2c269fc315
parent3a2fb2c394ff0f0ea90bacc557147d9ac733d13c
drm/i915: don't allocate fbcon from stolen memory if it's too big

Technology has evolved and now we have eDP panels with 3200x1800
resolution. In the meantime, the BIOS guys didn't change the default
32mb for stolen memory. On top of that, we can't assume our users will
be able to increase the default stolen memory size to more than 32mb -
I'm not even sure all BIOSes allow that.

So just the fbcon buffer alone eats 22mb of my stolen memroy, and due
to the BDW/SKL restriction of not using the last 8mb of stolen memory,
all that's left for FBC is 2mb! Since fbcon is not the coolest feature
ever, I think it's better to save our precious stolen resource to FBC
and the other guys.

On the other hand, we really want to use as much stolen memory as
possible, since on some older systems the stolen memory may be a
considerable percentage of the total available memory.

This patch tries to achieve a little balance using a simple heuristic:
if the fbcon wants more than half of the available stolen memory,
don't use stolen memory in order to leave some for FBC and the other
features.

The long term plan should be to implement a way to set priorities for
stolen memory allocation and then evict low priority users when the
high priority ones need the memory. While we still don't have that,
let's try to make FBC usable with the simple solution.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_fbdev.c