Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Auld <matthew.auld@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
	dri-devel@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH] drm/i915: opportunistically apply ALLOC_CONTIGIOUS
Date: Wed,  2 Feb 2022 17:31:54 +0000	[thread overview]
Message-ID: <20220202173154.3758970-1-matthew.auld@intel.com> (raw)

It looks like this code was accidentally dropped at some point(in a
slightly different form), so add it back. The gist is that if we know
the allocation will be one single chunk, then we can just annotate the
BO with I915_BO_ALLOC_CONTIGUOUS, even if the user doesn't bother. In
the future this might prove to be potentially useful.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
---
 drivers/gpu/drm/i915/gem/i915_gem_region.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_region.c b/drivers/gpu/drm/i915/gem/i915_gem_region.c
index a4350227e9ae..dd414a2bcb06 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_region.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_region.c
@@ -57,6 +57,9 @@ i915_gem_object_create_region(struct intel_memory_region *mem,
 
 	size = round_up(size, default_page_size);
 
+	if (default_page_size == size)
+		flags |= I915_BO_ALLOC_CONTIGUOUS;
+
 	GEM_BUG_ON(!size);
 	GEM_BUG_ON(!IS_ALIGNED(size, I915_GTT_MIN_ALIGNMENT));
 
-- 
2.34.1


             reply	other threads:[~2022-02-02 17:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-02 17:31 Matthew Auld [this message]
2022-02-02 20:04 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: opportunistically apply ALLOC_CONTIGIOUS Patchwork
2022-02-02 23:09 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2022-02-03  8:01 ` [Intel-gfx] [PATCH] " Thomas Hellström
2022-03-07 14:26 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: opportunistically apply ALLOC_CONTIGIOUS (rev2) Patchwork
2022-03-07 17:52 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2022-03-08 12:26   ` Matthew Auld
2022-03-08 17:11     ` Vudum, Lakshminarayana
2022-03-08 12:41 ` [Intel-gfx] [PATCH] drm/i915: opportunistically apply ALLOC_CONTIGIOUS Das, Nirmoy
2022-03-08 17:08 ` [Intel-gfx] ✓ Fi.CI.IGT: success for drm/i915: opportunistically apply ALLOC_CONTIGIOUS (rev2) Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220202173154.3758970-1-matthew.auld@intel.com \
    --to=matthew.auld@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=thomas.hellstrom@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox