[Mesa-dev] [PATCH] i965: Use SET_FIELD in 3DSTATE_STREAMOUT packets.
Anuj Phogat
anuj.phogat at gmail.com
Tue Apr 7 11:56:23 PDT 2015
On Mon, Apr 6, 2015 at 4:12 PM, Kenneth Graunke <kenneth at whitecape.org>
wrote:
> Suggested by Topi Pohjolainen.
>
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> Cc: Topi Pohjolainen <topi.pohjolainen at intel.com>
> ---
> src/mesa/drivers/dri/i965/gen7_sol_state.c | 16 ++++++++--------
> src/mesa/drivers/dri/i965/gen8_sol_state.c | 16 ++++++++--------
> 2 files changed, 16 insertions(+), 16 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/gen7_sol_state.c
> b/src/mesa/drivers/dri/i965/gen7_sol_state.c
> index 7e9b285..3f99df9 100644
> --- a/src/mesa/drivers/dri/i965/gen7_sol_state.c
> +++ b/src/mesa/drivers/dri/i965/gen7_sol_state.c
> @@ -245,17 +245,17 @@ upload_3dstate_streamout(struct brw_context *brw,
> bool active,
> * point by reading less and offsetting the register index in the
> * SO_DECLs.
> */
> - dw2 |= urb_entry_read_offset <<
> SO_STREAM_0_VERTEX_READ_OFFSET_SHIFT;
> - dw2 |= (urb_entry_read_length - 1) <<
> SO_STREAM_0_VERTEX_READ_LENGTH_SHIFT;
> + dw2 |= SET_FIELD(urb_entry_read_offset,
> SO_STREAM_0_VERTEX_READ_OFFSET);
> + dw2 |= SET_FIELD(urb_entry_read_length - 1,
> SO_STREAM_0_VERTEX_READ_LENGTH);
>
> - dw2 |= urb_entry_read_offset <<
> SO_STREAM_1_VERTEX_READ_OFFSET_SHIFT;
> - dw2 |= (urb_entry_read_length - 1) <<
> SO_STREAM_1_VERTEX_READ_LENGTH_SHIFT;
> + dw2 |= SET_FIELD(urb_entry_read_offset,
> SO_STREAM_1_VERTEX_READ_OFFSET);
> + dw2 |= SET_FIELD(urb_entry_read_length - 1,
> SO_STREAM_1_VERTEX_READ_LENGTH);
>
> - dw2 |= urb_entry_read_offset <<
> SO_STREAM_2_VERTEX_READ_OFFSET_SHIFT;
> - dw2 |= (urb_entry_read_length - 1) <<
> SO_STREAM_2_VERTEX_READ_LENGTH_SHIFT;
> + dw2 |= SET_FIELD(urb_entry_read_offset,
> SO_STREAM_2_VERTEX_READ_OFFSET);
> + dw2 |= SET_FIELD(urb_entry_read_length - 1,
> SO_STREAM_2_VERTEX_READ_LENGTH);
>
> - dw2 |= urb_entry_read_offset <<
> SO_STREAM_3_VERTEX_READ_OFFSET_SHIFT;
> - dw2 |= (urb_entry_read_length - 1) <<
> SO_STREAM_3_VERTEX_READ_LENGTH_SHIFT;
> + dw2 |= SET_FIELD(urb_entry_read_offset,
> SO_STREAM_3_VERTEX_READ_OFFSET);
> + dw2 |= SET_FIELD(urb_entry_read_length - 1,
> SO_STREAM_3_VERTEX_READ_LENGTH);
> }
>
> BEGIN_BATCH(3);
> diff --git a/src/mesa/drivers/dri/i965/gen8_sol_state.c
> b/src/mesa/drivers/dri/i965/gen8_sol_state.c
> index d98a226..58ead68 100644
> --- a/src/mesa/drivers/dri/i965/gen8_sol_state.c
> +++ b/src/mesa/drivers/dri/i965/gen8_sol_state.c
> @@ -125,17 +125,17 @@ gen8_upload_3dstate_streamout(struct brw_context
> *brw, bool active,
> * point by reading less and offsetting the register index in the
> * SO_DECLs.
> */
> - dw2 |= urb_entry_read_offset <<
> SO_STREAM_0_VERTEX_READ_OFFSET_SHIFT;
> - dw2 |= (urb_entry_read_length - 1) <<
> SO_STREAM_0_VERTEX_READ_LENGTH_SHIFT;
> + dw2 |= SET_FIELD(urb_entry_read_offset,
> SO_STREAM_0_VERTEX_READ_OFFSET);
> + dw2 |= SET_FIELD(urb_entry_read_length - 1,
> SO_STREAM_0_VERTEX_READ_LENGTH);
>
> - dw2 |= urb_entry_read_offset <<
> SO_STREAM_1_VERTEX_READ_OFFSET_SHIFT;
> - dw2 |= (urb_entry_read_length - 1) <<
> SO_STREAM_1_VERTEX_READ_LENGTH_SHIFT;
> + dw2 |= SET_FIELD(urb_entry_read_offset,
> SO_STREAM_1_VERTEX_READ_OFFSET);
> + dw2 |= SET_FIELD(urb_entry_read_length - 1,
> SO_STREAM_1_VERTEX_READ_LENGTH);
>
> - dw2 |= urb_entry_read_offset <<
> SO_STREAM_2_VERTEX_READ_OFFSET_SHIFT;
> - dw2 |= (urb_entry_read_length - 1) <<
> SO_STREAM_2_VERTEX_READ_LENGTH_SHIFT;
> + dw2 |= SET_FIELD(urb_entry_read_offset,
> SO_STREAM_2_VERTEX_READ_OFFSET);
> + dw2 |= SET_FIELD(urb_entry_read_length - 1,
> SO_STREAM_2_VERTEX_READ_LENGTH);
>
> - dw2 |= urb_entry_read_offset <<
> SO_STREAM_3_VERTEX_READ_OFFSET_SHIFT;
> - dw2 |= (urb_entry_read_length - 1) <<
> SO_STREAM_3_VERTEX_READ_LENGTH_SHIFT;
> + dw2 |= SET_FIELD(urb_entry_read_offset,
> SO_STREAM_3_VERTEX_READ_OFFSET);
> + dw2 |= SET_FIELD(urb_entry_read_length - 1,
> SO_STREAM_3_VERTEX_READ_LENGTH);
>
> /* Set buffer pitches; 0 means unbound. */
> if (xfb_obj->Buffers[0])
> --
> 2.3.4
>
> Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150407/b399984c/attachment.html>
More information about the mesa-dev
mailing list