[Intel-gfx] [PATCH 2/4] drm/i915: kill obj->gtt_offset

Daniel Vetter daniel at ffwll.ch
Fri Apr 15 21:19:00 CEST 2011


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 at 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 at ffwll.ch
Mobile: +41 (0)79 365 57 48



More information about the Intel-gfx mailing list