mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 13:58:04 +02:00
winsys/amdgpu: amdgpu_cs_context is csc, amdgpu_cs is acs
radeon_cmdbuf is rcs instead of rws, probably earlier renaming of rws was agressive. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33661>
This commit is contained in:
parent
fc36840c04
commit
06691b9f39
4 changed files with 261 additions and 261 deletions
|
|
@ -363,7 +363,7 @@ void *amdgpu_bo_map(struct radeon_winsys *rws,
|
|||
struct amdgpu_winsys *aws = amdgpu_winsys(rws);
|
||||
struct amdgpu_winsys_bo *bo = (struct amdgpu_winsys_bo*)buf;
|
||||
struct amdgpu_bo_real *real;
|
||||
struct amdgpu_cs *cs = rcs ? amdgpu_cs(rcs) : NULL;
|
||||
struct amdgpu_cs *acs = rcs ? amdgpu_cs(rcs) : NULL;
|
||||
|
||||
assert(bo->type != AMDGPU_BO_SPARSE);
|
||||
|
||||
|
|
@ -379,9 +379,9 @@ void *amdgpu_bo_map(struct radeon_winsys *rws,
|
|||
* (neither one is changing it).
|
||||
*
|
||||
* Only check whether the buffer is being used for write. */
|
||||
if (cs && amdgpu_bo_is_referenced_by_cs_with_usage(cs, bo,
|
||||
RADEON_USAGE_WRITE)) {
|
||||
cs->flush_cs(cs->flush_data,
|
||||
if (acs && amdgpu_bo_is_referenced_by_cs_with_usage(acs, bo,
|
||||
RADEON_USAGE_WRITE)) {
|
||||
acs->flush_cs(acs->flush_data,
|
||||
RADEON_FLUSH_ASYNC_START_NEXT_GFX_IB_NOW, NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -391,8 +391,8 @@ void *amdgpu_bo_map(struct radeon_winsys *rws,
|
|||
return NULL;
|
||||
}
|
||||
} else {
|
||||
if (cs && amdgpu_bo_is_referenced_by_cs(cs, bo)) {
|
||||
cs->flush_cs(cs->flush_data,
|
||||
if (acs && amdgpu_bo_is_referenced_by_cs(acs, bo)) {
|
||||
acs->flush_cs(acs->flush_data,
|
||||
RADEON_FLUSH_ASYNC_START_NEXT_GFX_IB_NOW, NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -413,10 +413,10 @@ void *amdgpu_bo_map(struct radeon_winsys *rws,
|
|||
* (neither one is changing it).
|
||||
*
|
||||
* Only check whether the buffer is being used for write. */
|
||||
if (cs) {
|
||||
if (amdgpu_bo_is_referenced_by_cs_with_usage(cs, bo,
|
||||
if (acs) {
|
||||
if (amdgpu_bo_is_referenced_by_cs_with_usage(acs, bo,
|
||||
RADEON_USAGE_WRITE)) {
|
||||
cs->flush_cs(cs->flush_data,
|
||||
acs->flush_cs(acs->flush_data,
|
||||
RADEON_FLUSH_START_NEXT_GFX_IB_NOW, NULL);
|
||||
} else {
|
||||
/* Try to avoid busy-waiting in amdgpu_bo_wait. */
|
||||
|
|
@ -429,9 +429,9 @@ void *amdgpu_bo_map(struct radeon_winsys *rws,
|
|||
RADEON_USAGE_WRITE);
|
||||
} else {
|
||||
/* Mapping for write. */
|
||||
if (cs) {
|
||||
if (amdgpu_bo_is_referenced_by_cs(cs, bo)) {
|
||||
cs->flush_cs(cs->flush_data,
|
||||
if (acs) {
|
||||
if (amdgpu_bo_is_referenced_by_cs(acs, bo)) {
|
||||
acs->flush_cs(acs->flush_data,
|
||||
RADEON_FLUSH_START_NEXT_GFX_IB_NOW, NULL);
|
||||
} else {
|
||||
/* Try to avoid busy-waiting in amdgpu_bo_wait. */
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -247,24 +247,24 @@ static inline void amdgpu_fence_drop_reference(struct pipe_fence_handle *dst)
|
|||
}
|
||||
|
||||
struct amdgpu_cs_buffer *
|
||||
amdgpu_lookup_buffer_any_type(struct amdgpu_cs_context *cs, struct amdgpu_winsys_bo *bo);
|
||||
amdgpu_lookup_buffer_any_type(struct amdgpu_cs_context *csc, struct amdgpu_winsys_bo *bo);
|
||||
|
||||
static inline struct amdgpu_cs *
|
||||
amdgpu_cs(struct radeon_cmdbuf *rcs)
|
||||
{
|
||||
struct amdgpu_cs *cs = (struct amdgpu_cs*)rcs->priv;
|
||||
assert(cs);
|
||||
return cs;
|
||||
struct amdgpu_cs *acs = (struct amdgpu_cs*)rcs->priv;
|
||||
assert(acs);
|
||||
return acs;
|
||||
}
|
||||
|
||||
#define get_container(member_ptr, container_type, container_member) \
|
||||
(container_type *)((char *)(member_ptr) - offsetof(container_type, container_member))
|
||||
|
||||
static inline bool
|
||||
amdgpu_bo_is_referenced_by_cs(struct amdgpu_cs *cs,
|
||||
amdgpu_bo_is_referenced_by_cs(struct amdgpu_cs *acs,
|
||||
struct amdgpu_winsys_bo *bo)
|
||||
{
|
||||
return amdgpu_lookup_buffer_any_type(amdgpu_csc_get_current(cs), bo) != NULL;
|
||||
return amdgpu_lookup_buffer_any_type(amdgpu_csc_get_current(acs), bo) != NULL;
|
||||
}
|
||||
|
||||
static inline unsigned get_buf_list_idx(struct amdgpu_winsys_bo *bo)
|
||||
|
|
@ -275,11 +275,11 @@ static inline unsigned get_buf_list_idx(struct amdgpu_winsys_bo *bo)
|
|||
}
|
||||
|
||||
static inline bool
|
||||
amdgpu_bo_is_referenced_by_cs_with_usage(struct amdgpu_cs *cs,
|
||||
amdgpu_bo_is_referenced_by_cs_with_usage(struct amdgpu_cs *acs,
|
||||
struct amdgpu_winsys_bo *bo,
|
||||
unsigned usage)
|
||||
{
|
||||
struct amdgpu_cs_buffer *buffer = amdgpu_lookup_buffer_any_type(amdgpu_csc_get_current(cs), bo);
|
||||
struct amdgpu_cs_buffer *buffer = amdgpu_lookup_buffer_any_type(amdgpu_csc_get_current(acs), bo);
|
||||
|
||||
return buffer && (buffer->usage & usage) != 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -306,8 +306,8 @@ static bool kms_handle_equals(const void *a, const void *b)
|
|||
|
||||
static bool amdgpu_cs_is_secure(struct radeon_cmdbuf *rcs)
|
||||
{
|
||||
struct amdgpu_cs *cs = amdgpu_cs(rcs);
|
||||
return amdgpu_csc_get_current(cs)->secure;
|
||||
struct amdgpu_cs *acs = amdgpu_cs(rcs);
|
||||
return amdgpu_csc_get_current(acs)->secure;
|
||||
}
|
||||
|
||||
static uint32_t
|
||||
|
|
@ -332,13 +332,13 @@ radeon_to_amdgpu_pstate(enum radeon_ctx_pstate pstate)
|
|||
static bool
|
||||
amdgpu_cs_set_pstate(struct radeon_cmdbuf *rcs, enum radeon_ctx_pstate pstate)
|
||||
{
|
||||
struct amdgpu_cs *cs = amdgpu_cs(rcs);
|
||||
struct amdgpu_cs *acs = amdgpu_cs(rcs);
|
||||
|
||||
if (!cs->aws->info.has_stable_pstate)
|
||||
if (!acs->aws->info.has_stable_pstate)
|
||||
return false;
|
||||
|
||||
uint32_t amdgpu_pstate = radeon_to_amdgpu_pstate(pstate);
|
||||
return ac_drm_cs_ctx_stable_pstate(cs->aws->dev, cs->ctx->ctx_handle,
|
||||
return ac_drm_cs_ctx_stable_pstate(acs->aws->dev, acs->ctx->ctx_handle,
|
||||
AMDGPU_CTX_OP_SET_STABLE_PSTATE, amdgpu_pstate, NULL) == 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue