From: Daniel Vetter <daniel@ffwll.ch>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 4/4] drm/i915: Simplify relocate_entry_gtt() and make 64-bit safe
Date: Mon, 11 Aug 2014 14:16:47 +0200 [thread overview]
Message-ID: <20140811121647.GT8727@phenom.ffwll.local> (raw)
In-Reply-To: <1407648551-10981-4-git-send-email-chris@chris-wilson.co.uk>
On Sun, Aug 10, 2014 at 06:29:11AM +0100, Chris Wilson wrote:
> Even though we should not try to use 4+GiB GTTs on 32-bit systems, by
> using a local variable we can future proof the code whilst making it
> easier to read.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Appeased checkpatch a bit for the long lines and pulled this in with the
other patches from this series, except the likely/unlikely one.
Thanks, Daniel
> ---
> drivers/gpu/drm/i915/i915_gem_execbuffer.c | 23 ++++++++++-------------
> 1 file changed, 10 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> index e6fcd0594bd5..5c04f77f8a66 100644
> --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> @@ -302,7 +302,7 @@ relocate_entry_gtt(struct drm_i915_gem_object *obj,
> struct drm_device *dev = obj->base.dev;
> struct drm_i915_private *dev_priv = dev->dev_private;
> uint64_t delta = reloc->delta + target_offset;
> - uint32_t __iomem *reloc_entry;
> + uint64_t offset;
> void __iomem *reloc_page;
> int ret;
>
> @@ -315,25 +315,22 @@ relocate_entry_gtt(struct drm_i915_gem_object *obj,
> return ret;
>
> /* Map the page containing the relocation we're going to perform. */
> - reloc->offset += i915_gem_obj_ggtt_offset(obj);
> + offset = i915_gem_obj_ggtt_offset(obj);
> + offset += reloc->offset;
> reloc_page = io_mapping_map_atomic_wc(dev_priv->gtt.mappable,
> - reloc->offset & PAGE_MASK);
> - reloc_entry = (uint32_t __iomem *)
> - (reloc_page + offset_in_page(reloc->offset));
> - iowrite32(lower_32_bits(delta), reloc_entry);
> + offset & PAGE_MASK);
> + iowrite32(lower_32_bits(delta), reloc_page + offset_in_page(offset));
>
> if (INTEL_INFO(dev)->gen >= 8) {
> - reloc_entry += 1;
> + offset += sizeof(uint32_t);
>
> - if (offset_in_page(reloc->offset + sizeof(uint32_t)) == 0) {
> + if (offset_in_page(offset) == 0) {
> io_mapping_unmap_atomic(reloc_page);
> - reloc_page = io_mapping_map_atomic_wc(
> - dev_priv->gtt.mappable,
> - reloc->offset + sizeof(uint32_t));
> - reloc_entry = reloc_page;
> + reloc_page = io_mapping_map_atomic_wc(dev_priv->gtt.mappable,
> + offset);
> }
>
> - iowrite32(upper_32_bits(delta), reloc_entry);
> + iowrite32(upper_32_bits(delta), reloc_page + offset_in_page(offset));
> }
>
> io_mapping_unmap_atomic(reloc_page);
> --
> 2.1.0.rc1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
prev parent reply other threads:[~2014-08-11 12:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-09 20:21 [PATCH] drm/i915: Pre-validate the NEED_GTTS flag for execbuffer Chris Wilson
2014-08-10 5:29 ` [PATCH 1/4] " Chris Wilson
2014-08-10 5:29 ` [PATCH 2/4] drm/i915: Mark the execbuffer validation failures as unlikely Chris Wilson
2014-08-11 12:11 ` Daniel Vetter
2014-08-10 5:29 ` [PATCH 3/4] drm/i915: Remove redundant list_empty(eb->vmas) tests in execbuffer Chris Wilson
2014-08-10 5:29 ` [PATCH 4/4] drm/i915: Simplify relocate_entry_gtt() and make 64-bit safe Chris Wilson
2014-08-11 12:16 ` Daniel Vetter [this message]
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=20140811121647.GT8727@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
/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