1. 05 Sep, 2018 1 commit
    • Rodrigo Siqueira's avatar
      intel_reg: Fix truncate string in the snprintf · c3b6d69a
      Rodrigo Siqueira authored
      This patch fix the following GCC warning:
      
      ../tools/intel_reg.c: In function ‘dump_decode’:
      ../tools/intel_reg.c:203:41: warning: ‘snprintf’ output may be truncated
      before the last format character [-Wformat-truncation=]
         snprintf(decode, sizeof(decode), "\n%s", bin);
      [..]
      ../tools/intel_reg.c:200:40: warning: ‘%s’ directive output may be
      truncated writing up to 1023 bytes into a region of size 1022
      [-Wformat-truncation=]
          snprintf(decode, sizeof(decode), " (%s)\n%s", tmp, bin);
      [..]
      ../tools/intel_reg.c:200:4: note: ‘snprintf’ output between 5 and 2051
      bytes into a destination of size 1024
          snprintf(decode, sizeof(decode), " (%s)\n%s", tmp, bin);
      [..]
      
      The decode[] variable contains concatenated contents of bin[] and tmp[],
      both of which are allocated as 1024 bytes.
      
      Allocating 1024 chars for bin[] seems like an overkill, since all it
      ever holds it the output of to_binary().
      
      to_binary outputs fixed format:
      --------------------------------------------------------------------
                     24               16                8                0
        1 1 0 1 1 1 1 0  1 0 1 0 1 1 0 1  1 0 1 1 1 1 1 0  1 1 1 0 1 1 1 1
      --------------------------------------------------------------------
      Which is 138 chars long (sans the new line).
      
      We can limit the size of char bin[] to that number (-ish), and then
      slightly bump the size of decode[] to accommodate for combined sizes of
      tmp[] and bin[].
      
      Changes since V1:
       - Improve commit message
      Changes since V2:
       - updated commit message
       - limit the amount of stack abuse
      Signed-off-by: Rodrigo Siqueira's avatarRodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
      Signed-off-by: Arkadiusz Hiler's avatarArkadiusz Hiler <arkadiusz.hiler@intel.com>
      Reviewed-by: Rodrigo Siqueira's avatarRodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
      c3b6d69a
  2. 31 Jan, 2018 1 commit
    • Mika Kuoppala's avatar
      tools/intel_reg: Add reading and writing registers through engine · 7f0be0e7
      Mika Kuoppala authored
      Add option to specify engine for register read/write operation.
      If engine is specified, use MI_LOAD_REGISTER_IMM and MI_STORE_REGISTER_IMM
      to write and read register using a batch targeted at that engine.
      
      v2: no MI_NOOP after BBE (Chris)
      v3: use modern engine names (Chris), use global fd
      v4: strcasecmp (Chris)
      v5: use register definition format for engine (Jani)
      
      Cc: Jani Nikula <jani.nikula@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      CC: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Signed-off-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
      Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> (v4)
      Acked-by: Jani Nikula's avatarJani Nikula <jani.nikula@intel.com>
      7f0be0e7
  3. 21 Nov, 2017 1 commit
  4. 15 Sep, 2017 1 commit
  5. 04 May, 2017 1 commit
  6. 21 Mar, 2017 3 commits
  7. 07 Oct, 2016 1 commit
  8. 27 Jul, 2016 1 commit
  9. 30 Jun, 2016 1 commit
    • Chris Wilson's avatar
      lib: Start weaning off defunct intel_chipset.h · d308bb08
      Chris Wilson authored
      Several years ago we made the plan of only having one canonical source
      for i915_pciids.h, the kernel and everyone importing their definitions
      from that. For consistency, we style the intel_device_info after the
      kernel, most notably using a generation mask and a per-codename bitfield.
      
      This first step converts looking up the generation for a devid tree from
      a massive if(devid)-chain to a (cached) table lookup.
      Signed-off-by: Chris Wilson's avatarChris Wilson <chris@chris-wilson.co.uk>
      d308bb08
  10. 02 May, 2016 1 commit
  11. 11 Sep, 2015 1 commit
  12. 08 Sep, 2015 4 commits
  13. 20 Jul, 2015 1 commit
  14. 05 May, 2015 2 commits
  15. 22 Apr, 2015 1 commit
    • Jani Nikula's avatar
      intel_reg: introduce one intel_reg tool to rule them all · dfda0b6a
      Jani Nikula authored
      	Three Tools for the Elven-kings under the sky,
      	Seven for the Dwarf-lords in their halls of stone,
      	Nine for Mortal Men doomed to die,
      	One for the Dark Lord on his dark throne
      	In the Land of Mordor where the Shadows lie.
      	One Tool to rule them all, One Tool to find them,
      	One Tool to bring them all and in the darkness bind them
      	In the Land of Mordor where the Shadows lie.
      
      		J.R.R. Tolkien's epigraph to The Lord of The Tools
      		 | sed 's/Ring/Tool/g'
      
      Introduce intel_reg as the one Intel graphics register multitool to
      replace intel_reg_read, intel_reg_write, intel_iosf_sb_read,
      intel_iosf_sb_write, intel_vga_read, intel_vga_write, intel_reg_dumper,
      intel_reg_snapshot, and quick_dump.py.
      Signed-off-by: Jani Nikula's avatarJani Nikula <jani.nikula@intel.com>
      dfda0b6a