[Mesa-dev] [PATCH v2 2/2] i965, anv: Use INTEL_DEBUG for disk_cache driver flags

Jordan Justen jordan.l.justen at intel.com
Mon Jul 23 17:00:07 UTC 2018


On 2018-07-23 03:29:21, Eero Tamminen wrote:
> Hi,
> 
> Should this fix also:
>         https://bugs.freedesktop.org/show_bug.cgi?id=106382
> ?
> 

It helped a bit. For me, on a simple test program, it allowed shader
time to work once, even when the cache had a non-shader-time program.
But, running wit shader-time a second time, it printed 'No shader time
collected yet'.

Without this patch, the test program would crash if the cache had a
non-shader-time program, and this patch prevented that.

Regarding the bisect info in that bug, if you happen to run with
INTEL_DEBUG=shader_time first after a fresh build, then shader time
would probably work, since it would generate the shader time program
and put it in the cache. So, the bisect info could be unreliable.

I'll take at what is happening on the '2nd shader-time run' issue that
I described above.

-Jordan

> 
> On 23.07.2018 07:27, Jordan Justen wrote:
> > Since various options within INTEL_DEBUG could impact code generation,
> > we need to set the disk cache driver_flags parameter based on the
> > INTEL_DEBUG flags in use.
> > 
> > An example that will affect the program generated by i965 is the
> > INTEL_DEBUG=nocompact option.
> > 
> > The DEBUG_DISK_CACHE_MASK value is added to mask the settings of
> > INTEL_DEBUG that can affect program generation.
> > 
> > v2:
> >   * Use driver_flags (Tim)
> >   * Also update Anvil (Jason)
> > 
> > Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
> > Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com> (v1)
> > ---
> >   src/intel/common/gen_debug.h               | 5 +++++
> >   src/intel/vulkan/anv_device.c              | 3 ++-
> >   src/mesa/drivers/dri/i965/brw_disk_cache.c | 3 ++-
> >   3 files changed, 9 insertions(+), 2 deletions(-)
> > 
> > diff --git a/src/intel/common/gen_debug.h b/src/intel/common/gen_debug.h
> > index f6c44eeb912..aa9f3cf80d7 100644
> > --- a/src/intel/common/gen_debug.h
> > +++ b/src/intel/common/gen_debug.h
> > @@ -84,6 +84,11 @@ extern uint64_t INTEL_DEBUG;
> >   #define DEBUG_COLOR               (1ull << 40)
> >   #define DEBUG_REEMIT              (1ull << 41)
> >   
> > +/* These flags may affect program generation */
> > +#define DEBUG_DISK_CACHE_MASK \
> > +   (DEBUG_SHADER_TIME | DEBUG_NO16 | DEBUG_NO_DUAL_OBJECT_GS | DEBUG_NO8 | \
> > +   DEBUG_SPILL_FS | DEBUG_SPILL_VEC4 | DEBUG_NO_COMPACTION | DEBUG_DO32)
> > +
> >   #ifdef HAVE_ANDROID_PLATFORM
> >   #define LOG_TAG "INTEL-MESA"
> >   #if ANDROID_API_LEVEL >= 26
> > diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
> > index 247ba641336..97a71563b8a 100644
> > --- a/src/intel/vulkan/anv_device.c
> > +++ b/src/intel/vulkan/anv_device.c
> > @@ -286,7 +286,8 @@ anv_physical_device_init_disk_cache(struct anv_physical_device *device)
> >      char timestamp[41];
> >      _mesa_sha1_format(timestamp, device->driver_build_sha1);
> >   
> > -   device->disk_cache = disk_cache_create(renderer, timestamp, 0);
> > +   const uint64_t driver_flags = INTEL_DEBUG & DEBUG_DISK_CACHE_MASK;
> > +   device->disk_cache = disk_cache_create(renderer, timestamp, driver_flags);
> >   #else
> >      device->disk_cache = NULL;
> >   #endif
> > diff --git a/src/mesa/drivers/dri/i965/brw_disk_cache.c b/src/mesa/drivers/dri/i965/brw_disk_cache.c
> > index a678c355b9d..8f1b064fd61 100644
> > --- a/src/mesa/drivers/dri/i965/brw_disk_cache.c
> > +++ b/src/mesa/drivers/dri/i965/brw_disk_cache.c
> > @@ -393,6 +393,7 @@ brw_disk_cache_init(struct intel_screen *screen)
> >      char timestamp[41];
> >      _mesa_sha1_format(timestamp, id_sha1);
> >   
> > -   screen->disk_cache = disk_cache_create(renderer, timestamp, 0);
> > +   const uint64_t driver_flags = INTEL_DEBUG & DEBUG_DISK_CACHE_MASK;
> > +   screen->disk_cache = disk_cache_create(renderer, timestamp, driver_flags);
> >   #endif
> >   }
> > 
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list