[Mesa-dev] [PATCH 1/9] i965/eu: Take into account the target cache argument in brw_set_dp_read_message.
Iago Toral
itoral at igalia.com
Fri Jul 29 08:07:49 UTC 2016
Reviewed-by: Iago Toral Quiroga <itoral at igalia.com>
On Thu, 2016-07-28 at 14:50 -0700, Francisco Jerez wrote:
> brw_set_dp_read_message() was setting the data cache as send message
> SFID on Gen7+ hardware, ignoring the target cache specified by the
> caller. Some of the callers were passing a bogus target cache value
> as argument relying on brw_set_dp_read_message not to take it into
> account. Fix them too.
> ---
> src/mesa/drivers/dri/i965/brw_eu_emit.c | 15 +++++++++++++-
> -
> src/mesa/drivers/dri/i965/brw_vec4_generator.cpp | 7 +++++--
> 2 files changed, 18 insertions(+), 4 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c
> b/src/mesa/drivers/dri/i965/brw_eu_emit.c
> index fc187d1..8850173 100644
> --- a/src/mesa/drivers/dri/i965/brw_eu_emit.c
> +++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c
> @@ -756,7 +756,15 @@ brw_set_dp_read_message(struct brw_codegen *p,
> unsigned sfid;
>
> if (devinfo->gen >= 7) {
> - sfid = GEN7_SFID_DATAPORT_DATA_CACHE;
> + if (target_cache == BRW_DATAPORT_READ_TARGET_RENDER_CACHE)
> + sfid = GEN6_SFID_DATAPORT_RENDER_CACHE;
> + else if (target_cache == BRW_DATAPORT_READ_TARGET_DATA_CACHE)
> + sfid = GEN7_SFID_DATAPORT_DATA_CACHE;
> + else if (target_cache ==
> BRW_DATAPORT_READ_TARGET_SAMPLER_CACHE)
> + sfid = GEN6_SFID_DATAPORT_SAMPLER_CACHE;
> + else
> + unreachable("Invalid target cache");
> +
> } else if (devinfo->gen == 6) {
> if (target_cache == BRW_DATAPORT_READ_TARGET_RENDER_CACHE)
> sfid = GEN6_SFID_DATAPORT_RENDER_CACHE;
> @@ -2204,6 +2212,9 @@ brw_oword_block_read_scratch(struct brw_codegen
> *p,
> num_regs == 2 ? BRW_DATAPORT_OWORD_BLOCK_4_OWORDS :
> num_regs == 4 ? BRW_DATAPORT_OWORD_BLOCK_8_OWORDS : 0);
> assert(msg_control);
> + const unsigned target_cache = devinfo->gen >= 7 ?
> + BRW_DATAPORT_READ_TARGET_DATA_CACHE :
> + BRW_DATAPORT_READ_TARGET_RENDER_CACHE;
>
> {
> brw_push_insn_state(p);
> @@ -2238,7 +2249,7 @@ brw_oword_block_read_scratch(struct brw_codegen
> *p,
> brw_scratch_surface_idx(p),
> msg_control,
> BRW_DATAPORT_READ_MESSAGE_OWORD_BLOCK_
> READ, /* msg_type */
> - BRW_DATAPORT_READ_TARGET_RENDER_CACHE,
> + target_cache,
> 1, /* msg_length */
> true, /* header_present */
> rlen);
> diff --git a/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
> b/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
> index 7ad4f86..27d4f7b 100644
> --- a/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
> @@ -1140,6 +1140,10 @@ generate_scratch_read(struct brw_codegen *p,
> else
> msg_type = BRW_DATAPORT_READ_MESSAGE_OWORD_DUAL_BLOCK_READ;
>
> + const unsigned target_cache = devinfo->gen >= 7 ?
> + BRW_DATAPORT_READ_TARGET_DATA_CACHE :
> + BRW_DATAPORT_READ_TARGET_RENDER_CACHE;
> +
> /* Each of the 8 channel enables is considered for whether each
> * dword is written.
> */
> @@ -1151,8 +1155,7 @@ generate_scratch_read(struct brw_codegen *p,
> brw_set_dp_read_message(p, send,
> brw_scratch_surface_idx(p),
> BRW_DATAPORT_OWORD_DUAL_BLOCK_1OWORD,
> - msg_type,
> - BRW_DATAPORT_READ_TARGET_RENDER_CACHE,
> + msg_type, target_cache,
> 2, /* mlen */
> true, /* header_present */
> 1 /* rlen */);
More information about the mesa-dev
mailing list