public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/4] drm/i915: kill obj->gtt_offset
Date: Fri, 15 Apr 2011 21:04:18 +0100	[thread overview]
Message-ID: <0d30dc$ls08is@orsmga001.jf.intel.com> (raw)
In-Reply-To: <20110415191859.GC3503@viiv.ffwll.ch>

On Fri, 15 Apr 2011 21:19:00 +0200, Daniel Vetter <daniel@ffwll.ch> wrote:
> Mucking around with drm_mm_node->start is a bad idea, it's used to track
> the end of the preceding free area (if there is one).
> 
> Also I find having a bo with a not-page-aligned gtt offset kinda creepy
> ... So if the kernel really needs to track this, could it be tracked in a
> special vmap handle object?

All the relocation handling code is generic: gtt_offset + user delta
Since the gtt_offset is computed once, the vmap code applies the offset to
it directly. I suppose drm_i915_gem_object could grow an additional
gtt_offset_offset...

> Or is this really required, because all the
> normal memory mapper syscalls only work on page boundaries, too. I.e. why
> can't userspace keep track of the offset?

Because that is ugly. Userspace passes in user_addr + user_length which
can be precisely checked for the proposed access.

The alternative you propose is to pass in (user_page_base_addr,
user_page_offset) + user_length and then continue to track
user_page_offset in the userspace code to apply to reloc.delta as well.

In all, I'm favouring keeping gtt_offset. Can we postpone this one until
you've had a chance to review vmap, which I promise will be in the next
set for drm-intel-next-proposed...
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

  reply	other threads:[~2011-04-15 20:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-15 18:57 [PATCH 0/4] embed drm_mm_node Daniel Vetter
2011-04-15 18:57 ` [PATCH 1/4] drm/i915: embed struct drm_mm_node into struct drm_i915_gem_object Daniel Vetter
2011-04-15 23:01   ` Dave Airlie
2011-04-16 10:59     ` Daniel Vetter
2011-04-15 18:57 ` [PATCH 2/4] drm/i915: kill obj->gtt_offset Daniel Vetter
2011-04-15 18:56   ` Chris Wilson
2011-04-15 19:19     ` Daniel Vetter
2011-04-15 20:04       ` Chris Wilson [this message]
2011-04-15 18:57 ` [PATCH 3/4] drm/i915: kill gtt_list Daniel Vetter
2011-04-15 18:57 ` [PATCH 4/4] drm/i915: use drm_mm_for_each_scanned_node_reverse helper Daniel Vetter

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='0d30dc$ls08is@orsmga001.jf.intel.com' \
    --to=chris@chris-wilson.co.uk \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel@ffwll.ch \
    --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