[Mesa-dev] [PATCH v2] intel/batch_decoder: decoding of 3DSTATE_CONSTANT_BODY.
Sergii Romantsov
sergii.romantsov at gmail.com
Mon Jul 16 06:46:20 UTC 2018
Hello, Kenneth.
Any more remarks?
On Thu, Jul 12, 2018 at 3:47 PM, Sergii Romantsov <
sergii.romantsov at gmail.com> wrote:
> SNB doesn't have a definition of 3DSTATE_CONSTANT_BODY, thats
> why we got segmentation fault when used INTEL_DEBUG=bat.
> Fixed by adding of 3DSTATE_CONSTANT_BODY into 3DSTATE_CONSTANT
> of VS, GS and PS structures.
>
> v2: added definition of 3DSTATE_CONSTANT_BODY to the gen6.xml
>
> Fixes: 169d8e011ae (intel: Fix 3DSTATE_CONSTANT buffer decoding.)
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107190
> Signed-off-by: Sergii Romantsov <sergii.romantsov at globallogic.com>
> ---
> src/intel/genxml/gen6.xml | 38
> ++++++++++-----------------
> src/mesa/drivers/dri/i965/genX_state_upload.c | 12 ++++-----
> 2 files changed, 20 insertions(+), 30 deletions(-)
>
> diff --git a/src/intel/genxml/gen6.xml b/src/intel/genxml/gen6.xml
> index c2967cd..62d2574 100644
> --- a/src/intel/genxml/gen6.xml
> +++ b/src/intel/genxml/gen6.xml
> @@ -622,6 +622,17 @@
> <field name="Maximum VP Index" start="96" end="99" type="uint"/>
> </instruction>
>
> + <struct name="3DSTATE_CONSTANT_BODY" length="4">
> + <field name="Pointer to Constant Buffer 0" start="5" end="31"
> type="offset"/>
> + <field name="Constant Buffer 0 Read Length" start="0" end="4"
> type="uint"/>
> + <field name="Pointer to Constant Buffer 1" start="37" end="63"
> type="address"/>
> + <field name="Constant Buffer 1 Read Length" start="32" end="36"
> type="uint"/>
> + <field name="Pointer to Constant Buffer 2" start="69" end="95"
> type="address"/>
> + <field name="Constant Buffer 2 Read Length" start="64" end="68"
> type="uint"/>
> + <field name="Pointer to Constant Buffer 3" start="101" end="127"
> type="address"/>
> + <field name="Constant Buffer 3 Read Length" start="96" end="100"
> type="uint"/>
> + </struct>
> +
> <instruction name="3DSTATE_CONSTANT_GS" bias="2" length="5">
> <field name="Command Type" start="29" end="31" type="uint"
> default="3"/>
> <field name="Command SubType" start="27" end="28" type="uint"
> default="3"/>
> @@ -633,14 +644,7 @@
> <field name="Buffer 0 Valid" start="12" end="12" type="bool"/>
> <field name="Constant Buffer Object Control State" start="8" end="11"
> type="MEMORY_OBJECT_CONTROL_STATE"/>
> <field name="DWord Length" start="0" end="7" type="uint" default="3"/>
> - <field name="Pointer to GS Constant Buffer 0" start="37" end="63"
> type="offset"/>
> - <field name="GS Constant Buffer 0 Read Length" start="32" end="36"
> type="uint"/>
> - <field name="Pointer to GS Constant Buffer 1" start="69" end="95"
> type="address"/>
> - <field name="GS Constant Buffer 1 Read Length" start="64" end="68"
> type="uint"/>
> - <field name="Pointer to GS Constant Buffer 2" start="101" end="127"
> type="address"/>
> - <field name="GS Constant Buffer 2 Read Length" start="96" end="100"
> type="uint"/>
> - <field name="Pointer to GS Constant Buffer 3" start="133" end="159"
> type="address"/>
> - <field name="GS Constant Buffer 3 Read Length" start="128" end="132"
> type="uint"/>
> + <field name="Constant Body" start="32" end="159"
> type="3DSTATE_CONSTANT_BODY"/>
> </instruction>
>
> <instruction name="3DSTATE_CONSTANT_PS" bias="2" length="5">
> @@ -654,14 +658,7 @@
> <field name="Buffer 0 Valid" start="12" end="12" type="bool"/>
> <field name="Constant Buffer Object Control State" start="8" end="11"
> type="MEMORY_OBJECT_CONTROL_STATE"/>
> <field name="DWord Length" start="0" end="7" type="uint" default="3"/>
> - <field name="Pointer to PS Constant Buffer 0" start="37" end="63"
> type="offset"/>
> - <field name="PS Constant Buffer 0 Read Length" start="32" end="36"
> type="uint"/>
> - <field name="Pointer to PS Constant Buffer 1" start="69" end="95"
> type="address"/>
> - <field name="PS Constant Buffer 1 Read Length" start="64" end="68"
> type="uint"/>
> - <field name="Pointer to PS Constant Buffer 2" start="101" end="127"
> type="address"/>
> - <field name="PS Constant Buffer 2 Read Length" start="96" end="100"
> type="uint"/>
> - <field name="Pointer to PS Constant Buffer 3" start="133" end="159"
> type="address"/>
> - <field name="PS Constant Buffer 3 Read Length" start="128" end="132"
> type="uint"/>
> + <field name="Constant Body" start="32" end="159"
> type="3DSTATE_CONSTANT_BODY"/>
> </instruction>
>
> <instruction name="3DSTATE_CONSTANT_VS" bias="2" length="5">
> @@ -675,14 +672,7 @@
> <field name="Buffer 0 Valid" start="12" end="12" type="bool"/>
> <field name="Constant Buffer Object Control State" start="8" end="11"
> type="MEMORY_OBJECT_CONTROL_STATE"/>
> <field name="DWord Length" start="0" end="7" type="uint" default="3"/>
> - <field name="Pointer to VS Constant Buffer 0" start="37" end="63"
> type="offset"/>
> - <field name="VS Constant Buffer 0 Read Length" start="32" end="36"
> type="uint"/>
> - <field name="Pointer to VS Constant Buffer 1" start="69" end="95"
> type="address"/>
> - <field name="VS Constant Buffer 1 Read Length" start="64" end="68"
> type="uint"/>
> - <field name="Pointer to VS Constant Buffer 2" start="101" end="127"
> type="address"/>
> - <field name="VS Constant Buffer 2 Read Length" start="96" end="100"
> type="uint"/>
> - <field name="Pointer to VS Constant Buffer 3" start="133" end="159"
> type="address"/>
> - <field name="VS Constant Buffer 3 Read Length" start="128" end="132"
> type="uint"/>
> + <field name="Constant Body" start="32" end="159"
> type="3DSTATE_CONSTANT_BODY"/>
> </instruction>
>
> <instruction name="3DSTATE_DEPTH_BUFFER" bias="2" length="7">
> diff --git a/src/mesa/drivers/dri/i965/genX_state_upload.c
> b/src/mesa/drivers/dri/i965/genX_state_upload.c
> index 7fe1288..a4e395c 100644
> --- a/src/mesa/drivers/dri/i965/genX_state_upload.c
> +++ b/src/mesa/drivers/dri/i965/genX_state_upload.c
> @@ -1879,8 +1879,8 @@ genX(upload_wm)(struct brw_context *brw)
> /* Pointer to the WM constant buffer. Covered by the set of
> * state flags from gen6_upload_wm_push_constants.
> */
> - wmcp.PointertoPSConstantBuffer0 = stage_state->push_const_
> offset;
> - wmcp.PSConstantBuffer0ReadLength = stage_state->push_const_size
> - 1;
> + wmcp.ConstantBody.PointertoConstantBuffer0 =
> stage_state->push_const_offset;
> + wmcp.ConstantBody.ConstantBuffer0ReadLength =
> stage_state->push_const_size - 1;
> }
> }
> #endif
> @@ -2215,8 +2215,8 @@ genX(upload_vs_state)(struct brw_context *brw)
> brw_batch_emit(brw, GENX(3DSTATE_CONSTANT_VS), cvs) {
> if (stage_state->push_const_size != 0) {
> cvs.Buffer0Valid = true;
> - cvs.PointertoVSConstantBuffer0 = stage_state->push_const_offset;
> - cvs.VSConstantBuffer0ReadLength = stage_state->push_const_size
> - 1;
> + cvs.ConstantBody.PointertoConstantBuffer0 =
> stage_state->push_const_offset;
> + cvs.ConstantBody.ConstantBuffer0ReadLength =
> stage_state->push_const_size - 1;
> }
> }
> #endif
> @@ -2707,8 +2707,8 @@ genX(upload_gs_state)(struct brw_context *brw)
> brw_batch_emit(brw, GENX(3DSTATE_CONSTANT_GS), cgs) {
> if (active && stage_state->push_const_size != 0) {
> cgs.Buffer0Valid = true;
> - cgs.PointertoGSConstantBuffer0 = stage_state->push_const_offset;
> - cgs.GSConstantBuffer0ReadLength = stage_state->push_const_size
> - 1;
> + cgs.ConstantBody.PointertoConstantBuffer0 =
> stage_state->push_const_offset;
> + cgs.ConstantBody.ConstantBuffer0ReadLength =
> stage_state->push_const_size - 1;
> }
> }
> #endif
> --
> 2.7.4
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180716/5d84afac/attachment-0001.html>
More information about the mesa-dev
mailing list