*/
bool nosync : 1;
+ /* Most recent index in submit's bo table, used to optimize the common
+ * case where a bo is used many times in the same submit.
+ */
+ uint32_t idx;
+
struct list_head list; /* bucket-list entry */
time_t free_time; /* time when added to bucket-list */
struct msm_bo {
struct fd_bo base;
uint64_t offset;
- uint32_t idx;
};
FD_DEFINE_CAST(fd_bo, msm_bo);
static uint32_t
append_bo(struct msm_submit *submit, struct fd_bo *bo)
{
- struct msm_bo *msm_bo = to_msm_bo(bo);
uint32_t idx;
/* NOTE: it is legal to use the same bo on different threads for
* different submits. But it is not legal to use the same submit
* from given threads.
*/
- idx = READ_ONCE(msm_bo->idx);
+ idx = READ_ONCE(bo->idx);
if (unlikely((idx >= submit->nr_submit_bos) ||
(submit->submit_bos[idx].handle != bo->handle))) {
_mesa_hash_table_insert_pre_hashed(submit->bo_table, hash, bo,
(void *)(uintptr_t)idx);
}
- msm_bo->idx = idx;
+ bo->idx = idx;
}
return idx;
static uint32_t
msm_submit_append_bo(struct msm_submit_sp *submit, struct fd_bo *bo)
{
- struct msm_bo *msm_bo = to_msm_bo(bo);
uint32_t idx;
/* NOTE: it is legal to use the same bo on different threads for
* different submits. But it is not legal to use the same submit
* from different threads.
*/
- idx = READ_ONCE(msm_bo->idx);
+ idx = READ_ONCE(bo->idx);
if (unlikely((idx >= submit->nr_bos) || (submit->bos[idx] != bo))) {
uint32_t hash = _mesa_hash_pointer(bo);
_mesa_hash_table_insert_pre_hashed(submit->bo_table, hash, bo,
(void *)(uintptr_t)idx);
}
- msm_bo->idx = idx;
+ bo->idx = idx;
}
return idx;