diff options
author | Jerome Glisse <[email protected]> | 2013-01-07 11:49:23 -0500 |
---|---|---|
committer | Jerome Glisse <[email protected]> | 2013-01-28 11:30:35 -0500 |
commit | 6c064fd7492ea835f873112bc3189bb1920aad32 (patch) | |
tree | 88f392933291091c872523159a43ed3963111c2f /src/gallium/winsys/radeon/drm/radeon_drm_winsys.h | |
parent | cbf0f666311a5cb2720a4d6f4c540da1dd33e418 (diff) |
radeon/winsys: add dma ring support to winsys v3
Add ring support, you can create a cs for each ring. DMA ring is
bit special regarding relocation as you must emit as much relocation
as there is use of the buffer.
v2: - Improved comment on relocation changes
- Use a single thread to queue cs submittion this simplify driver
code while not impacting performances. Rational for this is that
you have to wait for all previous submission to have completed
so there was never a case while we could have 2 different thread
submitting a command stream at the same time. This code just
consolidate submission into one single thread per winsys.
v3: - Do not use semaphore for empty queue signaling, instead use
cond var. This is because it's tricky to maintain an even number
of call to semaphore wait and semaphore signal (the number of
cs in the stack would for instance make that number vary).
Signed-off-by: Jerome Glisse <[email protected]>
Diffstat (limited to 'src/gallium/winsys/radeon/drm/radeon_drm_winsys.h')
-rw-r--r-- | src/gallium/winsys/radeon/drm/radeon_drm_winsys.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.h b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.h index e714127730f..74eb408151b 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.h +++ b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.h @@ -33,6 +33,8 @@ #include "radeon_winsys.h" #include "os/os_thread.h" +struct radeon_drm_cs; + enum radeon_generation { DRV_R300, DRV_R600, @@ -58,6 +60,19 @@ struct radeon_drm_winsys { pipe_mutex hyperz_owner_mutex; struct radeon_drm_cs *cmask_owner; pipe_mutex cmask_owner_mutex; + + /* rings submission thread */ + pipe_mutex cs_stack_lock; + pipe_semaphore cs_queued; + /* we cannot use semaphore for empty queue because maintaining an even + * number of call to semaphore_wait and semaphore_signal is, to say the + * least, tricky + */ + pipe_condvar cs_queue_empty; + pipe_thread thread; + int kill_thread; + int ncs; + struct radeon_drm_cs *cs_stack[RING_LAST]; }; static INLINE struct radeon_drm_winsys * @@ -66,4 +81,6 @@ radeon_drm_winsys(struct radeon_winsys *base) return (struct radeon_drm_winsys*)base; } +void radeon_drm_ws_queue_cs(struct radeon_drm_winsys *ws, struct radeon_drm_cs *cs); + #endif |