[Mesa-stable] [Mesa-dev] [PATCH 4/4] anv/blorp: Flush the texture cache in UpdateBuffer

Andres Gomez agomez at igalia.com
Mon Apr 24 23:45:56 UTC 2017


Hi, Lionel, Jason,

On Wed, 2017-04-12 at 14:30 -0700, Lionel Landwerlin wrote:
> On 12/04/17 12:57, Jason Ekstrand wrote:
> > On Wed, Apr 12, 2017 at 12:25 PM, Lionel Landwerlin <lionel.g.landwerlin at intel.com> wrote:
> > > On 31/03/17 16:17, Jason Ekstrand wrote:
> > > > Cc: "13.0 17.0" <mesa-stable at lists.freedesktop.org>
> > > > ---
> > > >   src/intel/vulkan/anv_blorp.c | 5 +++++
> > > >   1 file changed, 5 insertions(+)
> > > > 
> > > > diff --git a/src/intel/vulkan/anv_blorp.c b/src/intel/vulkan/anv_blorp.c
> > > > index 72a468a..f26f5e5 100644
> > > > --- a/src/intel/vulkan/anv_blorp.c
> > > > +++ b/src/intel/vulkan/anv_blorp.c
> > > > @@ -690,6 +690,11 @@ void anv_CmdUpdateBuffer(
> > > >        assert(max_update_size < MAX_SURFACE_DIM * 4);
> > > >   +   /* We're about to read data that was written from the CPU.  Flush the
> > > > 
> > >  Did you mean GPU?
> > > 
> > 
> > No, I mean CPU.  We copy the data provided by the user into a chunk of the dynamic state pool and then use blorp to copy it to the buffer specified by the user.
>  
> Right, for some reason the phrasing got me confused :/
> 
> >  
> > > > +    * texture cache so we don't get anything stale.
> > > > +    */
> > > > +   cmd_buffer->state.pending_pipe_bits |= ANV_PIPE_TEXTURE_CACHE_INVALIDATE_BIT;
> > > > 
> > >  
> > > Why just the texture cache? Should we add data cache + render target?
> > > 
> > 
> > Because we're not writing from the GPU and we're not using image load store.
>  
> Thanks, I should have read the do_buffer_copy()...
> 
> I think we might need a anv_state_flush() on tmp_data.

This patch landed in master with the suggested:

"
...
anv_state_flush(cmd_buffer->device, tmp_data);
...
"

Unfortunately, anv_state_flush is not in the stable branch in its
current shape.

It should be possible to replace just with the previous form:

"
...
if (!cmd_buffer->device->info.has_llc)
   anv_state_clflush(tmp_data);
...
"

Is that OK with you?

-- 
Br,

Andres


More information about the mesa-stable mailing list