From: Matthew Auld <matthew.auld@intel.com>
To: "Robert Beckett" <bob.beckett@collabora.com>,
"Jani Nikula" <jani.nikula@linux.intel.com>,
"Joonas Lahtinen" <joonas.lahtinen@linux.intel.com>,
"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
"Tvrtko Ursulin" <tvrtko.ursulin@linux.intel.com>,
"David Airlie" <airlied@linux.ie>,
"Daniel Vetter" <daniel@ffwll.ch>,
"Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
"Oak Zeng" <oak.zeng@intel.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/i915/ttm: fix large buffer population trucation
Date: Mon, 13 Dec 2021 13:02:44 +0000 [thread overview]
Message-ID: <e7cad6ca-d106-c529-6f22-93a7847cd7c0@intel.com> (raw)
In-Reply-To: <20211210195005.2582884-1-bob.beckett@collabora.com>
On 10/12/2021 19:50, Robert Beckett wrote:
> ttm->num_pages is uint32_t which was causing very large buffers to
> only populate a truncated size.
>
> This fixes gem_create@create-clear igt test on large memory systems.
>
> Fixes: 7ae034590cea ("drm/i915/ttm: add tt shmem backend")
> Signed-off-by: Robert Beckett <bob.beckett@collabora.com>
Nice catch,
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
> ---
> drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
> index 218a9b3037c7..923cc7ad8d70 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
> @@ -166,7 +166,7 @@ static int i915_ttm_tt_shmem_populate(struct ttm_device *bdev,
> struct intel_memory_region *mr = i915->mm.regions[INTEL_MEMORY_SYSTEM];
> struct i915_ttm_tt *i915_tt = container_of(ttm, typeof(*i915_tt), ttm);
> const unsigned int max_segment = i915_sg_segment_size();
> - const size_t size = ttm->num_pages << PAGE_SHIFT;
> + const size_t size = (size_t)ttm->num_pages << PAGE_SHIFT;
> struct file *filp = i915_tt->filp;
> struct sgt_iter sgt_iter;
> struct sg_table *st;
>
next prev parent reply other threads:[~2021-12-13 13:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-10 19:50 [PATCH] drm/i915/ttm: fix large buffer population trucation Robert Beckett
2021-12-13 13:02 ` Matthew Auld [this message]
2021-12-14 14:52 ` [Intel-gfx] " Matthew Auld
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=e7cad6ca-d106-c529-6f22-93a7847cd7c0@intel.com \
--to=matthew.auld@intel.com \
--cc=airlied@linux.ie \
--cc=bob.beckett@collabora.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=joonas.lahtinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oak.zeng@intel.com \
--cc=rodrigo.vivi@intel.com \
--cc=thomas.hellstrom@linux.intel.com \
--cc=tvrtko.ursulin@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;
as well as URLs for NNTP newsgroup(s).