Module: Mesa
Branch: main
Commit: 4d6089bfd1583c3f04424f449ee30a74f10fad74
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=4d6089bfd1583c3f04424f449ee30a74f10fad74

Author: Yogesh Mohan Marimuthu <[email protected]>
Date:   Sat Dec  9 15:30:31 2023 +0530

winsys/amdgpu: remove ib_type variable from struct amdgpu_ib

preamble ib is created using amdgpu_cs_setup_preemption()
function. only IB_MAIN memory is allocated from struct amdgpu_ib.
Hence remove ib_type variable from struct amdgpu_ib.

Reviewed-by: Marek Olšák <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26612>

---

 src/gallium/winsys/amdgpu/drm/amdgpu_cs.c | 7 ++-----
 src/gallium/winsys/amdgpu/drm/amdgpu_cs.h | 3 +--
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c 
b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
index 36d41b0c293..b7a558a2172 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
@@ -918,7 +918,7 @@ static bool amdgpu_get_new_ib(struct amdgpu_winsys *ws,
     * and there is less waiting for buffers and fences. Proof:
     *   http://www.phoronix.com/scan.php?page=article&item=mesa-111-si&num=1
     */
-   struct drm_amdgpu_cs_chunk_ib *info = &cs->csc->ib[ib->ib_type];
+   struct drm_amdgpu_cs_chunk_ib *info = &cs->csc->ib[IB_MAIN];
    /* This is the minimum size of a contiguous IB. */
    unsigned ib_size = 4 * 1024 * 4;
 
@@ -959,8 +959,7 @@ static bool amdgpu_get_new_ib(struct amdgpu_winsys *ws,
 
    rcs->current.buf = (uint32_t*)(ib->ib_mapped + ib->used_ib_space);
 
-   if (ib->ib_type == IB_MAIN)
-      cs->csc->ib_main_addr = rcs->current.buf;
+   cs->csc->ib_main_addr = rcs->current.buf;
 
    ib_size = ib->big_ib_buffer->size - ib->used_ib_space;
    rcs->current.max_dw = ib_size / 4 - amdgpu_cs_epilog_dws(cs);
@@ -1130,8 +1129,6 @@ amdgpu_cs_create(struct radeon_cmdbuf *rcs,
    fence_info.offset = cs->ip_type * 4;
    amdgpu_cs_chunk_fence_info_to_data(&fence_info, (void*)&cs->fence_chunk);
 
-   cs->main.ib_type = IB_MAIN;
-
    if (!amdgpu_init_cs_context(ctx->ws, &cs->csc1, ip_type)) {
       FREE(cs);
       return false;
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h 
b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h
index e23be0f19f5..8cb0b218091 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h
@@ -63,7 +63,6 @@ struct amdgpu_ib {
    unsigned                max_ib_size_dw;
    uint32_t                *ptr_ib_size;
    bool                    ptr_ib_size_inside_ib;
-   enum ib_type            ib_type;
 };
 
 struct amdgpu_fence_list {
@@ -212,7 +211,7 @@ static inline struct amdgpu_cs *
 amdgpu_cs(struct radeon_cmdbuf *rcs)
 {
    struct amdgpu_cs *cs = (struct amdgpu_cs*)rcs->priv;
-   assert(!cs || cs->main.ib_type == IB_MAIN);
+   assert(cs);
    return cs;
 }
 

Reply via email to