Commit ddb78a51 authored by Nirmoy Das's avatar Nirmoy Das
Browse files

drm/i915/display: Set I915_BO_ALLOC_USER for fb



Framebuffer is exposed to userspace so make sure we set
proper flags for it. Set I915_BO_PREALLOC for prealloced
fb so that ttm won't clear existing data.

Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Andi Shyti <andi.shyti@linux.intel.com>
Cc: Andrzej Hajda <andrzej.hajda@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Imre Deak <imre.deak@intel.com>
Signed-off-by: default avatarNirmoy Das <nirmoy.das@intel.com>
Reviewed-by: default avatarAndi Shyti <andi.shyti@linux.intel.com>
Reviewed-by: default avatarAndrzej Hajda <andrzej.hajda@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230404143100.10452-2-nirmoy.das@intel.com
parent ddb24fc5
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -163,7 +163,8 @@ static int intelfb_alloc(struct drm_fb_helper *helper,
	obj = ERR_PTR(-ENODEV);
	if (HAS_LMEM(dev_priv)) {
		obj = i915_gem_object_create_lmem(dev_priv, size,
						  I915_BO_ALLOC_CONTIGUOUS);
						  I915_BO_ALLOC_CONTIGUOUS |
						  I915_BO_ALLOC_USER);
	} else {
		/*
		 * If the FB is too big, just don't use it since fbdev is not very
+3 −1
Original line number Diff line number Diff line
@@ -110,7 +110,9 @@ initial_plane_vma(struct drm_i915_private *i915,
	    size * 2 > i915->stolen_usable_size)
		return NULL;

	obj = i915_gem_object_create_region_at(mem, phys_base, size, 0);
	obj = i915_gem_object_create_region_at(mem, phys_base, size,
					       I915_BO_ALLOC_USER |
					       I915_BO_PREALLOC);
	if (IS_ERR(obj))
		return NULL;