static void
pvr_submit_info_flags_init(const struct pvr_device_info *const dev_info,
const struct pvr_sub_cmd_compute *const sub_cmd,
- uint32_t *const flags)
+ struct pvr_winsys_compute_submit_flags *flags)
{
- *flags = 0;
-
- if (sub_cmd->uses_barrier)
- *flags |= PVR_WINSYS_COMPUTE_FLAG_PREVENT_ALL_OVERLAP;
-
- if (PVR_HAS_FEATURE(dev_info, gpu_multicore_support) &&
- sub_cmd->uses_atomic_ops) {
- *flags |= PVR_WINSYS_COMPUTE_FLAG_SINGLE_CORE;
- }
+ *flags = (struct pvr_winsys_compute_submit_flags){
+ .prevent_all_overlap = sub_cmd->uses_barrier,
+ .use_single_core = PVR_HAS_FEATURE(dev_info, gpu_multicore_support) &&
+ sub_cmd->uses_atomic_ops,
+ };
}
static void pvr_compute_job_ws_submit_info_init(
state->fw_ext_stream_len = 0;
}
-static void pvr_geom_state_flags_init(const struct pvr_render_job *const job,
- uint32_t *const flags)
+static void
+pvr_geom_state_flags_init(const struct pvr_render_job *const job,
+ struct pvr_winsys_geometry_state_flags *flags)
{
- *flags = 0;
-
- if (!job->rt_dataset->need_frag)
- *flags |= PVR_WINSYS_GEOM_FLAG_FIRST_GEOMETRY;
-
- if (job->geometry_terminate)
- *flags |= PVR_WINSYS_GEOM_FLAG_LAST_GEOMETRY;
-
- if (job->frag_uses_atomic_ops)
- *flags |= PVR_WINSYS_GEOM_FLAG_SINGLE_CORE;
+ *flags = (struct pvr_winsys_geometry_state_flags){
+ .is_first_geometry = !job->rt_dataset->need_frag,
+ .is_last_geometry = job->geometry_terminate,
+ .use_single_core = job->frag_uses_atomic_ops,
+ };
}
static void
state->fw_ext_stream_len = 0;
}
-static void pvr_frag_state_flags_init(const struct pvr_render_job *const job,
- uint32_t *const flags)
+static void
+pvr_frag_state_flags_init(const struct pvr_render_job *const job,
+ struct pvr_winsys_fragment_state_flags *flags)
{
- *flags = 0;
-
- if (job->has_depth_attachment)
- *flags |= PVR_WINSYS_FRAG_FLAG_DEPTH_BUFFER_PRESENT;
-
- if (job->has_stencil_attachment)
- *flags |= PVR_WINSYS_FRAG_FLAG_STENCIL_BUFFER_PRESENT;
-
- if (job->disable_compute_overlap)
- *flags |= PVR_WINSYS_FRAG_FLAG_PREVENT_CDM_OVERLAP;
-
- if (job->frag_uses_atomic_ops)
- *flags |= PVR_WINSYS_FRAG_FLAG_SINGLE_CORE;
-
- if (job->get_vis_results)
- *flags |= PVR_WINSYS_FRAG_FLAG_GET_VIS_RESULTS;
-
- if (job->requires_spm_scratch_buffer)
- *flags |= PVR_WINSYS_FRAG_FLAG_SPMSCRATCHBUFFER;
+ *flags = (struct pvr_winsys_fragment_state_flags){
+ .has_depth_buffer = job->has_depth_attachment,
+ .has_stencil_buffer = job->has_stencil_attachment,
+ .prevent_cdm_overlap = job->disable_compute_overlap,
+ .use_single_core = job->frag_uses_atomic_ops,
+ .get_vis_results = job->get_vis_results,
+ .has_spm_scratch_buffer = job->requires_spm_scratch_buffer,
+ };
}
static void
};
struct pvr_transfer_prep_data {
- uint32_t flags;
+ struct pvr_winsys_transfer_cmd_flags flags;
struct pvr_transfer_3d_state state;
};
static void
pvr_submit_info_flags_init(const struct pvr_device_info *const dev_info,
const struct pvr_transfer_prep_data *const prep_data,
- uint32_t *const flags)
+ struct pvr_winsys_transfer_cmd_flags *flags)
{
*flags = prep_data->flags;
-
- if (PVR_HAS_FEATURE(dev_info, gpu_multicore_support))
- *flags |= PVR_WINSYS_TRANSFER_FLAG_SINGLE_CORE;
+ flags->use_single_core = PVR_HAS_FEATURE(dev_info, gpu_multicore_support);
}
static void pvr_transfer_job_ws_submit_info_init(
struct pvr_winsys *ws;
};
-#define PVR_WINSYS_TRANSFER_FLAG_SINGLE_CORE BITFIELD_BIT(0U)
-
#define PVR_TRANSFER_MAX_PREPARES_PER_SUBMIT 16U
#define PVR_TRANSFER_MAX_RENDER_TARGETS 3U
uint8_t fw_stream[172];
uint32_t fw_stream_len;
- /* Must be 0 or a combination of PVR_WINSYS_TRANSFER_FLAG_* flags. */
- uint32_t flags;
+ struct pvr_winsys_transfer_cmd_flags {
+ bool use_single_core : 1;
+ } flags;
};
struct pvr_winsys_transfer_submit_info {
struct pvr_winsys_transfer_cmd cmds[PVR_TRANSFER_MAX_PREPARES_PER_SUBMIT];
};
-#define PVR_WINSYS_COMPUTE_FLAG_PREVENT_ALL_OVERLAP BITFIELD_BIT(0U)
-#define PVR_WINSYS_COMPUTE_FLAG_SINGLE_CORE BITFIELD_BIT(1U)
-
struct pvr_winsys_compute_submit_info {
uint32_t frame_num;
uint32_t job_num;
uint8_t fw_ext_stream[8];
uint32_t fw_ext_stream_len;
- /* Must be 0 or a combination of PVR_WINSYS_COMPUTE_FLAG_* flags. */
- uint32_t flags;
+ struct pvr_winsys_compute_submit_flags {
+ bool prevent_all_overlap : 1;
+ bool use_single_core : 1;
+ } flags;
};
-#define PVR_WINSYS_GEOM_FLAG_FIRST_GEOMETRY BITFIELD_BIT(0U)
-#define PVR_WINSYS_GEOM_FLAG_LAST_GEOMETRY BITFIELD_BIT(1U)
-#define PVR_WINSYS_GEOM_FLAG_SINGLE_CORE BITFIELD_BIT(2U)
-
-#define PVR_WINSYS_FRAG_FLAG_DEPTH_BUFFER_PRESENT BITFIELD_BIT(0U)
-#define PVR_WINSYS_FRAG_FLAG_STENCIL_BUFFER_PRESENT BITFIELD_BIT(1U)
-#define PVR_WINSYS_FRAG_FLAG_PREVENT_CDM_OVERLAP BITFIELD_BIT(2U)
-#define PVR_WINSYS_FRAG_FLAG_SINGLE_CORE BITFIELD_BIT(3U)
-#define PVR_WINSYS_FRAG_FLAG_GET_VIS_RESULTS BITFIELD_BIT(4U)
-#define PVR_WINSYS_FRAG_FLAG_SPMSCRATCHBUFFER BITFIELD_BIT(5U)
-
struct pvr_winsys_render_submit_info {
struct pvr_winsys_rt_dataset *rt_dataset;
uint8_t rt_data_idx;
uint8_t fw_ext_stream[12];
uint32_t fw_ext_stream_len;
- /* Must be 0 or a combination of PVR_WINSYS_GEOM_FLAG_* flags. */
- uint32_t flags;
+ struct pvr_winsys_geometry_state_flags {
+ bool is_first_geometry : 1;
+ bool is_last_geometry : 1;
+ bool use_single_core : 1;
+ } flags;
struct vk_sync *wait;
} geometry;
uint8_t fw_ext_stream[8];
uint32_t fw_ext_stream_len;
- /* Must be 0 or a combination of PVR_WINSYS_FRAG_FLAG_* flags. */
- uint32_t flags;
+ struct pvr_winsys_fragment_state_flags {
+ bool has_depth_buffer : 1;
+ bool has_stencil_buffer : 1;
+ bool prevent_cdm_overlap : 1;
+ bool use_single_core : 1;
+ bool get_vis_results : 1;
+ bool has_spm_scratch_buffer : 1;
+ } flags;
struct vk_sync *wait;
} fragment;
dev_info);
}
- if (submit_info->flags & PVR_WINSYS_COMPUTE_FLAG_PREVENT_ALL_OVERLAP)
+ if (submit_info->flags.prevent_all_overlap)
cmd->flags |= ROGUE_FWIF_COMPUTE_FLAG_PREVENT_ALL_OVERLAP;
- if (submit_info->flags & PVR_WINSYS_COMPUTE_FLAG_SINGLE_CORE)
+ if (submit_info->flags.use_single_core)
cmd->flags |= ROGUE_FWIF_COMPUTE_FLAG_SINGLE_CORE;
}
dev_info);
}
- if (state->flags & PVR_WINSYS_GEOM_FLAG_FIRST_GEOMETRY)
+ if (state->flags.is_first_geometry)
cmd->flags |= ROGUE_FWIF_TAFLAGS_FIRSTKICK;
- if (state->flags & PVR_WINSYS_GEOM_FLAG_LAST_GEOMETRY)
+ if (state->flags.is_last_geometry)
cmd->flags |= ROGUE_FWIF_TAFLAGS_LASTKICK;
- if (state->flags & PVR_WINSYS_GEOM_FLAG_SINGLE_CORE)
+ if (state->flags.use_single_core)
cmd->flags |= ROGUE_FWIF_TAFLAGS_SINGLE_CORE;
cmd->partial_render_ta_3d_fence.ufo_addr.addr =
dev_info);
}
- if (state->flags & PVR_WINSYS_FRAG_FLAG_DEPTH_BUFFER_PRESENT)
+ if (state->flags.has_depth_buffer)
cmd->flags |= ROGUE_FWIF_RENDERFLAGS_DEPTHBUFFER;
- if (state->flags & PVR_WINSYS_FRAG_FLAG_STENCIL_BUFFER_PRESENT)
+ if (state->flags.has_stencil_buffer)
cmd->flags |= ROGUE_FWIF_RENDERFLAGS_STENCILBUFFER;
- if (state->flags & PVR_WINSYS_FRAG_FLAG_PREVENT_CDM_OVERLAP)
+ if (state->flags.prevent_cdm_overlap)
cmd->flags |= ROGUE_FWIF_RENDERFLAGS_PREVENT_CDM_OVERLAP;
- if (state->flags & PVR_WINSYS_FRAG_FLAG_SINGLE_CORE)
+ if (state->flags.use_single_core)
cmd->flags |= ROGUE_FWIF_RENDERFLAGS_SINGLE_CORE;
- if (state->flags & PVR_WINSYS_FRAG_FLAG_GET_VIS_RESULTS)
+ if (state->flags.get_vis_results)
cmd->flags |= ROGUE_FWIF_RENDERFLAGS_GETVISRESULTS;
- if (state->flags & PVR_WINSYS_FRAG_FLAG_SPMSCRATCHBUFFER)
+ if (state->flags.has_spm_scratch_buffer)
cmd->flags |= ROGUE_FWIF_RENDERFLAGS_SPMSCRATCHBUFFER;
}
}
}
- if (submit_info->geometry.flags & PVR_WINSYS_GEOM_FLAG_FIRST_GEOMETRY) {
+ if (submit_info->geometry.flags.is_first_geometry) {
frag_to_geom_fence_count = 1;
frag_to_geom_fence_value = current_sync_value;
}
submit_cmd->fw_stream_len,
dev_info);
- if (submit_info->cmds[i].flags & PVR_WINSYS_TRANSFER_FLAG_SINGLE_CORE)
+ if (submit_info->cmds[i].flags.use_single_core)
cmd->flags |= ROGUE_FWIF_CMDTRANSFER_SINGLE_CORE;
}
}