1. 30 Jun, 2022 4 commits
    • Jani Nikula's avatar
      drm/edid: move drm_connector_update_edid_property() to drm_edid.c · 02b16fbc
      Jani Nikula authored
      The function needs access to drm_edid.c internals more than
      drm_connector.c. We can make drm_reset_display_info(),
      drm_add_display_info() and drm_update_tile_info() static. There will be
      more benefits with follow-up struct drm_edid refactoring.
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/cbabce6ffb41fdc903533f21d946e8cae0667be5.1656494768.git.jani.nikula@intel.com
      02b16fbc
    • Tom Rix's avatar
      drm/vc4: change vc4_dma_range_matches from a global to static · 63569d90
      Tom Rix authored
      sparse reports
      drivers/gpu/drm/vc4/vc4_drv.c:270:27: warning: symbol 'vc4_dma_range_matches' was not declared. Should it be static?
      
      vc4_dma_range_matches is only used in vc4_drv.c, so it's storage class specifier
      should be static.
      
      Fixes: da8e393e ("drm/vc4: drv: Adopt the dma configuration from the HVS or V3D component")
      Signed-off-by: default avatarTom Rix <trix@redhat.com>
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://patchwork.freedesktop.org/patch/msgid/20220629200101.498138-1-trix@redhat.com
      63569d90
    • Lucas De Marchi's avatar
      iosys-map: Add per-word write · 6fb5ee7c
      Lucas De Marchi authored
      Like was done for read, provide the equivalent for write. Even if
      current users are not in the hot path, this should future-proof it.
      
      v2:
        - Remove default from _Generic() - callers wanting to write more
          than u64 should use iosys_map_memcpy_to()
        - Add WRITE_ONCE() cases dereferencing the pointer when using system
          memory
      v3:
        - Fix precedence issue when casting inside WRITE_ONCE(). By not using ()
          around vaddr__ the offset was not part of the cast, but rather added
          to it, producing a wrong address
        - Remove compiletime_assert() as WRITE_ONCE() already contains it
      Signed-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
      Reviewed-by: Reviewed-by: Christian König <christian.koenig@amd.com> # v1
      Reviewed-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/20220628191016.3899428-2-lucas.demarchi@intel.com
      6fb5ee7c
    • Lucas De Marchi's avatar
      iosys-map: Add per-word read · 5f278dbd
      Lucas De Marchi authored
      Instead of always falling back to memcpy_fromio() for any size, prefer
      using read{b,w,l}(). When reading struct members it's common to read
      individual integer variables individually. Going through memcpy_fromio()
      for each of them poses a high penalty.
      
      Employ a similar trick as __seqprop() by using _Generic() to generate
      only the specific call based on a type-compatible variable.
      
      For a pariticular i915 workload producing GPU context switches,
      __get_engine_usage_record() is particularly hot since the engine usage
      is read from device local memory with dgfx, possibly multiple times
      since it's racy. Test execution time for this test shows a ~12.5%
      improvement with DG2:
      
      Before:
      	nrepeats = 1000; min = 7.63243e+06; max = 1.01817e+07;
      	median = 9.52548e+06; var = 526149;
      After:
      	nrepeats = 1000; min = 7.03402e+06; max = 8.8832e+06;
      	median = 8.33955e+06; var = 333113;
      
      Other things attempted that didn't prove very useful:
      1) Change the _Generic() on x86 to just dereference the memory address
      2) Change __get_engine_usage_record() to do just 1 read per loop,
         comparing with the previous value read
      3) Change __get_engine_usage_record() to access the fields directly as it
         was before the conversion to iosys-map
      
      (3) did gave a small improvement (~3%), but doesn't seem to scale well
      to other similar cases in the driver.
      
      Additional test by Chris Wilson using gem_create from igt with some
      changes to track object creation time. This happens to accidentally
      stress this code path:
      
      	Pre iosys_map conversion of engine busyness:
      	lmem0: Creating    262144 4KiB objects took 59274.2ms
      
      	Unpatched:
      	lmem0: Creating    262144 4KiB objects took 108830.2ms
      
      	With readl (this patch):
      	lmem0: Creating    262144 4KiB objects took 61348.6ms
      
      	s/readl/READ_ONCE/
      	lmem0: Creating    262144 4KiB objects took 61333.2ms
      
      So we do take a little bit more time than before the conversion, but
      that is due to other factors: bringing the READ_ONCE back would be as
      good as just doing this conversion.
      
      v2:
        - Remove default from _Generic() - callers wanting to read more
          than u64 should use iosys_map_memcpy_from()
        - Add READ_ONCE() cases dereferencing the pointer when using system
          memory
      v3:
        - Fix precedence issue when casting inside READ_ONCE(). By not using ()
          around vaddr__ the offset was not part of the cast, but rather added
          to it, producing a wrong address
        - Remove compiletime_assert() as READ_ONCE() already contains it
      Signed-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
      Reviewed-by: Christian König <christian.koenig@amd.com> # v1
      Reviewed-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/20220628191016.3899428-1-lucas.demarchi@intel.com
      5f278dbd
  2. 28 Jun, 2022 36 commits