01 Nov, 2011

1 commit


09 May, 2011

1 commit

  • The looping helper didn't do anything due to a superficial
    semicolon. Furthermore one of the two dump functions suffered
    from copy&paste fail.

    While staring at the code I've also noticed that the replace
    helper (currently unused) is a bit broken.

    Signed-off-by: Daniel Vetter
    Signed-off-by: Dave Airlie

    Daniel Vetter
     

31 Mar, 2011

1 commit


23 Feb, 2011

4 commits

  • With the switch to implicit free space accounting one pointer
    got unused when scanning. Use it to create a single-linked list
    to ensure correct unwinding of the scan state.

    Signed-off-by: Daniel Vetter
    Signed-off-by: Dave Airlie

    Daniel Vetter
     
  • The old api has a two-step process: First search for a suitable
    free hole, then allocate from that specific hole. No user used
    this to do anything clever. So drop it for the embeddable variant
    of the drm_mm api (the old one retains this ability, for the time
    being).

    With struct drm_mm_node embedded, we cannot track allocations
    anymore by checking for a NULL pointer. So keep track of this
    and add a small helper drm_mm_node_allocated.

    Also add a function to move allocations between different struct
    drm_mm_node.

    v2: Implement suggestions by Chris Wilson.

    Signed-off-by: Daniel Vetter
    Signed-off-by: Dave Airlie

    Daniel Vetter
     
  • Signed-off-by: Daniel Vetter
    Signed-off-by: Dave Airlie

    Daniel Vetter
     
  • The idea is to track free holes implicitly by marking the allocation
    immediatly preceeding a hole.

    To avoid an ugly corner case add a dummy head_node to struct drm_mm
    to track the hole that spans to complete allocation area when the
    memory manager is empty.

    To guarantee that there's always a preceeding/following node (that might
    be marked as hole_follows == 1), move the mm->node_list list_head to the
    head_node.

    The main allocator and fair-lru scan code actually becomes simpler.
    Only the debug code slightly suffers because free areas are no longer
    explicit.

    Also add drm_mm_for_each_node (which will be much more useful when
    struct drm_mm_node is embeddable).

    Signed-off-by: Daniel Vetter
    Signed-off-by: Dave Airlie

    Daniel Vetter
     

28 Oct, 2010

1 commit


27 Aug, 2010

1 commit

  • With the code cleanup in

    7a6b2896f261894dde287d3faefa4b432cddca53 is the first bad commit
    commit 7a6b2896f261894dde287d3faefa4b432cddca53
    Author: Daniel Vetter
    Date: Fri Jul 2 15:02:15 2010 +0100

    drm_mm: extract check_free_mm_node

    I've botched up the range-restriction checks. The result is usually
    an X server dying with SIGBUS in libpixman (software fallback rendering).
    Change the code to adjust the start and end for range restricted
    allocations. IMHO this even makes the code a bit clearer.

    Fixes regression bug: https://bugs.freedesktop.org/show_bug.cgi?id=29738

    Reported-by-Tested-by: Till MAtthiesen
    Acked-by: Alex Deucher
    Signed-off-by: Daniel Vetter
    Signed-off-by: Dave Airlie

    Daniel Vetter
     

07 Jul, 2010

5 commits

  • These helper functions can be used to efficiently scan lru list
    for eviction. Eviction becomes a three stage process:
    1. Scanning through the lru list until a suitable hole has been found.
    2. Scan backwards to restore drm_mm consistency and find out which
    objects fall into the hole.
    3. Evict the objects that fall into the hole.

    These helper functions don't allocate any memory (at the price of
    not allowing any other concurrent operations). Hence this can also be
    used for ttm (which does lru scanning under a spinlock).

    Evicting objects in this fashion should be more fair than the current
    approach by i915 (scan the lru for a object large enough to contain
    the new object). It's also more efficient than the current approach used
    by ttm (uncoditionally evict objects from the lru until there's enough
    free space).

    Signed-Off-by: Daniel Vetter
    Acked-by: Thomas Hellstrom
    Signed-off-by: Chris Wilson
    Signed-off-by: Dave Airlie

    Daniel Vetter
     
  • There are already two copies of this logic. And the new scanning
    stuff will add some more. So extract it into a small helper
    function.

    Signed-off-by: Daniel Vetter
    Acked-by: Thomas Hellstrom
    Signed-off-by: Chris Wilson
    Signed-off-by: Dave Airlie

    Daniel Vetter
     
  • Yeah, I've kinda noticed that fl_entry is the free stack. Still
    give it (and the memory node list ml_entry) decent names.

    Signed-off-by: Daniel Vetter
    Acked-by: Thomas Hellstrom
    Signed-off-by: Chris Wilson
    Signed-off-by: Dave Airlie

    Daniel Vetter
     
  • Signed-off-by: Daniel Vetter
    Acked-by: Thomas Hellstrom
    Signed-off-by: Chris Wilson
    Signed-off-by: Dave Airlie

    Daniel Vetter
     
  • Signed-off-by: Daniel Vetter
    Signed-off-by: Chris Wilson
    Acked-by: Thomas Hellstrom
    Signed-off-by: Dave Airlie

    Daniel Vetter
     

15 Feb, 2010

1 commit


23 Dec, 2009

1 commit


10 Dec, 2009

2 commits


08 Dec, 2009

1 commit


04 Dec, 2009

1 commit


24 Nov, 2009

1 commit

  • unused_nodes modification needs to be protected by unused_lock spinlock.
    Here is an example of an usage where there is no such protection without
    this patch.

    Process 1: 1-drm_mm_pre_get(this function modify unused_nodes list)
    2-spin_lock(spinlock protecting mm struct)
    3-drm_mm_put_block(this function might modify unused_nodes
    list but doesn't protect modification with unused_lock)
    4-spin_unlock(spinlock protecting mm struct)
    Process2: 1-drm_mm_pre_get(this function modify unused_nodes list)
    At this point Process1 & Process2 might both be doing modification to
    unused_nodes list. This patch add unused_lock protection into
    drm_mm_put_block to avoid such issue.

    Signed-off-by: Jerome Glisse
    Signed-off-by: Dave Airlie

    Jerome Glisse
     

02 Sep, 2009

1 commit


19 Jun, 2009

1 commit


15 Jun, 2009

1 commit


12 Jun, 2009

1 commit


29 Dec, 2008

1 commit

  • Add mode setting support to the DRM layer.

    This is a fairly big chunk of work that allows DRM drivers to provide
    full output control and configuration capabilities to userspace. It was
    motivated by several factors:
    - the fb layer's APIs aren't suited for anything but simple
    configurations
    - coordination between the fb layer, DRM layer, and various userspace
    drivers is poor to non-existent (radeonfb excepted)
    - user level mode setting drivers makes displaying panic & oops
    messages more difficult
    - suspend/resume of graphics state is possible in many more
    configurations with kernel level support

    This commit just adds the core DRM part of the mode setting APIs.
    Driver specific commits using these new structure and APIs will follow.

    Co-authors: Jesse Barnes , Jakob Bornecrantz
    Contributors: Alan Hourihane , Maarten Maathuis

    Signed-off-by: Jesse Barnes
    Signed-off-by: Eric Anholt
    Signed-off-by: Dave Airlie

    Dave Airlie
     

18 Oct, 2008

1 commit

  • GEM allows the creation of persistent buffer objects accessible by the
    graphics device through new ioctls for managing execution of commands on the
    device. The userland API is almost entirely driver-specific to ensure that
    any driver building on this model can easily map the interface to individual
    driver requirements.

    GEM is used by the 2d driver for managing its internal state allocations and
    will be used for pixmap storage to reduce memory consumption and enable
    zero-copy GLX_EXT_texture_from_pixmap, and in the 3d driver is used to enable
    GL_EXT_framebuffer_object and GL_ARB_pixel_buffer_object.

    Signed-off-by: Eric Anholt
    Signed-off-by: Dave Airlie

    Eric Anholt
     

14 Jul, 2008

1 commit

  • With the coming of kernel based modesetting and the memory manager stuff,
    the everything in one directory approach was getting very ugly and
    starting to be unmanageable.

    This restructures the drm along the lines of other kernel components.

    It creates a drivers/gpu/drm directory and moves the hw drivers into
    subdirectores. It moves the includes into an include/drm, and
    sets up the unifdef for the userspace headers we should be exporting.

    Signed-off-by: Dave Airlie

    Dave Airlie