13 Jan, 2012

7 commits

  • Newer nVidia cards with Optimus do not support/use the DSM switching functions.
    Instead, it require a DSM function to be called prior to bringing a device into
    D3 state. No other _DSM calls are necessary before/after enabling/disabling a
    device. Switching between discrete and integrated GPU is not supported by
    this Optimus _DSM call, therefore return on the switching method.

    Signed-off-by: Peter Lekensteyn
    Signed-off-by: Dave Airlie

    Peter Lekensteyn
     
  • According to the ACPI spec version 4, section 9.14.1, _DSM functions
    must return a value with the first bit enabled if any DSM functions are
    supported for the given UUID and revision ID. For a given function index n
    to be marked supported, bit n must be enabled.

    Signed-off-by: Peter Lekensteyn
    Signed-off-by: Dave Airlie

    Peter Lekensteyn
     
  • Reported-by: Ben Hutchings
    Signed-off-by: Michel Dänzer
    Reviewed-by: Alex Deucher
    Signed-off-by: Dave Airlie

    Michel Dänzer
     
  • [This fixes a crash on boot if the system is plugged into an HDTV so it's
    probably appropriate to push even though it didn't make the window. We could
    be cleverer about this but the simple version seems to be the safe one]

    From: Patrik Jakobsson

    At the moment we cannot allocate more than stolen memory size for framebuffers.
    To get around that issues we discard modes that doesn't fit. This is a temporary
    solution until we can freely allocate framebuffer memory.

    [Currently the framebuffer needs to be linear in kernel space due to limits
    in the kernel fb layer - AC]

    Signed-off-by: Patrik Jakobsson
    Signed-off-by: Alan Cox
    Signed-off-by: Dave Airlie

    Alan Cox
     
  • Module parameter descriptions don't take a trailing \n, otherwise it
    breaks formatting of modinfo's output. Also add missing space after
    comma.

    Signed-off-by: Jean Delvare
    Cc: David Airlie
    Reviewed-by: Alex Deucher
    Cc: Jerome Glisse
    Signed-off-by: Dave Airlie

    Jean Delvare
     
  • Packet2 is only one dword.

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

    Alex Deucher
     
  • . It was useful during development, but now on a production system
    we can get this (if the user forgot to upload the firmware):

    [drm] radeon: irq initialized.
    [drm] GART: num cpu pages 131072, num gpu pages 131072
    [drm] radeon: ib pool ready.
    [drm] Loading SUMO Microcode
    r600_cp: Failed to load firmware "radeon/SUMO_pfp.bin"
    atl1c 0000:03:00.0: version 1.0.1.0-NAPI.213057] [drm:evergreen_startup] *ERROR* Failed to load firmware!
    radeon 0000:00:01.0: disabling GPU acceleration
    88] radeon 0000:00:01.0: ffff8801bb782400 unpin not necessary
    ------------[ cut here ]------------
    WARNING: at /home/konrad/linux-linus/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c:956 ttm_dma_unpopulate+0x79/0x300 [ttm]()
    Hardware name: System Product Name
    Modules linked in: e1000e atl1c radeon(+) ahci libahci libata scsi_mod fbcon tileblit font ttm bitblit softcursor drm_kms_helper wmi xen_blkfront xen_netfront fb_sys_fops sysimgblt sysfillrect syscopyarea xenfs xen_privcmd
    Pid: 1600, comm: modprobe Not tainted 3.2.0-06100-ge343a89 #1
    Call Trace:
    [] warn_slowpath_common+0x7a/0xb0
    [] warn_slowpath_null+0x15/0x20
    [] ttm_dma_unpopulate+0x79/0x300 [ttm]
    [] radeon_ttm_tt_unpopulate+0x120/0x130 [radeon]
    [] ttm_tt_destroy+0x2c/0x70 [ttm]
    [] ttm_bo_cleanup_memtype_use+0x3e/0x80 [ttm]
    [] ttm_bo_release+0x251/0x280 [ttm]
    [] ttm_bo_unref+0x40/0x60 [ttm]
    [] radeon_bo_unref+0x42/0x80 [radeon]
    [] radeon_sa_bo_manager_fini+0x6b/0x80 [radeon]
    [] radeon_ib_pool_fini+0x6f/0x90 [radeon]
    [] r100_ib_fini+0x19/0x20 [radeon]
    [] evergreen_init+0x1ee/0x2d0 [radeon]

    The big WARN() has nothing to do with the culprit - which is that
    the firmware was not loaded. So lets remove the WARN() from the TTM DMA code.

    Signed-off-by: Konrad Rzeszutek Wilk
    Reviewed-by: Jerome Glisse
    Signed-off-by: Dave Airlie

    Konrad Rzeszutek Wilk
     

11 Jan, 2012

1 commit

  • * 'drm-core-next' of git://people.freedesktop.org/~airlied/linux: (307 commits)
    drm/nouveau/pm: fix build with HWMON off
    gma500: silence gcc warnings in mid_get_vbt_data()
    drm/ttm: fix condition (and vs or)
    drm/radeon: double lock typo in radeon_vm_bo_rmv()
    drm/radeon: use after free in radeon_vm_bo_add()
    drm/sis|via: don't return stack garbage from free_mem ioctl
    drm/radeon/kms: remove pointless CS flags priority struct
    drm/radeon/kms: check if vm is supported in VA ioctl
    drm: introduce drm_can_sleep and use in intel/radeon drivers. (v2)
    radeon: Fix disabling PCI bus mastering on big endian hosts.
    ttm: fix agp since ttm tt rework
    agp: Fix multi-line warning message whitespace
    drm/ttm/dma: Fix accounting error when calling ttm_mem_global_free_page and don't try to free freed pages.
    drm/ttm/dma: Only call set_pages_array_wb when the page is not in WB pool.
    drm/radeon/kms: sync across multiple rings when doing bo moves v3
    drm/radeon/kms: Add support for multi-ring sync in CS ioctl (v2)
    drm/radeon: GPU virtual memory support v22
    drm: make DRM_UNLOCKED ioctls with their own mutex
    drm: no need to hold global mutex for static data
    drm/radeon/benchmark: common modes sweep ignores 640x480@32
    ...

    Fix up trivial conflicts in radeon/evergreen.c and vmwgfx/vmwgfx_kms.c

    Linus Torvalds
     

10 Jan, 2012

3 commits


09 Jan, 2012

5 commits

  • The second lock should be an unlock or it causes a deadlock.

    Signed-off-by: Dan Carpenter
    Signed-off-by: Dave Airlie

    Dan Carpenter
     
  • "bo_va" is dereferenced in the error message.

    Signed-off-by: Dan Carpenter
    Signed-off-by: Dave Airlie

    Dan Carpenter
     
  • Fallout from my "kill drm_sman" refactor. Unfortunately gcc seems to
    have failed me and not warned about this.

    Tested-by: Jakob Bornecrantz (on via)
    Signed-off-by: Daniel Vetter
    Signed-off-by: Dave Airlie

    Daniel Vetter
     
  • Add a VM manager enabled field and use it to check if
    vm is enabled.

    Signed-off-by: Alex Deucher
    Cc: jglisse@redhat.com
    Signed-off-by: Dave Airlie

    Alex Deucher
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (53 commits)
    Kconfig: acpi: Fix typo in comment.
    misc latin1 to utf8 conversions
    devres: Fix a typo in devm_kfree comment
    btrfs: free-space-cache.c: remove extra semicolon.
    fat: Spelling s/obsolate/obsolete/g
    SCSI, pmcraid: Fix spelling error in a pmcraid_err() call
    tools/power turbostat: update fields in manpage
    mac80211: drop spelling fix
    types.h: fix comment spelling for 'architectures'
    typo fixes: aera -> area, exntension -> extension
    devices.txt: Fix typo of 'VMware'.
    sis900: Fix enum typo 'sis900_rx_bufer_status'
    decompress_bunzip2: remove invalid vi modeline
    treewide: Fix comment and string typo 'bufer'
    hyper-v: Update MAINTAINERS
    treewide: Fix typos in various parts of the kernel, and fix some comments.
    clockevents: drop unknown Kconfig symbol GENERIC_CLOCKEVENTS_MIGR
    gpio: Kconfig: drop unknown symbol 'CS5535_GPIO'
    leds: Kconfig: Fix typo 'D2NET_V2'
    sound: Kconfig: drop unknown symbol ARCH_CLPS7500
    ...

    Fix up trivial conflicts in arch/powerpc/platforms/40x/Kconfig (some new
    kconfig additions, close to removed commented-out old ones)

    Linus Torvalds
     

06 Jan, 2012

8 commits

  • So we have a few places where the drm drivers would like to sleep to
    be nice to the system, mainly in the modesetting paths, but we also
    have two cases were atomic modesetting must take place, panic writing
    and kernel debugger. So provide a central inline to determine if a
    sleep or delay should be used and use this in the intel and radeon drivers.

    v2: drop intel_drv.h MSLEEP macro, nobody uses it.

    Based on patch from Michel Dänzer

    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43941

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

    Dave Airlie
     
  • It would previously write basically random bits to PCI configuration space...
    Not very surprising that the GPU tended to stop responding completely. The
    resulting MCE even froze the whole machine sometimes.

    Now resetting the GPU after a lockup has at least a fighting chance of
    succeeding.

    Cc: stable@vger.kernel.org
    Signed-off-by: Michel Dänzer
    Reviewed-by: Alex Deucher
    Signed-off-by: Dave Airlie

    Michel Dänzer
     
  • ttm tt rework modified the way we allocate and populate the
    ttm_tt structure, the AGP side was missing some bit to properly
    work. Fix those and fix radeon and nouveau AGP support.

    Tested on radeon only so far.

    Signed-off-by: Jerome Glisse
    Reviewed-by: Konrad Rzeszutek Wilk
    Signed-off-by: Dave Airlie

    Jerome Glisse
     
  • …t try to free freed pages.

    The code to figure out how many pages to shrink the pool
    ends up capping the 'count' at _manager->options.max_size - which is OK.
    Except that the 'count' is also used when accounting for how many pages
    are recycled - which we end up with the invalid values. This fixes
    it by using a different value for the amount of pages to shrink.

    On top of that we would free the cached page pool - which is nonsense
    as they are deleted from the pool - so there are no free pages in that
    pool..

    Also we also missed the opportunity to batch the amount of pages
    to free (similar to how ttm_page_alloc.c does it). This reintroduces
    the code that was lost during rebasing.

    Reviewed-by: Jerome Glisse <jglisse@redhat.com>
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

    Konrad Rzeszutek Wilk
     
  • Otherwise we are doing redundant work. Especially since the 'unbind'
    and 'unpopulate' have been merged and nouveau driver ends up calling
    it quite excessivly. On a GeForce 8600 GT with Gnome Shell (GNOME 3)
    we end up spending about 54% CPU time in __change_page_attr_set_clr
    checking the page flags.

    The callgraph (annotated) looks as so before this patch:

    53.29% gnome-shell [kernel.kallsyms] [k] static_protections
    |
    --- static_protections
    |
    |--91.80%-- __change_page_attr_set_clr
    | change_page_attr_set_clr
    | set_pages_array_wb
    | |
    | |--96.55%-- ttm_dma_unpopulate
    | | nouveau_ttm_tt_unpopulate
    | | ttm_tt_destroy
    | | ttm_bo_cleanup_memtype_use
    | | ttm_bo_release
    | | kref_put
    | | ttm_bo_unref
    | | nouveau_gem_object_del
    | | drm_gem_object_free
    | | kref_put
    | | drm_gem_object_unreference_unlocked
    | | drm_gem_object_handle_unreference_unlocked.part.1
    | | drm_gem_handle_delete
    | | drm_gem_close_ioctl
    | | drm_ioctl
    | | do_vfs_ioctl
    | | sys_ioctl
    | | system_call_fastpath
    | | __GI___ioctl
    | |
    | --3.45%-- ttm_dma_pages_put
    | ttm_dma_page_pool_free
    | ttm_dma_unpopulate
    | nouveau_ttm_tt_unpopulate
    | ttm_tt_destroy
    | ttm_bo_cleanup_memtype_use
    | ttm_bo_release
    | kref_put
    | ttm_bo_unref
    | nouveau_gem_object_del
    | drm_gem_object_free
    | kref_put
    | drm_gem_object_unreference_unlocked
    | drm_gem_object_handle_unreference_unlocked.part.1
    | drm_gem_handle_delete
    | drm_gem_close_ioctl
    | drm_ioctl
    | do_vfs_ioctl
    | sys_ioctl
    | system_call_fastpath
    | __GI___ioctl
    |
    --8.20%-- change_page_attr_set_clr
    set_pages_array_wb
    |
    |--93.76%-- ttm_dma_unpopulate
    | nouveau_ttm_tt_unpopulate
    | ttm_tt_destroy
    | ttm_bo_cleanup_memtype_use
    | ttm_bo_release
    | kref_put
    | ttm_bo_unref
    | nouveau_gem_object_del
    | drm_gem_object_free
    | kref_put
    | drm_gem_object_unreference_unlocked
    | drm_gem_object_handle_unreference_unlocked.part.1
    | drm_gem_handle_delete
    | drm_gem_close_ioctl
    | drm_ioctl
    | do_vfs_ioctl
    | sys_ioctl
    | system_call_fastpath
    | __GI___ioctl
    |
    --6.24%-- ttm_dma_pages_put
    ttm_dma_page_pool_free
    ttm_dma_unpopulate
    nouveau_ttm_tt_unpopulate
    ttm_tt_destroy
    ttm_bo_cleanup_memtype_use
    ttm_bo_release
    kref_put
    ttm_bo_unref
    nouveau_gem_object_del
    drm_gem_object_free
    kref_put
    drm_gem_object_unreference_unlocked
    drm_gem_object_handle_unreference_unlocked.part.1
    drm_gem_handle_delete
    drm_gem_close_ioctl
    drm_ioctl
    do_vfs_ioctl
    sys_ioctl
    system_call_fastpath
    __GI___ioctl

    and after this patch all of that disappears.

    Signed-off-by: Konrad Rzeszutek Wilk
    Signed-off-by: Dave Airlie

    Konrad Rzeszutek Wilk
     
  • We need to synchronize across rings when doing a bo move to make
    sure we the buffer is idle if it's in use by a different ring than
    the ring doing the move.

    v2: fix fence setup for bo moves

    v3: add missing ring lock/unlock

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

    Alex Deucher
     
  • Use semaphores to sync buffers across rings in the CS
    ioctl. Add a reloc flag to allow userspace to skip
    sync for buffers.

    agd5f: port to latest CS ioctl changes.

    v2: add ring lock/unlock to make sure changes hit the ring.

    Signed-off-by: Christian König
    Signed-off-by: Alex Deucher
    Signed-off-by: Dave Airlie

    Christian König
     
  • Virtual address space are per drm client (opener of /dev/drm).
    Client are in charge of virtual address space, they need to
    map bo into it by calling DRM_RADEON_GEM_VA ioctl.

    First 16M of virtual address space is reserved by the kernel.

    Once using 2 level page table we should be able to have a small
    vram memory footprint for each pt (there would be one pt for all
    gart, one for all vram and then one first level for each virtual
    address space).

    Plan include using the sub allocator for a common vm page table
    area and using memcpy to copy vm page table in & out. Or use
    a gart object and copy things in & out using dma.

    v2: agd5f fixes:
    - Add vram base offset for vram pages. The GPU physical address of a
    vram page is FB_OFFSET + page offset. FB_OFFSET is 0 on discrete
    cards and the physical bus address of the stolen memory on
    integrated chips.
    - VM_CONTEXT1_PROTECTION_FAULT_DEFAULT_ADDR covers all vmid's >= 1

    v3: agd5f:
    - integrate with the semaphore/multi-ring stuff

    v4:
    - rebase on top ttm dma & multi-ring stuff
    - userspace is now in charge of the address space
    - no more specific cs vm ioctl, instead cs ioctl has a new
    chunk

    v5:
    - properly handle mem == NULL case from move_notify callback
    - fix the vm cleanup path

    v6:
    - fix update of page table to only happen on valid mem placement

    v7:
    - add tlb flush for each vm context
    - add flags to define mapping property (readable, writeable, snooped)
    - make ring id implicit from ib->fence->ring, up to each asic callback
    to then do ring specific scheduling if vm ib scheduling function

    v8:
    - add query for ib limit and kernel reserved virtual space
    - rename vm->size to max_pfn (maximum number of page)
    - update gem_va ioctl to also allow unmap operation
    - bump kernel version to allow userspace to query for vm support

    v9:
    - rebuild page table only when bind and incrementaly depending
    on bo referenced by cs and that have been moved
    - allow virtual address space to grow
    - use sa allocator for vram page table
    - return invalid when querying vm limit on non cayman GPU
    - dump vm fault register on lockup

    v10: agd5f:
    - Move the vm schedule_ib callback to a standalone function, remove
    the callback and use the existing ib_execute callback for VM IBs.

    v11:
    - rebase on top of lastest Linus

    v12: agd5f:
    - remove spurious backslash
    - set IB vm_id to 0 in radeon_ib_get()

    v13: agd5f:
    - fix handling of RADEON_CHUNK_ID_FLAGS

    v14:
    - fix va destruction
    - fix suspend resume
    - forbid bo to have several different va in same vm

    v15:
    - rebase

    v16:
    - cleanup left over of vm init/fini

    v17: agd5f:
    - cs checker

    v18: agd5f:
    - reworks the CS ioctl to better support multiple rings and
    VM. Rather than adding a new chunk id for VM, just re-use the
    IB chunk id and add a new flags for VM mode. Also define additional
    dwords for the flags chunk id to define the what ring we want to use
    (gfx, compute, uvd, etc.) and the priority.

    v19:
    - fix cs fini in weird case of no ib
    - semi working flush fix for ni
    - rebase on top of sa allocator changes

    v20: agd5f:
    - further CS ioctl cleanups from Christian's comments

    v21: agd5f:
    - integrate CS checker improvements

    v22: agd5f:
    - final cleanups for release, only allow VM CS on cayman

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

    Jerome Glisse
     

05 Jan, 2012

9 commits

  • drm_getclient, drm_getstats and drm_getmap (with a few minor
    adjustments) do not need global mutex, so fix that and
    make the said ioctls DRM_UNLOCKED. Details:

    drm_getclient: the only thing that should be protected here
    is dev->filelist and that is already protected everywhere with
    dev->struct_mutex.

    drm_getstats: there is no need for any mutex here because the
    loop runs through quasi-static (set at load time only)
    data, and the actual count access is done with atomic_read()

    drm_getmap already uses dev->struct_mutex to protect
    dev->maplist, which also used to protect the same structure
    everywhere else except at three places:
    * drm_getsarea, which doesn't grab *any* mutex before
    touching dev->maplist (so no drm_global_mutex doesn't help
    here either; different issue for a different patch).
    However, drivers seem to call it only at
    initialization time so it probably doesn't matter
    * drm_master_destroy, which is called from drm_master_put,
    which in turn is protected with dev->struct_mutex
    everywhere else in drm module, so we are good here too.
    * drm_getsareactx, which releases the dev->struct_mutex
    too early, but this patch includes the fix for that.

    v2: * incorporate comments received from Daniel Vetter
    * include the (long) explanation above to make it clear what
    we are doing (and why), also at Daniel Vetter's request
    * tighten up mutex grab/release locations to only
    encompass real critical sections, rather than some
    random code around them

    Signed-off-by: Ilija Hadzic
    Reviewed-by: Daniel Vetter
    Signed-off-by: Dave Airlie

    Ilija Hadzic
     
  • drm_getcap and drm_version ioctls only reads static data,
    there is no need to protect them with drm_global_mutex,
    so make them DRM_UNLOCKED

    Signed-off-by: Ilija Hadzic
    Reviewed-by: Daniel Vetter
    Signed-off-by: Dave Airlie

    Ilija Hadzic
     
  • Sweep common_modes array should start with index 0.

    Signed-off-by: Chen Jie
    Reviewed-by: Ilija Hadzic
    Signed-off-by: Dave Airlie

    Chen Jie
     
  • We often end up missing fences on older asics with
    writeback enabled which leads to delays in the userspace
    accel code, so just disable it by default on those asics.

    Reported-by: Helge Deller
    Reported-by: Dave Airlie
    Signed-off-by: Alex Deucher
    Cc: stable@vger.kernel.org
    Signed-off-by: Dave Airlie

    Alex Deucher
     
  • This allow to share the ib pool with semaphore and avoid
    having more bo around.

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

    Jerome Glisse
     
  • This avoid to waste ib pool size and avoid a bunch of wait for
    previous ib to finish.

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

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

    Alex Deucher
     
  • In cases where the scanout hw is sufficiently similar between "overlay"
    and traditional crtc layers, it might be convenient to allow the driver
    to create internal drm_plane helper objects used by the drm_crtc
    implementation, rather than duplicate code between the plane and crtc.
    A private plane is not exposed to userspace.

    Signed-off-by: Rob Clark
    Signed-off-by: Dave Airlie

    Rob Clark
     
  • Since plane->fb and plane->crtc are set in drm_mode_setplane()
    after update_plane(), They should be cleared after disable().

    Signed-off-by: Rob Clark
    Signed-off-by: Dave Airlie

    Rob Clark
     

04 Jan, 2012

7 commits

  • both callers of device_get_devnode() are only interested in lower 16bits
    and nobody tries to return anything wider than 16bit anyway.

    Signed-off-by: Al Viro

    Al Viro
     
  • If it failed, leave it in the "off" state.

    Signed-off-by: Jesse Barnes
    Signed-off-by: Keith Packard

    Jesse Barnes
     
  • If a PCH pipe PLL is being used by transcoder C, don't disable it.

    Signed-off-by: Jesse Barnes
    Signed-off-by: Keith Packard

    Jesse Barnes
     
  • In the pre-gem days with non-existing hangcheck and gpu reset code,
    this timeout of 3 seconds was pretty important to avoid stuck
    processes.

    But now we have the hangcheck code in gem that goes to great length
    to ensure that the gpu is really dead before declaring it wedged.

    So there's no need for this timeout anymore. Actually it's even harmful
    because we can bail out too early (e.g. with xscreensaver slip)
    when running giant batchbuffers. And our code isn't robust enough
    to properly unroll any state-changes, we pretty much rely on the gpu
    reset code cleaning up the mess (like cache tracking, fencing state,
    active list/request tracking, ...).

    With this change intel_begin_ring can only fail when the gpu is
    wedged, and it will return -EAGAIN (like wait_request in case the
    gpu reset is still outstanding).

    v2: Chris Wilson noted that on resume timers aren't running and hence
    we won't ever get kicked out of this loop by the hangcheck code. Use
    an insanely large timeout instead for the HAS_GEM case to prevent
    resume bugs from totally hanging the machine.

    Signed-off-by: Daniel Vetter
    Reviewed-by: Chris Wilson
    Acked-by: Ben Widawsky
    Reviewed-by: Eugeni Dodonov
    Signed-off-by: Keith Packard

    Daniel Vetter
     
  • If our semaphore logic gets confused and we have a ring stuck waiting
    for one, there's a decent chance it'll just execute garbage when being
    kicked. Also, kicking the ring obscures the place where the error
    first occured, making error_state decoding much harder.

    So drop this an let gpu reset handle this mess in a clean fashion.

    In contrast, kicking rings stuck on MI_WAIT is rather harmless, at
    worst there'll be a bit of screen-flickering. There's also old
    broken userspace out there which needs this as a work-around.

    Signed-off-by: Daniel Vetter
    Reviewed-by: Chris Wilson
    Reviewed-by: Ben Widawsky
    Signed-off-by: Keith Packard

    Daniel Vetter
     
  • These registers are automatically incremented by the hardware during
    transform feedback to track where the next streamed vertex output
    should go. Unlike the previous generation, which had a packet for
    setting the corresponding registers to a defined value, gen7 only has
    MI_LOAD_REGISTER_IMM to do so. That's a secure packet (since it loads
    an arbitrary register), so we need to do it from the kernel, and it
    needs to be settable atomically with the batchbuffer execution so that
    two clients doing transform feedback don't stomp on each others'
    state.

    Instead of building a more complicated interface involcing setting the
    registers to a specific value, just set them to 0 when asked and
    userland can tweak its pointers accordingly.

    Signed-off-by: Eric Anholt
    Reviewed-by: Eugeni Dodonov
    Reviewed-by: Kenneth Graunke
    Signed-off-by: Keith Packard

    Eric Anholt
     
  • The waits we do here are generally so short that sleeping is a bad
    idea unless we have an IRQ to wake us up. Improves regression test
    performance from 18 minutes to 3.5 minutes on gen7, which is now
    consistent with the previous generation.

    Signed-off-by: Eric Anholt
    Tested-by: Eugeni Dodonov
    Reviewed-by: Eugeni Dodonov
    Acked-by: Kenneth Graunke
    Signed-off-by: Keith Packard

    Eric Anholt