20 Nov, 2011

1 commit

  • This adds a new optional chunk to the CS ioctl that specifies optional flags
    to the CS parser. Why this is useful is explained below. Note that some regs
    no longer need the NOP relocation packet if this feature is enabled.
    Tested on r300g and r600g with this flag disabled and enabled.

    Assume there are two contexts sharing the same mipmapped tiled texture.
    One context wants to render into the first mipmap and the other one
    wants to render into the last mipmap. As you probably know, the hardware
    has a MACRO_SWITCH feature, which turns off macro tiling for small mipmaps,
    but that only applies to samplers.
    (at least on r300-r500, though later hardware likely behaves the same)

    So we want to just re-set the tiling flags before rendering (writing
    packets), right? ... No. The contexts run in parallel, so they may
    set the tiling flags simultaneously and then fire their command streams
    also simultaneously. The last one setting the flags wins, the other one
    loses.

    Another problem is when one context wants to render into the first and
    the last mipmap in one CS. Impossible. It must flush before changing
    tiling flags and do the rendering into the smaller mipmaps in another CS.

    Yet another problem is that writing copy_blit in userspace would be a mess
    involving re-setting tiling flags to please the kernel, and causing races
    with other contexts at the same time.

    The only way out of this is to send tiling flags with each CS, ideally
    with each relocation. But we already do that through the registers.
    So let's just use what we have in the registers.

    Signed-off-by: Marek Olšák
    Signed-off-by: Dave Airlie

    Marek Olšák
     

18 Jul, 2011

1 commit


04 May, 2011

1 commit


27 Apr, 2011

1 commit


31 Mar, 2011

1 commit


01 Mar, 2011

1 commit


25 Jan, 2011

1 commit


06 Jan, 2011

1 commit


17 Aug, 2010

1 commit

  • With the current screwed but its ABI, ioctls for the drm, Linus pointed out that we could allow userspace to specify the allocation size, but we pass it to the driver which then uses it blindly to store a struct. Now if userspace specifies the allocation size as smaller than the driver needs, the driver can possibly overwrite memory.

    This patch restructures the driver ioctls so we store the structure size we are expecting, and make sure we allocate at least that size. The copy from/to userspace are still restricted to the size the user specifies, this allows ioctl structs to grow on both sides of the equation.

    Up until now we didn't really use the DRM_IOCTL defines in the kernel, so this cleans them up and adds them for nouveau.

    v2:
    fix nouveau pushbuf arg (thanks to Ben for pointing it out)

    Reported-by: Linus Torvalds
    Signed-off-by: Dave Airlie

    Dave Airlie
     

02 Aug, 2010

2 commits

  • This interface allows userspace to request hyperz support, it probably
    needs more locking, and really reporting that you can have hyperz is racy
    since someone else might get it before you do.

    v2: modify so we pass 0 valued packets to let DDX/r300c keep working.
    also fixed incorrect 0x4f1c reference.

    v3: fixup zb_bw_cntl so older drivers keep working

    v4: add locking, fixup SC_HYPERZ_EN - patch stream to disable hiz

    Signed-off-by: Dave Airlie

    Dave Airlie
     
  • Userspace needs this information to access tiled
    buffers via the CPU.

    v2: rebased on evergreen accel changes

    Signed-off-by: Alex Deucher
    Signed-off-by: Dave Airlie

    Alex Deucher
     

08 Jun, 2010

1 commit

  • This is needed to enable accel in the ddx. However,
    due to a bug in older versions of the ddx, it relies
    on accel being disabled in order to load properly on
    evergreen chips. To maintain compatility, we add a new
    get accel param and call that from the ddx. The old one
    always returns false for evergreen cards.

    [this fixes a regression with older userspaces on newer kernels].

    Signed-off-by: Alex Deucher
    Signed-off-by: Dave Airlie

    Alex Deucher
     

18 May, 2010

1 commit


25 Feb, 2010

1 commit


04 Dec, 2009

1 commit


18 Sep, 2009

2 commits


21 Aug, 2009

2 commits


17 Aug, 2009

1 commit


29 Jul, 2009

1 commit

  • This adds new set/get tiling interfaces where the pitch
    and macro/micro tiling enables can be set. Along with
    a flag to decide if this object should have a surface when mapped.

    The only thing we need to allocate with a mapped surface should be
    the frontbuffer. Note rotate scanout shouldn't require one, and
    back/depth shouldn't either, though mesa needs some fixes.

    It fixes the TTM interfaces along Thomas's suggestions, and I've tested
    the surface stealing code with two X servers and not seen any lockdep issues.

    I've stopped tiling the fbcon frontbuffer, as I don't see there being
    any advantage other than testing, I've left the testing commands in there,
    just flip the fb_tiled to true in radeon_fb.c

    Open: Can we integrate endian swapping in with this?

    Future features:
    texture tiling - need to relocate texture registers TXOFFSET* with tiling info.

    This also merges Michel's cleanup surfaces regs at init time patch
    even though it makes sense on its own, this patch really relies on it.

    Some PowerMac firmwares set up a tiling surface at the beginning of VRAM
    which messes us up otherwise.
    that patch is:
    Signed-off-by: Michel Dänzer

    Signed-off-by: Dave Airlie

    Dave Airlie
     

15 Jun, 2009

1 commit

  • Add kernel modesetting support to radeon driver, use the ttm memory
    manager to manage memory and DRM/GEM to provide userspace API.
    In order to avoid backward compatibility issue and to allow clean
    design and code the radeon kernel modesetting use different code path
    than old radeon/drm driver.

    When kernel modesetting is enabled the IOCTL of radeon/drm
    driver are considered as invalid and an error message is printed
    in the log and they return failure.

    KMS enabled userspace will use new API to talk with the radeon/drm
    driver. The new API provide functions to create/destroy/share/mmap
    buffer object which are then managed by the kernel memory manager
    (here TTM). In order to submit command to the GPU the userspace
    provide a buffer holding the command stream, along this buffer
    userspace have to provide a list of buffer object used by the
    command stream. The kernel radeon driver will then place buffer
    in GPU accessible memory and will update command stream to reflect
    the position of the different buffers.

    The kernel will also perform security check on command stream
    provided by the user, we want to catch and forbid any illegal use
    of the GPU such as DMA into random system memory or into memory
    not owned by the process supplying the command stream. This part
    of the code is still incomplete and this why we propose that patch
    as a staging driver addition, future security might forbid current
    experimental userspace to run.

    This code support the following hardware : R1XX,R2XX,R3XX,R4XX,R5XX
    (radeon up to X1950). Works is underway to provide support for R6XX,
    R7XX and newer hardware (radeon from HD2XXX to HD4XXX).

    Authors:
    Jerome Glisse
    Dave Airlie
    Alex Deucher

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

    Jerome Glisse
     

29 Mar, 2009

1 commit


27 Mar, 2009

1 commit

  • The drm headers are traditionally shared with BSD and
    could not use the strict linux integer types. This is
    over now, so we can use our own types now.

    Cc: David Airlie
    Signed-off-by: Arnd Bergmann
    Signed-off-by: H. Peter Anvin
    Signed-off-by: Ingo Molnar

    Arnd Bergmann
     

13 Mar, 2009

1 commit


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