1. 05 Jun, 2023 3 commits
  2. 02 Jun, 2023 5 commits
    • Nathan Chancellor's avatar
      drm/i915/pxp: Fix size_t format specifier in gsccs_send_message() · 5c315434
      Nathan Chancellor authored
      When building ARCH=i386 allmodconfig, the following warning occurs:
      
        In file included from include/linux/device.h:15,
                         from include/linux/node.h:18,
                         from include/linux/cpu.h:17,
                         from include/linux/static_call.h:135,
                         from arch/x86/include/asm/perf_event.h:5,
                         from include/linux/perf_event.h:25,
                         from drivers/gpu/drm/i915/i915_pmu.h:11,
                         from drivers/gpu/drm/i915/gt/intel_engine_types.h:21,
                         from drivers/gpu/drm/i915/gt/intel_context_types.h:18,
                         from drivers/gpu/drm/i915/gem/i915_gem_context_types.h:20,
                         from drivers/gpu/drm/i915/i915_request.h:34,
                         from drivers/gpu/drm/i915/i915_active.h:13,
                         from drivers/gpu/drm/i915/gt/intel_context.h:13,
                         from drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c:8:
        drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c: In function 'gsccs_send_message':
        include/drm/drm_print.h:456:39: error: format '%ld' expects argument of type 'long int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
          456 |         dev_##level##type((drm)->dev, "[drm] " fmt, ##__VA_ARGS__)
              |                                       ^~~~~~~~
        include/linux/dev_printk.h:110:30: note: in definition of macro 'dev_printk_index_wrap'
          110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
              |                              ^~~
        include/linux/dev_printk.h:146:61: note: in expansion of macro 'dev_fmt'
          146 |         dev_printk_index_wrap(_dev_warn, KERN_WARNING, dev, dev_fmt(fmt), ##__VA_ARGS__)
              |                                                             ^~~~~~~
        include/drm/drm_print.h:456:9: note: in expansion of macro 'dev_warn'
          456 |         dev_##level##type((drm)->dev, "[drm] " fmt, ##__VA_ARGS__)
              |         ^~~~
        include/drm/drm_print.h:466:9: note: in expansion of macro '__drm_printk'
          466 |         __drm_printk((drm), warn,, fmt, ##__VA_ARGS__)
              |         ^~~~~~~~~~~~
        drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c:146:17: note: in expansion of macro 'drm_warn'
          146 |                 drm_warn(&i915->drm, "caller with insufficient PXP reply size %u (%ld)\n",
              |                 ^~~~~~~~
        cc1: all warnings being treated as errors
      
      Use the '%zu' format specifier, as the variable is a 'size_t'.
      
      Fixes: dc9ac125 ("drm/i915/pxp: Add GSC-CS backend to send GSC fw messages")
      Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
      Reviewed-by: default avatarAndi Shyti <andi.shyti@linux.intel.com>
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230530-i915-pxp-size_t-wformat-v1-1-9631081e2e5b@kernel.org
      5c315434
    • Andrzej Hajda's avatar
      4d4de1cb
    • Dave Airlie's avatar
      Merge tag 'drm-misc-next-2023-06-01' of git://anongit.freedesktop.org/drm/drm-misc into drm-next · 2e149283
      Dave Airlie authored
      drm-misc-next for v6.5:
      
      UAPI Changes:
      
      Cross-subsystem Changes:
      
       * fbdev:
         * Add Kconfig options and initializer macros for file I/O, convert
           DRM fbdev emulation
      
      Core Changes:
      
       * Unify handling of struct file_operations.show_fdinfo
      
       * Use .probe in all i2c code (interface cleanup)
      
       * TTM:
         * Remove unused code
      
      Driver Changes:
      
       * amdgpu:
         * Use shared show_fdinfo code
         * Fix building without procfs
      
       * bridge:
         * display-conenctor: Add support for external power supply
         * samsung-dsim: Fix enabling; Support variable clocking
         * tc358767: Fixes
         * ti-sn65dsi83: Fix enabling
      
       * msm:
         * Use shared show_fdinfo code
      
       * msxfb:
         * Add support for i.MX93 LCDIF
      
       * panel:
         * Add support for Ampire AM-800480L1TMQW-T00H plus DT bindings
         * panel-edp: Convert .remove to return void
      
       * stm:
         * dsi: Use devm_ helper
         * ltdc: Fix potential invalid pointer deref
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      
      From: Thomas Zimmermann <tzimmermann@suse.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230601112246.GA10882@linux-uq9g
      2e149283
    • Nathan Chancellor's avatar
      drm/i915/gt: Fix parameter in gmch_ggtt_insert_{entries, page}() · 1baeef6c
      Nathan Chancellor authored
      When building with clang's -Wincompatible-function-pointer-types-strict,
      the following warnings occur:
      
        drivers/gpu/drm/i915/gt/intel_ggtt_gmch.c:102:23: error: incompatible function pointer types assigning to 'void (*)(struct i915_address_space *, dma_addr_t, u64, unsigned int, u32)' (aka 'void (*)(struct i915_address_space *, unsigned int, unsigned long long, unsigned int, unsigned int)') from 'void (struct i915_address_space *, dma_addr_t, u64, enum i915_cache_level, u32)' (aka 'void (struct i915_address_space *, unsigned int, unsigned long long, enum i915_cache_level, unsigned int)') [-Werror,-Wincompatible-function-pointer-types-strict]
                ggtt->vm.insert_page = gmch_ggtt_insert_page;
                                     ^ ~~~~~~~~~~~~~~~~~~~~~
        drivers/gpu/drm/i915/gt/intel_ggtt_gmch.c:103:26: error: incompatible function pointer types assigning to 'void (*)(struct i915_address_space *, struct i915_vma_resource *, unsigned int, u32)' (aka 'void (*)(struct i915_address_space *, struct i915_vma_resource *, unsigned int, unsigned int)') from 'void (struct i915_address_space *, struct i915_vma_resource *, enum i915_cache_level, u32)' (aka 'void (struct i915_address_space *, struct i915_vma_resource *, enum i915_cache_level, unsigned int)') [-Werror, -Wincompatible-function-pointer-types-strict]
                ggtt->vm.insert_entries = gmch_ggtt_insert_entries;
                                        ^ ~~~~~~~~~~~~~~~~~~~~~~~~
        2 errors generated.
      
      The warning is pointing out that while 'enum i915_cache_level' and
      'unsigned int' are ABI compatible, these indirect calls will fail
      clang's kernel Control Flow Integrity (kCFI) checks, as the callback's
      signature does not exactly match the prototype's signature.
      
      To fix this, replace the cache_level parameter with pat_index, as was
      done in other places within i915 where there is no difference between
      cache_level and pat_index on certain generations.
      
      Fixes: 9275277d ("drm/i915: use pat_index instead of cache_level")
      Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
      Reviewed-by: default avatarAndi Shyti <andi.shyti@linux.intel.com>
      Reviewed-by: default avatarFei Yang <fei.yang@intel.com>
      Signed-off-by: default avatarAndi Shyti <andi.shyti@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230530-i915-gt-cache_level-wincompatible-function-pointer-types-strict-v1-2-54501d598229@kernel.org
      1baeef6c
    • Nathan Chancellor's avatar
      drm/i915/gt: Fix second parameter type of pre-gen8 pte_encode callbacks · 4722e2eb
      Nathan Chancellor authored
      When booting a kernel compiled with CONFIG_CFI_CLANG (kCFI), there is a
      CFI failure in ggtt_probe_common() when trying to call hsw_pte_encode()
      via an indirect call:
      
        [    5.030027] CFI failure at ggtt_probe_common+0xd1/0x130 [i915] (target: hsw_pte_encode+0x0/0x30 [i915]; expected type: 0xf5c1d0fc)
      
      With kCFI, indirect calls are validated against their expected type
      versus actual type and failures occur when the two types do not match.
      
      clang's -Wincompatible-function-pointer-types-strict can catch this at
      compile time but it is not enabled for the kernel yet:
      
        drivers/gpu/drm/i915/gt/intel_ggtt.c:1155:23: error: incompatible function pointer types assigning to 'u64 (*)(dma_addr_t, unsigned int, u32)' (aka 'unsigned long long (*)(unsigned int, unsigned int, unsigned int)') from 'u64 (dma_addr_t,
        enum i915_cache_level, u32)' (aka 'unsigned long long (unsigned int, enum i915_cache_level, unsigned int)') [-Werror,-Wincompatible-function-pointer-types-strict]
                        ggtt->vm.pte_encode = iris_pte_encode;
                                            ^ ~~~~~~~~~~~~~~~
        drivers/gpu/drm/i915/gt/intel_ggtt.c:1157:23: error: incompatible function pointer types assigning to 'u64 (*)(dma_addr_t, unsigned int, u32)' (aka 'unsigned long long (*)(unsigned int, unsigned int, unsigned int)') from 'u64 (dma_addr_t,
        enum i915_cache_level, u32)' (aka 'unsigned long long (unsigned int, enum i915_cache_level, unsigned int)') [-Werror,-Wincompatible-function-pointer-types-strict]
                        ggtt->vm.pte_encode = hsw_pte_encode;
                                            ^ ~~~~~~~~~~~~~~
        drivers/gpu/drm/i915/gt/intel_ggtt.c:1159:23: error: incompatible function pointer types assigning to 'u64 (*)(dma_addr_t, unsigned int, u32)' (aka 'unsigned long long (*)(unsigned int, unsigned int, unsigned int)') from 'u64 (dma_addr_t,
        enum i915_cache_level, u32)' (aka 'unsigned long long (unsigned int, enum i915_cache_level, unsigned int)') [-Werror,-Wincompatible-function-pointer-types-strict]
                        ggtt->vm.pte_encode = byt_pte_encode;
                                            ^ ~~~~~~~~~~~~~~
        drivers/gpu/drm/i915/gt/intel_ggtt.c:1161:23: error: incompatible function pointer types assigning to 'u64 (*)(dma_addr_t, unsigned int, u32)' (aka 'unsigned long long (*)(unsigned int, unsigned int, unsigned int)') from 'u64 (dma_addr_t,
        enum i915_cache_level, u32)' (aka 'unsigned long long (unsigned int, enum i915_cache_level, unsigned int)') [-Werror,-Wincompatible-function-pointer-types-strict]
                        ggtt->vm.pte_encode = ivb_pte_encode;
                                            ^ ~~~~~~~~~~~~~~
        drivers/gpu/drm/i915/gt/intel_ggtt.c:1163:23: error: incompatible function pointer types assigning to 'u64 (*)(dma_addr_t, unsigned int, u32)' (aka 'unsigned long long (*)(unsigned int, unsigned int, unsigned int)') from 'u64 (dma_addr_t,
        enum i915_cache_level, u32)' (aka 'unsigned long long (unsigned int, enum i915_cache_level, unsigned int)') [-Werror,-Wincompatible-function-pointer-types-strict]
                        ggtt->vm.pte_encode = snb_pte_encode;
                                            ^ ~~~~~~~~~~~~~~
        5 errors generated.
      
      In this case, the pre-gen8 pte_encode functions have a second parameter
      type of 'enum i915_cache_level' whereas the function pointer prototype
      in 'struct i915_address_space' expects a second parameter type of
      'unsigned int'.
      
      Update the second parameter of the callbacks and the comment above them
      noting that these statements are still valid, which matches other
      functions and files, to clear up the kCFI failures at run time.
      
      Fixes: 9275277d ("drm/i915: use pat_index instead of cache_level")
      Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
      Reviewed-by: default avatarAndi Shyti <andi.shyti@linux.intel.com>
      Reviewed-by: default avatarFei Yang <fei.yang@intel.com>
      Signed-off-by: default avatarAndi Shyti <andi.shyti@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230530-i915-gt-cache_level-wincompatible-function-pointer-types-strict-v1-1-54501d598229@kernel.org
      4722e2eb
  3. 01 Jun, 2023 16 commits
  4. 31 May, 2023 9 commits
  5. 30 May, 2023 6 commits
  6. 28 May, 2023 1 commit
    • Dave Airlie's avatar
      Merge tag 'drm-intel-gt-next-2023-05-24' of... · 85d712f0
      Dave Airlie authored
      Merge tag 'drm-intel-gt-next-2023-05-24' of git://anongit.freedesktop.org/drm/drm-intel into drm-next
      
      UAPI Changes:
      
      - New getparam for querying PXP support and load status
      
      Cross-subsystem Changes:
      
      - GSC/MEI proxy driver
      
      Driver Changes:
      
      Fixes/improvements/new stuff:
      
      - Avoid clearing pre-allocated framebuffers with the TTM backend (Nirmoy Das)
      - Implement framebuffer mmap support (Nirmoy Das)
      - Disable sampler indirect state in bindless heap (Lionel Landwerlin)
      - Avoid out-of-bounds access when loading HuC (Lucas De Marchi)
      - Actually return an error if GuC version range check fails (John Harrison)
      - Get mutex and rpm ref just once in hwm_power_max_write (Ashutosh Dixit)
      - Disable PL1 power limit when loading GuC firmware (Ashutosh Dixit)
      - Block in hwmon while waiting for GuC reset to complete (Ashutosh Dixit)
      - Provide sysfs for SLPC efficient freq (Vinay Belgaumkar)
      - Add support for total context runtime for GuC back-end (Umesh Nerlige Ramappa)
      - Enable fdinfo for GuC backends (Umesh Nerlige Ramappa)
      - Don't capture Gen8 regs on Xe devices (John Harrison)
      - Fix error capture for virtual engines (John Harrison)
      - Track patch level versions on reduced version firmware files (John Harrison)
      - Decode another GuC load failure case (John Harrison)
      - GuC loading and firmware table handling fixes (John Harrison)
      - Fix confused register capture list creation (John Harrison)
      - Dump error capture to kernel log (John Harrison)
      - Dump error capture to dmesg on CTB error (John Harrison)
      - Disable rps_boost debugfs when SLPC is used (Vinay Belgaumkar)
      
      Future platform enablement:
      
      - Disable stolen memory backed FB for A0 [mtl] (Nirmoy Das)
      - Various refactors for multi-tile enablement (Andi Shyti, Tejas Upadhyay)
      - Extend Wa_22011802037 to MTL A-step (Madhumitha Tolakanahalli Pradeep)
      - WA to clear RDOP clock gating [mtl] (Haridhar Kalvala)
      - Set has_llc=0 [mtl] (Fei Yang)
      - Define MOCS and PAT tables for MTL (Madhumitha Tolakanahalli Pradeep)
      - Add PTE encode function [mtl] (Fei Yang)
      - fix mocs selftest [mtl] (Fei Yang)
      - Workaround coherency issue for Media [mtl] (Fei Yang)
      - Add workaround 14018778641 [mtl] (Tejas Upadhyay)
      - Implement Wa_14019141245 [mtl] (Radhakrishna Sripada)
      - Fix the wa number for Wa_22016670082 [mtl] (Radhakrishna Sripada)
      - Use correct huge page manager for MTL (Jonathan Cavitt)
      - GSC/MEI support for Meteorlake (Alexander Usyskin, Daniele Ceraolo Spurio)
      - Define GuC firmware version for MTL (John Harrison)
      - Drop FLAT CCS check [mtl] (Pallavi Mishra)
      - Add MTL for remapping CCS FBs [mtl] (Clint Taylor)
      - Meteorlake PXP enablement (Alan Previn)
      - Do not enable render power-gating on MTL (Andrzej Hajda)
      - Add MTL performance tuning changes (Radhakrishna Sripada)
      - Extend Wa_16014892111 to MTL A-step (Radhakrishna Sripada)
      - PMU multi-tile support (Tvrtko Ursulin)
      - End support for set caching ioctl [mtl] (Fei Yang)
      
      Driver refactors:
      
      - Use i915 instead of dev_priv insied the file_priv structure (Andi Shyti)
      - Use proper parameter naming in for_each_engine() (Andi Shyti)
      - Use gt_err for GT info (Tejas Upadhyay)
      - Consolidate duplicated capture list code (John Harrison)
      - Capture list naming clean up (John Harrison)
      - Use kernel-doc -Werror when CONFIG_DRM_I915_WERROR=y (Jani Nikula)
      - Preparation for using PAT index (Fei Yang)
      - Use pat_index instead of cache_level (Fei Yang)
      
      Miscellaneous:
      
      - Fix memory leaks in i915 selftests (Cong Liu)
      - Record GT error for gt failure (Tejas Upadhyay)
      - Migrate platform-dependent mock hugepage selftests to live (Jonathan Cavitt)
      - Update the SLPC selftest (Vinay Belgaumkar)
      - Throw out set() wrapper (Jani Nikula)
      - Large driver kernel doc cleanup (Jani Nikula)
      - Fix probe injection CI failures after recent change (John Harrison)
      - Make unexpected firmware versions an error in debug builds (John Harrison)
      - Silence UBSAN uninitialized bool variable warning (Ashutosh Dixit)
      - Fix memory leaks in function live_nop_switch (Cong Liu)
      
      Merges:
      
      - Merge drm/drm-next into drm-intel-gt-next (Joonas Lahtinen)
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      
      # Conflicts:
      #	drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c
      From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/ZG5SxCWRSkZhTDtY@tursulin-desk
      85d712f0