intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Chris Wilson <chris@chris-wilson.co.uk>
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:19:00 +0200	[thread overview]
Message-ID: <20110415191859.GC3503@viiv.ffwll.ch> (raw)
In-Reply-To: <849307$cgjlsv@azsmga001.ch.intel.com>

On Fri, Apr 15, 2011 at 07:56:10PM +0100, Chris Wilson wrote:
> On Fri, 15 Apr 2011 20:57:36 +0200, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> > Yet another massive round of sed'ing.
> 
> The only hitch here is that in the vmap code obj->gtt_offset !=
> obj->gtt_space.offset.
> 
> There obj->gtt_space.offset is the base of the page aligned region allocated
> in the GTT and obj->gtt_offset is obj->gtt_space.offset +
> offset_in_page(user_addr).
> 
> I haven't checked but is obj->gtt_space immutable by the caller, i.e. can
> we modify obj->gtt_space.offset and drm_mm still function correctly? Bake
> the page aligned assumption into drm_mm? Or simply undo the page_offset
> when releasing the gtt_space...? The latter sounds like it would work
> best.

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? 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?
-Daniel
-- 
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48

  reply	other threads:[~2011-04-15 19:19 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 [this message]
2011-04-15 20:04       ` Chris Wilson
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=20110415191859.GC3503@viiv.ffwll.ch \
    --to=daniel@ffwll.ch \
    --cc=chris@chris-wilson.co.uk \
    --cc=daniel.vetter@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;
as well as URLs for NNTP newsgroup(s).