aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_fbdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/i915/intel_fbdev.c')
-rw-r--r--drivers/gpu/drm/i915/intel_fbdev.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c
index 65329127f0b9..4fd5fdfef6bd 100644
--- a/drivers/gpu/drm/i915/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/intel_fbdev.c
@@ -121,8 +121,9 @@ static int intelfb_alloc(struct drm_fb_helper *helper,
121 container_of(helper, struct intel_fbdev, helper); 121 container_of(helper, struct intel_fbdev, helper);
122 struct drm_framebuffer *fb; 122 struct drm_framebuffer *fb;
123 struct drm_device *dev = helper->dev; 123 struct drm_device *dev = helper->dev;
124 struct drm_i915_private *dev_priv = to_i915(dev);
124 struct drm_mode_fb_cmd2 mode_cmd = {}; 125 struct drm_mode_fb_cmd2 mode_cmd = {};
125 struct drm_i915_gem_object *obj; 126 struct drm_i915_gem_object *obj = NULL;
126 int size, ret; 127 int size, ret;
127 128
128 /* we don't do packed 24bpp */ 129 /* we don't do packed 24bpp */
@@ -139,7 +140,12 @@ static int intelfb_alloc(struct drm_fb_helper *helper,
139 140
140 size = mode_cmd.pitches[0] * mode_cmd.height; 141 size = mode_cmd.pitches[0] * mode_cmd.height;
141 size = PAGE_ALIGN(size); 142 size = PAGE_ALIGN(size);
142 obj = i915_gem_object_create_stolen(dev, size); 143
144 /* If the FB is too big, just don't use it since fbdev is not very
145 * important and we should probably use that space with FBC or other
146 * features. */
147 if (size * 2 < dev_priv->gtt.stolen_usable_size)
148 obj = i915_gem_object_create_stolen(dev, size);
143 if (obj == NULL) 149 if (obj == NULL)
144 obj = i915_gem_alloc_object(dev, size); 150 obj = i915_gem_alloc_object(dev, size);
145 if (!obj) { 151 if (!obj) {