Unverified Commit 2bb026f3 authored by Tvrtko Ursulin's avatar Tvrtko Ursulin Committed by Rodrigo Vivi
Browse files

drm/xe: Rename XE_BO_FLAG_SCANOUT to XE_BO_FLAG_FORCE_WC



Rename XE_BO_FLAG_SCANOUT to XE_BO_FLAG_FORCE_WC so that the usage of the
flag can legitimately be expanded to more than just the actual frame-
buffer objects.

Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@igalia.com>
Suggested-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patch.msgid.link/20260324084018.20353-2-tvrtko.ursulin@igalia.com


Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent 9e60ee0e
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -56,9 +56,11 @@ struct drm_gem_object *intel_fbdev_fb_bo_create(struct drm_device *drm, int size
	if (intel_fbdev_fb_prefer_stolen(drm, size)) {
		obj = xe_bo_create_pin_map_novm(xe, xe_device_get_root_tile(xe),
						size,
						ttm_bo_type_kernel, XE_BO_FLAG_SCANOUT |
						ttm_bo_type_kernel,
						XE_BO_FLAG_FORCE_WC |
						XE_BO_FLAG_STOLEN |
						XE_BO_FLAG_GGTT, false);
						XE_BO_FLAG_GGTT,
						false);
		if (!IS_ERR(obj))
			drm_info(&xe->drm, "Allocated fbdev into stolen\n");
		else
@@ -69,9 +71,11 @@ struct drm_gem_object *intel_fbdev_fb_bo_create(struct drm_device *drm, int size

	if (IS_ERR(obj)) {
		obj = xe_bo_create_pin_map_novm(xe, xe_device_get_root_tile(xe), size,
						ttm_bo_type_kernel, XE_BO_FLAG_SCANOUT |
						ttm_bo_type_kernel,
						XE_BO_FLAG_FORCE_WC |
						XE_BO_FLAG_VRAM_IF_DGFX(xe_device_get_root_tile(xe)) |
						XE_BO_FLAG_GGTT, false);
						XE_BO_FLAG_GGTT,
						false);
	}

	if (IS_ERR(obj)) {
+3 −3
Original line number Diff line number Diff line
@@ -42,9 +42,9 @@ static int xe_display_bo_framebuffer_init(struct drm_gem_object *obj,
	if (ret)
		goto err;

	if (!(bo->flags & XE_BO_FLAG_SCANOUT)) {
	if (!(bo->flags & XE_BO_FLAG_FORCE_WC)) {
		/*
		 * XE_BO_FLAG_SCANOUT should ideally be set at creation, or is
		 * XE_BO_FLAG_FORCE_WC should ideally be set at creation, or is
		 * automatically set when creating FB. We cannot change caching
		 * mode when the bo is VM_BINDed, so we can only set
		 * coherency with display when unbound.
@@ -54,7 +54,7 @@ static int xe_display_bo_framebuffer_init(struct drm_gem_object *obj,
			ret = -EINVAL;
			goto err;
		}
		bo->flags |= XE_BO_FLAG_SCANOUT;
		bo->flags |= XE_BO_FLAG_FORCE_WC;
	}
	ttm_bo_unreserve(&bo->ttm);
	return 0;
+3 −1
Original line number Diff line number Diff line
@@ -54,7 +54,9 @@ static struct intel_dsb_buffer *xe_dsb_buffer_create(struct drm_device *drm, siz
					PAGE_ALIGN(size),
					ttm_bo_type_kernel,
					XE_BO_FLAG_VRAM_IF_DGFX(xe_device_get_root_tile(xe)) |
					XE_BO_FLAG_SCANOUT | XE_BO_FLAG_GGTT, false);
					XE_BO_FLAG_FORCE_WC |
					XE_BO_FLAG_GGTT,
					false);
	if (IS_ERR(obj)) {
		ret = PTR_ERR(obj);
		goto err_pin_map;
+1 −1
Original line number Diff line number Diff line
@@ -429,7 +429,7 @@ int intel_plane_pin_fb(struct intel_plane_state *new_plane_state,
		return 0;

	/* We reject creating !SCANOUT fb's, so this is weird.. */
	drm_WARN_ON(bo->ttm.base.dev, !(bo->flags & XE_BO_FLAG_SCANOUT));
	drm_WARN_ON(bo->ttm.base.dev, !(bo->flags & XE_BO_FLAG_FORCE_WC));

	vma = __xe_pin_fb_vma(intel_fb, &new_plane_state->view.gtt, alignment);

+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ initial_plane_bo(struct xe_device *xe,
	if (plane_config->size == 0)
		return NULL;

	flags = XE_BO_FLAG_SCANOUT | XE_BO_FLAG_GGTT;
	flags = XE_BO_FLAG_FORCE_WC | XE_BO_FLAG_GGTT;

	base = round_down(plane_config->base, page_size);
	if (IS_DGFX(xe)) {
Loading