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_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_winsys.h')
-rw-r--r-- | src/gallium/winsys/radeon/drm/radeon_winsys.h | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/gallium/winsys/radeon/drm/radeon_winsys.h b/src/gallium/winsys/radeon/drm/radeon_winsys.h index d0c48224cc5..7fdef3fad87 100644 --- a/src/gallium/winsys/radeon/drm/radeon_winsys.h +++ b/src/gallium/winsys/radeon/drm/radeon_winsys.h @@ -138,12 +138,19 @@ enum chip_class { TAHITI, }; +enum ring_type { + RING_GFX = 0, + RING_DMA, + RING_LAST, +}; + struct winsys_handle; struct radeon_winsys_cs_handle; struct radeon_winsys_cs { - unsigned cdw; /* Number of used dwords. */ - uint32_t *buf; /* The command buffer. */ + unsigned cdw; /* Number of used dwords. */ + uint32_t *buf; /* The command buffer. */ + enum ring_type ring_type; }; struct radeon_info { @@ -170,6 +177,7 @@ struct radeon_info { uint32_t r600_max_pipes; boolean r600_backend_map_valid; boolean r600_virtual_address; + boolean r600_has_dma; }; enum radeon_feature_id { @@ -350,7 +358,7 @@ struct radeon_winsys { * * \param ws The winsys this function is called from. */ - struct radeon_winsys_cs *(*cs_create)(struct radeon_winsys *ws); + struct radeon_winsys_cs *(*cs_create)(struct radeon_winsys *ws, enum ring_type ring_type); /** * Destroy a command stream. @@ -433,6 +441,12 @@ struct radeon_winsys { boolean (*cs_request_feature)(struct radeon_winsys_cs *cs, enum radeon_feature_id fid, boolean enable); + /** + * Make sure all asynchronous flush of the cs have completed + * + * \param cs A command stream. + */ + void (*cs_sync_flush)(struct radeon_winsys_cs *cs); /** * Initialize surface |