Commit Graph

253 Commits

Author SHA1 Message Date
Marek Olšák 6dd045ef40 r600g: disable async DMA on R700
Cc: 10.0 10.1 mesa-stable@lists.freedesktop.org
2014-04-25 01:33:12 +02:00
Marek Olšák 9f9ab8ec0d winsys/radeon: remove some unused code
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-04-17 13:54:19 +02:00
Marek Olšák 8b966bcaf2 winsys/radeon: remove is_handle_added array
Use index -1 if a buffer is not added.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-04-17 13:54:19 +02:00
Marek Olšák b0fca0a378 winsys/radeon: remove local variable reloc from radeon_get_reloc
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-04-17 13:54:18 +02:00
Marek Olšák 3384a41aa9 winsys/radeon: remove parameter reloc from radeon_get_reloc
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-04-17 13:54:18 +02:00
Marek Olšák 70cf6639c3 gallium/radeon: create and return a fence in the flush function
All flush functions get a fence parameter. cs_create_fence is removed.

Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-16 14:02:51 +02:00
Marek Olšák dd72c327e9 winsys/radeon: fold cs_set_flush_callback into cs_create
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-16 14:02:51 +02:00
Marek Olšák b2238b3452 winsys/radeon: remove cs_write_reloc, add simpler cs_get_reloc
The only difference is that it doesn't write to the CS and only returns
the index.

Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-16 14:02:51 +02:00
Marek Olšák 927213f33d winsys/radeon: consolidate hash table lookup
I should have done this long ago.

Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-16 14:02:51 +02:00
Marek Olšák 3b0b44f7de winsys/radeon: fix a race condition in initialization of radeon_winsys::screen
Create the screen in the winsys while the mutex is locked.
This also results in a nice code cleanup!

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-10 20:50:17 +02:00
Marek Olšák ac330d4130 winsys/radeon: fix a race condition between winsys_create and winsys_destroy
This also hides the reference count from drivers.

v2: update the reference count while the mutex is locked in winsys_create

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-10 20:50:17 +02:00
Marek Olšák 7c57b01564 winsys/radeon: fix a race condition between 2 calls to radeon_winsys_create
This fixes random crashes of: piglit/glx-multithread-shader-compile.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-10 20:50:17 +02:00
Marek Olšák b5ebfc33b8 winsys/radeon: remove unused radeon_info variables, move backend_map
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-10 20:50:17 +02:00
Marek Olšák 9b8449ae90 winsys/radeon: unify radeon_bo::flink and radeon_bo::name
Both contained the GEM flink name.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-10 20:50:17 +02:00
Marek Olšák 34564c8753 winsys/radeon: remove definitions already present in radeon_drm.h
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-10 20:50:17 +02:00
Marek Olšák e3e05c6db9 winsys/radeon: handle squared micro tiling from GEM_GET_TILING
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-10 20:50:17 +02:00
Marek Olšák fb5cf3490e r600g,radeonsi: add a bunch of useful queries for the HUD 2014-04-09 01:45:16 +02:00
Marek Olšák 4a5519f1e0 r600g,radeonsi: set correct initial domain for shared resources 2014-04-09 01:45:16 +02:00
Marek Olšák 5f7faff61b gallium/radeon: fix warnings 2014-04-09 01:45:16 +02:00
Marek Olšák e914d0052f winsys/radeon: only add duplicate relocations for DMA if VM isn't supported
Also rewrite the comment for it to be readable and reorder the code.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-20 18:41:17 +01:00
Michel Dänzer 7e0396dd73 winsys/radeon: Store GPU virtual memory addresses of BOs in a hash table
This allows retrieving the existing BO and incrementing its reference count,
instead of creating a separate winsys representation for it, when the kernel
reports that the BO was already assigned a virtual memory address.

This fixes problems with XWayland using radeonsi and the
xf86-video-wlglamor driver, which calls GEM flink outside of the radeon
winsys code and creates BOs from the flinked names using the same DRM file
descriptor.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-03-17 11:53:59 +09:00
Marek Olšák 3edb3b86b2 r300g,uvd,vce: set priorities for relocations
This updates all occurences of cs_add_reloc.
2014-03-11 18:51:19 +01:00
Marek Olšák db1a7f78c2 winsys/radeon: add interface for setting a priority number for each relocation
The cs_add_reloc change is commented out not to break compilation.
The highest priority of all cs_add_reloc calls is send to the kernel.
2014-03-11 18:51:19 +01:00
Marek Olšák c1a06da465 Revert "winsys/radeon: if there's VRAM-only usage, keep it"
This reverts commit 67aef6dafa.

It caused GPU hangs. The question is why.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75900
2014-03-08 16:00:25 +01:00
Marek Olšák 67aef6dafa winsys/radeon: if there's VRAM-only usage, keep it 2014-03-07 18:07:05 +01:00
Brian Paul e4a5a9fd2f gallium/pipebuffer: change pb_cache_manager_create() size_factor to float
Requested by Marek.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 09:56:55 -07:00
Thomas Hellstrom 8af358d8bc gallium/pipebuffer: Add a cache buffer manager bypass mask
In some situations, it may be desirable to bypass the cache at buffer
creation but to insert the buffer in the cache at buffer destruction.
One such situation is where we already have a kernel representation of a
buffer that we want to use, but we also want to insert it in the cache when
it's freed up.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Thomas Hellstrom c9e9b1862b pipebuffer, winsys: Add a size match parameter to the cached buffer manager
In some situations it's important to restrict the sizes of buffers that the
cached buffer manager is allowed to return

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Christian König cbdd052577 radeon/winsys: add VCE support v4
v2: add fw version query
v3: add README.VCE
v4: avoid error msg when kernel doesn't support it

Signed-off-by: Christian König <christian.koenig@amd.com>
2014-02-13 11:11:24 +01:00
Marek Olšák 559af1df10 gallium/radeon: fix warnings 2014-02-06 17:43:29 +01:00
José Fonseca ab6f9fccd4 radeon: More missing stdio.h includes. 2014-01-23 14:20:20 +00:00
José Fonseca fd33a6bcd7 gallium: Use C11 thread abstractions.
Note that PIPE_ROUTINE now returns an int.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-01-23 12:55:55 +00:00
Marek Olšák 346b6abab9 radeonsi: calculate NUM_BANKS for DB correctly on CIK
NUM_BANKS is not constant on CIK.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-01-06 18:40:42 +01:00
Marek Olšák bf3c361113 radeonsi: set correct pipe config for Hawaii in DB
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-01-06 18:40:42 +01:00
Niels Ole Salscheider 900ac63ee8 winsys/radeon: remove superfluous distinction of cases
Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2013-12-22 01:41:02 +01:00
Marek Olšák 0b37737cc3 winsys/radeon: set/get the scanout flag with the tiling ioctls
If we assume that all buffers allocated by the DDX are scanout, a new flag
that says "this is not scanout" has to be added to support the non-scanout
buffers and maintain backward compatibility.

This fixes bad rendering on Wayland.

The flag is defined as:
  #define RADEON_TILING_R600_NO_SCANOUT   RADEON_TILING_SWAP_16BIT

AFAIK, RADEON_TILING_SWAP_16BIT is not used on SI.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-12-12 17:26:41 +01:00
Christopher James Halse Rogers db687011e0 gallium/radeon: Implement hooks for DRI Image 7 (v2)
v2: Fix transliteration of lseek arguments
    Ignore busy return from RADEON_GEM_BUSY ioctl; we're only after the domain

Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2013-12-10 09:46:45 +01:00
Christopher James Halse Rogers bff6c5d2b5 radeon: Rename bo_handles hashtable to match its actual contents.
It's a map of GEM name->bo, so identify it as such

Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2013-12-10 09:46:41 +01:00
Christopher James Halse Rogers d5a3a2d2fb gallium/winsys/drm: Prepare for passing prime fds in winsys_handle
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2013-12-10 09:46:05 +01:00
Christian König ecb37a6e77 winsys/radeon: cleanup virtual memory nonsense
The alignment of a virtual memory area must always be at least 4096 bytes.

It only worked because size was aligned to 4096 outside of the function.

Signed-off-by: Christian König <christian.koenig@amd.com>
2013-11-21 10:24:20 +01:00
Emil Velikov f7ac1d5989 gallium/winsys: compact compiler flags into Automake.inc
Cleanup the duplicating flags and consolidate into a sigle variable.

Note: this patch adds VISIBILITY_CFLAGS to the following targets
* freedreno/drm
* i915/{drm,sw}
* nouveau/drm
* sw/fbdev
* sw/null
* sw/wayland
* sw/wrapper
* sw/xlib

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-11-16 16:31:03 +00:00
Alex Deucher f5778f152b radeonsi: add support for Hawaii asics (v2)
Update additional register fields.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-11-15 08:51:09 -05:00
Marek Olšák 5e43819475 winsys/radeon: use type-3 NOPs for CS padding on CIK
The type-2 NOPs are said to be unstable. It doesn't make a difference here.
2013-11-04 19:07:56 +01:00
Christian König 3d3a0b9b67 winsys/radeon: make radeon_drm_winsys_create public
Otherwise OpenGL/VDPAU interop won't work as expected.

Signed-off-by: Christian König <christian.koenig@amd.com>
2013-10-26 12:13:36 +02:00
Marek Olšák 6067a30838 winsys/radeon: add the implementation of fences from r300g 2013-10-25 11:55:55 +02:00
Christian König 21a57f9040 winsys/radeon: cleanup CS offloading
Using atomic function for ncs is superfluous since it is
protected by a mutex anyway. Also lock the mutex only once
while retrieving the next CS for submission.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2013-10-21 10:20:18 +02:00
Christian König 8bc7673ef8 radeon/winsys: fix handling in radeon_drm_cs_flush v2
Calling radeon_drm_cs_flush from multiple threads might cause deadlocks,
fix this by immediately signaling the semaphore after waiting for it.

This is a candidate for the stable branch(es).

Partially fixes: https://bugs.freedesktop.org/show_bug.cgi?id=70123

v2: some fixes on commit message

Signed-off-by: Christian König <christian.koenig@amd.com>
2013-10-10 11:50:38 +02:00
Marek Olšák c787a9767c gallium/radeon: don't export any private symbols
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-08 16:23:52 +02:00
Christian König 4871128e58 radeon/winsys: keep screen pointer in winsys v2
Only create one screen for each winsys instance.
This helps with buffer sharing and interop handling.

v2: rebased and some minor cleanup

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2013-09-25 19:41:31 +02:00
Christian König f9f14201c1 radeon/uvd: move alignment to winsys
Similar to GFX and DMA.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2013-09-25 10:58:58 +02:00