mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 13:48:06 +02:00
pvr: Enable PDS_DDMADT
Signed-off-by: Ashish Chauhan <Ashish.Chauhan@imgtec.com> Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36412>
This commit is contained in:
parent
849a331a7d
commit
4873903b56
3 changed files with 70 additions and 20 deletions
|
|
@ -36,6 +36,11 @@ SOFTWARE.
|
||||||
<value name="COMMON_STORE" value="1"/>
|
<value name="COMMON_STORE" value="1"/>
|
||||||
</enum>
|
</enum>
|
||||||
|
|
||||||
|
<enum name="DEST">
|
||||||
|
<value name="UNIFIED_STORE" value="0"/>
|
||||||
|
<value name="COMMON_STORE" value="1"/>
|
||||||
|
</enum>
|
||||||
|
|
||||||
<enum name="DOUTI_SHADEMODEL">
|
<enum name="DOUTI_SHADEMODEL">
|
||||||
<value name="FLAT_VERTEX0" value="0"/>
|
<value name="FLAT_VERTEX0" value="0"/>
|
||||||
<value name="FLAT_VERTEX1" value="1"/>
|
<value name="FLAT_VERTEX1" value="1"/>
|
||||||
|
|
@ -69,6 +74,20 @@ SOFTWARE.
|
||||||
<value name="FOUR" value="3"/>
|
<value name="FOUR" value="3"/>
|
||||||
</enum>
|
</enum>
|
||||||
|
|
||||||
|
<struct name="DDMAD_FIELDS_SRC3" length="2">
|
||||||
|
<condition type="if" check="PDS_DDMADT"/>
|
||||||
|
<field name="msize" start="33" end="63" type="uint"/>
|
||||||
|
<field name="test" start="32" end="32" type="bool"/>
|
||||||
|
<condition type="endif" check="PDS_DDMADT"/>
|
||||||
|
<field name="last" start="31" end="31" type="bool"/>
|
||||||
|
<field name="wordsize" start="29" end="30" type="WORDSIZE"/>
|
||||||
|
<field name="dest" start="28" end="28" type="DEST"/>
|
||||||
|
<field name="cmode" start="26" end="27" type="CMODE_LD"/>
|
||||||
|
<field name="a0" start="13" end="25" type="uint"/>
|
||||||
|
<field name="repeat" start="12" end="12" type="bool"/>
|
||||||
|
<field name="bsize" start="0" end="11" type="uint"/>
|
||||||
|
</struct>
|
||||||
|
|
||||||
<struct name="DOUTU_SRC0" length="2">
|
<struct name="DOUTU_SRC0" length="2">
|
||||||
<field name="dual_phase" start="41" end ="41" type="bool"/>
|
<field name="dual_phase" start="41" end ="41" type="bool"/>
|
||||||
<field name="temps" start="35" end="40" type="uint">
|
<field name="temps" start="35" end="40" type="uint">
|
||||||
|
|
|
||||||
|
|
@ -1000,13 +1000,13 @@ struct pvr_pds_vertex_primary_program_input {
|
||||||
#define PVR_PDS_CONST_MAP_ENTRY_TYPE_VERTEX_ATTR_DDMADT_OOB_BUFFER_SIZE (9)
|
#define PVR_PDS_CONST_MAP_ENTRY_TYPE_VERTEX_ATTR_DDMADT_OOB_BUFFER_SIZE (9)
|
||||||
|
|
||||||
/* Use if pds_ddmadt is not enabled. */
|
/* Use if pds_ddmadt is not enabled. */
|
||||||
#define PVR_PDS_CONST_MAP_ENTRY_TYPE_VERTEX_ATTRIBUTE_MAX_INDEX (9)
|
#define PVR_PDS_CONST_MAP_ENTRY_TYPE_VERTEX_ATTRIBUTE_MAX_INDEX (10)
|
||||||
|
|
||||||
#define PVR_PDS_CONST_MAP_ENTRY_TYPE_BASE_INSTANCE (10)
|
#define PVR_PDS_CONST_MAP_ENTRY_TYPE_BASE_INSTANCE (11)
|
||||||
#define PVR_PDS_CONST_MAP_ENTRY_TYPE_CONSTANT_BUFFER_ZEROING (11)
|
#define PVR_PDS_CONST_MAP_ENTRY_TYPE_CONSTANT_BUFFER_ZEROING (12)
|
||||||
#define PVR_PDS_CONST_MAP_ENTRY_TYPE_BASE_VERTEX (12)
|
#define PVR_PDS_CONST_MAP_ENTRY_TYPE_BASE_VERTEX (13)
|
||||||
#define PVR_PDS_CONST_MAP_ENTRY_TYPE_BASE_WORKGROUP (13)
|
#define PVR_PDS_CONST_MAP_ENTRY_TYPE_BASE_WORKGROUP (14)
|
||||||
#define PVR_PDS_CONST_MAP_ENTRY_TYPE_COND_RENDER (14)
|
#define PVR_PDS_CONST_MAP_ENTRY_TYPE_COND_RENDER (15)
|
||||||
|
|
||||||
/* We pack all the following structs tightly into a buffer using += sizeof(x)
|
/* We pack all the following structs tightly into a buffer using += sizeof(x)
|
||||||
* offsets, this can lead to data that is not native aligned. Supplying the
|
* offsets, this can lead to data that is not native aligned. Supplying the
|
||||||
|
|
|
||||||
|
|
@ -3465,6 +3465,49 @@ pvr_setup_vertex_buffers(struct pvr_cmd_buffer *cmd_buffer,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case PVR_PDS_CONST_MAP_ENTRY_TYPE_VERTEX_ATTR_DDMADT_OOB_BUFFER_SIZE: {
|
||||||
|
const struct pvr_pds_const_map_entry_vertex_attr_ddmadt_oob_buffer_size
|
||||||
|
*ddmadt_src3 =
|
||||||
|
(struct pvr_pds_const_map_entry_vertex_attr_ddmadt_oob_buffer_size
|
||||||
|
*)entries;
|
||||||
|
const struct pvr_vertex_binding *const binding =
|
||||||
|
&state->vertex_bindings[ddmadt_src3->binding_index];
|
||||||
|
|
||||||
|
const struct vk_dynamic_graphics_state *dynamic_state =
|
||||||
|
&cmd_buffer->vk.dynamic_graphics_state;
|
||||||
|
uint32_t stride =
|
||||||
|
dynamic_state->vi_binding_strides[ddmadt_src3->binding_index];
|
||||||
|
uint32_t bound_size = binding->buffer->vk.size - binding->offset;
|
||||||
|
uint64_t control_qword;
|
||||||
|
uint32_t control_dword;
|
||||||
|
|
||||||
|
assert(PVR_HAS_FEATURE(&cmd_buffer->device->pdevice->dev_info,
|
||||||
|
pds_ddmadt));
|
||||||
|
|
||||||
|
if (stride) {
|
||||||
|
bound_size -= bound_size % stride;
|
||||||
|
if (bound_size == 0) {
|
||||||
|
/* If size is zero, DMA OOB won't execute. Read will come from
|
||||||
|
* robustness buffer.
|
||||||
|
*/
|
||||||
|
bound_size = stride;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pvr_csb_pack (&control_qword, PDSINST_DDMAD_FIELDS_SRC3, src3) {
|
||||||
|
src3.test = true;
|
||||||
|
src3.msize = bound_size;
|
||||||
|
}
|
||||||
|
control_dword = (uint32_t)(control_qword >> 32);
|
||||||
|
|
||||||
|
PVR_WRITE(dword_buffer,
|
||||||
|
control_dword,
|
||||||
|
ddmadt_src3->const_offset,
|
||||||
|
pds_info->data_size_in_dwords);
|
||||||
|
|
||||||
|
entries += sizeof(*ddmadt_src3);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case PVR_PDS_CONST_MAP_ENTRY_TYPE_VERTEX_ATTRIBUTE_MAX_INDEX: {
|
case PVR_PDS_CONST_MAP_ENTRY_TYPE_VERTEX_ATTRIBUTE_MAX_INDEX: {
|
||||||
const struct pvr_const_map_entry_vertex_attribute_max_index *attribute =
|
const struct pvr_const_map_entry_vertex_attribute_max_index *attribute =
|
||||||
(struct pvr_const_map_entry_vertex_attribute_max_index *)entries;
|
(struct pvr_const_map_entry_vertex_attribute_max_index *)entries;
|
||||||
|
|
@ -3475,20 +3518,8 @@ pvr_setup_vertex_buffers(struct pvr_cmd_buffer *cmd_buffer,
|
||||||
attribute->offset + attribute->component_size_in_bytes;
|
attribute->offset + attribute->component_size_in_bytes;
|
||||||
uint32_t max_index;
|
uint32_t max_index;
|
||||||
|
|
||||||
if (PVR_HAS_FEATURE(&cmd_buffer->device->pdevice->dev_info,
|
/* If the stride is 0 then all attributes use the same single
|
||||||
pds_ddmadt)) {
|
* element from the binding so the index can only be up to 0.
|
||||||
/* TODO: PVR_PDS_CONST_MAP_ENTRY_TYPE_VERTEX_ATTRIBUTE_MAX_INDEX
|
|
||||||
* has the same define value as
|
|
||||||
* PVR_PDS_CONST_MAP_ENTRY_TYPE_VERTEX_ATTR_DDMADT_OOB_BUFFER_SIZE
|
|
||||||
* so maybe we want to remove one of the defines or change the
|
|
||||||
* values.
|
|
||||||
*/
|
|
||||||
pvr_finishme("Unimplemented robust buffer access with DDMADT");
|
|
||||||
assert(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* If the stride is 0 then all attributes use the same single element
|
|
||||||
* from the binding so the index can only be up to 0.
|
|
||||||
*/
|
*/
|
||||||
if (bound_size < attribute_end || attribute->stride == 0) {
|
if (bound_size < attribute_end || attribute->stride == 0) {
|
||||||
max_index = 0;
|
max_index = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue