1. 08 7月, 2021 1 次提交
  2. 25 6月, 2021 3 次提交
  3. 24 6月, 2021 1 次提交
    • L
      drm/i915: keep backlight_enable on until turn eDP display off · cdad3921
      Lee Shawn C 提交于
      This workaround is specific for a particular panel on Google
      chromebook project. When user space daemon enter idle state.
      It request adjust brightness to 0, turn backlight_enable signal
      off and keep eDP main link active.
      
      On general LCD, this behavior might not be a problem.
      But on this panel, its tcon would expect source to execute
      full eDP power off sequence after drop backlight_enable signal.
      Without eDP power off sequence. Even source try to turn
      backlight_enable signal on and restore proper brightness level.
      This panel is not able to light on again.
      
      This WA ignored the request from user space daemon to disable
      backlight_enable signal and keep it on always. When user space
      request kernel to turn eDP display off, kernel driver still
      can control backlight_enable signal properly. It would not
      impact standard eDP power off sequence.
      
      v2: 1. modify the quirk name and debug messages.
          2. unregister backlight.power callback for specific device.
      v3: 1. modify debug output messages.
          2. use DMI_EXACT_MATCH instead of DMI_MATCH.
      
      Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Cooper Chiou <cooper.chiou@intel.com>
      Signed-off-by: NLee Shawn C <shawn.c.lee@intel.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210624053932.21037-1-shawn.c.lee@intel.com
      cdad3921
  4. 07 6月, 2021 1 次提交
  5. 03 6月, 2021 1 次提交
  6. 02 6月, 2021 3 次提交
    • T
      drm/i915/ttm Initialize the ttm device and memory managers · d1487389
      Thomas Hellström 提交于
      Temporarily remove the buddy allocator and related selftests
      and hook up the TTM range manager for i915 regions.
      
      Also modify the mock region selftests somewhat to account for a
      fragmenting manager.
      Signed-off-by: NThomas Hellström <thomas.hellstrom@linux.intel.com>
      Reviewed-by: NMatthew Auld <matthew.auld@intel.com>
      Signed-off-by: NMatthew Auld <matthew.auld@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210602083818.241793-2-thomas.hellstrom@linux.intel.com
      d1487389
    • M
      Revert "i915: use io_mapping_map_user" · b87482df
      Matthew Auld 提交于
      This reverts commit b739f125.
      
      We are unfortunately seeing more issues like we did in 293837b9
      ("Revert "i915: fix remap_io_sg to verify the pgprot""), except this is
      now for the vm_fault_gtt path, where we are now hitting the same
      BUG_ON(!pte_none(*pte)):
      
      [10887.466150] kernel BUG at mm/memory.c:2183!
      [10887.466162] invalid opcode: 0000 [#1] PREEMPT SMP PTI
      [10887.466168] CPU: 0 PID: 7775 Comm: ffmpeg Tainted: G     U            5.13.0-rc3-CI-Nightly #1
      [10887.466174] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./J4205-ITX, BIOS P1.40 07/14/2017
      [10887.466177] RIP: 0010:remap_pfn_range_notrack+0x30f/0x440
      [10887.466188] Code: e8 96 d7 e0 ff 84 c0 0f 84 27 01 00 00 48 ba 00 f0 ff ff ff ff 0f 00 4c 89 e0 48 c1 e0 0c 4d 85 ed 75 96 48 21 d0 31 f6 eb a9 <0f> 0b 48 39 37 0f 85 0e 01 00 00 48 8b 0c 24 48 39 4f 08 0f 85 00
      [10887.466193] RSP: 0018:ffffc90006e33c50 EFLAGS: 00010286
      [10887.466198] RAX: 800000000000002f RBX: 00007f5e01800000 RCX: 0000000000000028
      [10887.466201] RDX: 0000000000000001 RSI: ffffea0000000000 RDI: 0000000000000000
      [10887.466204] RBP: ffffea000033fea8 R08: 800000000000002f R09: ffff8881072256e0
      [10887.466207] R10: ffffc9000b84fff8 R11: 0000000017dab000 R12: 0000000000089f9f
      [10887.466210] R13: 800000000000002f R14: 00007f5e017e4000 R15: ffff88800cffaf20
      [10887.466213] FS:  00007f5e04849640(0000) GS:ffff888278000000(0000) knlGS:0000000000000000
      [10887.466216] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [10887.466220] CR2: 00007fd9b191a2ac CR3: 00000001829ac000 CR4: 00000000003506f0
      [10887.466223] Call Trace:
      [10887.466233]  vm_fault_gtt+0x1ca/0x5d0 [i915]
      [10887.466381]  ? ktime_get+0x38/0x90
      [10887.466389]  __do_fault+0x37/0x90
      [10887.466395]  __handle_mm_fault+0xc46/0x1200
      [10887.466402]  handle_mm_fault+0xce/0x2a0
      [10887.466407]  do_user_addr_fault+0x1c5/0x660
      
      Reverting this commit is reported to fix the issue.
      Reported-by: NEero Tamminen <eero.t.tamminen@intel.com>
      References: https://gitlab.freedesktop.org/drm/intel/-/issues/3519
      Fixes: b739f125 ("i915: use io_mapping_map_user")
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NMatthew Auld <matthew.auld@intel.com>
      Acked-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210527185145.458021-1-matthew.auld@intel.com
      (cherry picked from commit 0e4fe0c9)
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      b87482df
    • M
      Revert "i915: use io_mapping_map_user" · 0e4fe0c9
      Matthew Auld 提交于
      This reverts commit b739f125.
      
      We are unfortunately seeing more issues like we did in 293837b9
      ("Revert "i915: fix remap_io_sg to verify the pgprot""), except this is
      now for the vm_fault_gtt path, where we are now hitting the same
      BUG_ON(!pte_none(*pte)):
      
      [10887.466150] kernel BUG at mm/memory.c:2183!
      [10887.466162] invalid opcode: 0000 [#1] PREEMPT SMP PTI
      [10887.466168] CPU: 0 PID: 7775 Comm: ffmpeg Tainted: G     U            5.13.0-rc3-CI-Nightly #1
      [10887.466174] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./J4205-ITX, BIOS P1.40 07/14/2017
      [10887.466177] RIP: 0010:remap_pfn_range_notrack+0x30f/0x440
      [10887.466188] Code: e8 96 d7 e0 ff 84 c0 0f 84 27 01 00 00 48 ba 00 f0 ff ff ff ff 0f 00 4c 89 e0 48 c1 e0 0c 4d 85 ed 75 96 48 21 d0 31 f6 eb a9 <0f> 0b 48 39 37 0f 85 0e 01 00 00 48 8b 0c 24 48 39 4f 08 0f 85 00
      [10887.466193] RSP: 0018:ffffc90006e33c50 EFLAGS: 00010286
      [10887.466198] RAX: 800000000000002f RBX: 00007f5e01800000 RCX: 0000000000000028
      [10887.466201] RDX: 0000000000000001 RSI: ffffea0000000000 RDI: 0000000000000000
      [10887.466204] RBP: ffffea000033fea8 R08: 800000000000002f R09: ffff8881072256e0
      [10887.466207] R10: ffffc9000b84fff8 R11: 0000000017dab000 R12: 0000000000089f9f
      [10887.466210] R13: 800000000000002f R14: 00007f5e017e4000 R15: ffff88800cffaf20
      [10887.466213] FS:  00007f5e04849640(0000) GS:ffff888278000000(0000) knlGS:0000000000000000
      [10887.466216] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [10887.466220] CR2: 00007fd9b191a2ac CR3: 00000001829ac000 CR4: 00000000003506f0
      [10887.466223] Call Trace:
      [10887.466233]  vm_fault_gtt+0x1ca/0x5d0 [i915]
      [10887.466381]  ? ktime_get+0x38/0x90
      [10887.466389]  __do_fault+0x37/0x90
      [10887.466395]  __handle_mm_fault+0xc46/0x1200
      [10887.466402]  handle_mm_fault+0xce/0x2a0
      [10887.466407]  do_user_addr_fault+0x1c5/0x660
      
      Reverting this commit is reported to fix the issue.
      Reported-by: NEero Tamminen <eero.t.tamminen@intel.com>
      References: https://gitlab.freedesktop.org/drm/intel/-/issues/3519
      Fixes: b739f125 ("i915: use io_mapping_map_user")
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NMatthew Auld <matthew.auld@intel.com>
      Acked-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210527185145.458021-1-matthew.auld@intel.com
      0e4fe0c9
  7. 26 5月, 2021 1 次提交
  8. 20 5月, 2021 3 次提交
  9. 18 5月, 2021 1 次提交
  10. 15 5月, 2021 1 次提交
  11. 07 5月, 2021 1 次提交
  12. 01 5月, 2021 1 次提交
  13. 29 4月, 2021 1 次提交
    • M
      drm/i915: Use trylock in shrinker for ggtt on bsw vt-d and bxt, v2. · bc6f80cc
      Maarten Lankhorst 提交于
      The stop_machine() lock may allocate memory, but is called inside
      vm->mutex, which is taken in the shrinker. This will cause a lockdep
      splat, as can be seen below:
      
      <4>[  462.585762] ======================================================
      <4>[  462.585768] WARNING: possible circular locking dependency detected
      <4>[  462.585773] 5.12.0-rc5-CI-Trybot_7644+ #1 Tainted: G     U
      <4>[  462.585779] ------------------------------------------------------
      <4>[  462.585783] i915_selftest/5540 is trying to acquire lock:
      <4>[  462.585788] ffffffff826440b0 (cpu_hotplug_lock){++++}-{0:0}, at: stop_machine+0x12/0x30
      <4>[  462.585814]
                        but task is already holding lock:
      <4>[  462.585818] ffff888125369c70 (&vm->mutex/1){+.+.}-{3:3}, at: i915_vma_pin_ww+0x38e/0xb40 [i915]
      <4>[  462.586301]
                        which lock already depends on the new lock.
      
      <4>[  462.586305]
                        the existing dependency chain (in reverse order) is:
      <4>[  462.586309]
                        -> #2 (&vm->mutex/1){+.+.}-{3:3}:
      <4>[  462.586323]        i915_gem_shrinker_taints_mutex+0x2d/0x50 [i915]
      <4>[  462.586719]        i915_address_space_init+0x12d/0x130 [i915]
      <4>[  462.587092]        ppgtt_init+0x4e/0x80 [i915]
      <4>[  462.587467]        gen8_ppgtt_create+0x3e/0x5c0 [i915]
      <4>[  462.587828]        i915_ppgtt_create+0x28/0xf0 [i915]
      <4>[  462.588203]        intel_gt_init+0x123/0x370 [i915]
      <4>[  462.588572]        i915_gem_init+0x129/0x1f0 [i915]
      <4>[  462.588971]        i915_driver_probe+0x753/0xd80 [i915]
      <4>[  462.589320]        i915_pci_probe+0x43/0x1d0 [i915]
      <4>[  462.589671]        pci_device_probe+0x9e/0x110
      <4>[  462.589680]        really_probe+0xea/0x410
      <4>[  462.589690]        driver_probe_device+0xd9/0x140
      <4>[  462.589697]        device_driver_attach+0x4a/0x50
      <4>[  462.589704]        __driver_attach+0x83/0x140
      <4>[  462.589711]        bus_for_each_dev+0x75/0xc0
      <4>[  462.589718]        bus_add_driver+0x14b/0x1f0
      <4>[  462.589724]        driver_register+0x66/0xb0
      <4>[  462.589731]        i915_init+0x70/0x87 [i915]
      <4>[  462.590053]        do_one_initcall+0x56/0x2e0
      <4>[  462.590061]        do_init_module+0x55/0x200
      <4>[  462.590068]        load_module+0x2703/0x2990
      <4>[  462.590074]        __do_sys_finit_module+0xad/0x110
      <4>[  462.590080]        do_syscall_64+0x33/0x80
      <4>[  462.590089]        entry_SYSCALL_64_after_hwframe+0x44/0xae
      <4>[  462.590096]
                        -> #1 (fs_reclaim){+.+.}-{0:0}:
      <4>[  462.590109]        fs_reclaim_acquire+0x9f/0xd0
      <4>[  462.590118]        kmem_cache_alloc_trace+0x3d/0x430
      <4>[  462.590126]        intel_cpuc_prepare+0x3b/0x1b0
      <4>[  462.590133]        cpuhp_invoke_callback+0x9e/0x890
      <4>[  462.590141]        _cpu_up+0xa4/0x130
      <4>[  462.590147]        cpu_up+0x82/0x90
      <4>[  462.590153]        bringup_nonboot_cpus+0x4a/0x60
      <4>[  462.590159]        smp_init+0x21/0x5c
      <4>[  462.590167]        kernel_init_freeable+0x8a/0x1b7
      <4>[  462.590175]        kernel_init+0x5/0xff
      <4>[  462.590181]        ret_from_fork+0x22/0x30
      <4>[  462.590187]
                        -> #0 (cpu_hotplug_lock){++++}-{0:0}:
      <4>[  462.590199]        __lock_acquire+0x1520/0x2590
      <4>[  462.590207]        lock_acquire+0xd1/0x3d0
      <4>[  462.590213]        cpus_read_lock+0x39/0xc0
      <4>[  462.590219]        stop_machine+0x12/0x30
      <4>[  462.590226]        bxt_vtd_ggtt_insert_entries__BKL+0x36/0x50 [i915]
      <4>[  462.590601]        ggtt_bind_vma+0x5d/0x80 [i915]
      <4>[  462.590970]        i915_vma_bind+0xdc/0x1c0 [i915]
      <4>[  462.591374]        i915_vma_pin_ww+0x435/0xb40 [i915]
      <4>[  462.591779]        make_obj_busy+0xcb/0x330 [i915]
      <4>[  462.592170]        igt_mmap_offset_exhaustion+0x45f/0x4c0 [i915]
      <4>[  462.592562]        __i915_subtests.cold.7+0x42/0x92 [i915]
      <4>[  462.592995]        __run_selftests.part.3+0x10d/0x172 [i915]
      <4>[  462.593428]        i915_live_selftests.cold.5+0x1f/0x47 [i915]
      <4>[  462.593860]        i915_pci_probe+0x93/0x1d0 [i915]
      <4>[  462.594210]        pci_device_probe+0x9e/0x110
      <4>[  462.594217]        really_probe+0xea/0x410
      <4>[  462.594226]        driver_probe_device+0xd9/0x140
      <4>[  462.594233]        device_driver_attach+0x4a/0x50
      <4>[  462.594240]        __driver_attach+0x83/0x140
      <4>[  462.594247]        bus_for_each_dev+0x75/0xc0
      <4>[  462.594254]        bus_add_driver+0x14b/0x1f0
      <4>[  462.594260]        driver_register+0x66/0xb0
      <4>[  462.594267]        i915_init+0x70/0x87 [i915]
      <4>[  462.594586]        do_one_initcall+0x56/0x2e0
      <4>[  462.594592]        do_init_module+0x55/0x200
      <4>[  462.594599]        load_module+0x2703/0x2990
      <4>[  462.594605]        __do_sys_finit_module+0xad/0x110
      <4>[  462.594612]        do_syscall_64+0x33/0x80
      <4>[  462.594618]        entry_SYSCALL_64_after_hwframe+0x44/0xae
      <4>[  462.594625]
                        other info that might help us debug this:
      
      <4>[  462.594629] Chain exists of:
                          cpu_hotplug_lock --> fs_reclaim --> &vm->mutex/1
      
      <4>[  462.594645]  Possible unsafe locking scenario:
      
      <4>[  462.594648]        CPU0                    CPU1
      <4>[  462.594652]        ----                    ----
      <4>[  462.594655]   lock(&vm->mutex/1);
      <4>[  462.594664]                                lock(fs_reclaim);
      <4>[  462.594671]                                lock(&vm->mutex/1);
      <4>[  462.594679]   lock(cpu_hotplug_lock);
      <4>[  462.594686]
                         *** DEADLOCK ***
      
      <4>[  462.594690] 4 locks held by i915_selftest/5540:
      <4>[  462.594696]  #0: ffff888100fbc240 (&dev->mutex){....}-{3:3}, at: device_driver_attach+0x18/0x50
      <4>[  462.594715]  #1: ffffc900006cb9a0 (reservation_ww_class_acquire){+.+.}-{0:0}, at: make_obj_busy+0x81/0x330 [i915]
      <4>[  462.595118]  #2: ffff88812a6081e8 (reservation_ww_class_mutex){+.+.}-{3:3}, at: make_obj_busy+0x21f/0x330 [i915]
      <4>[  462.595519]  #3: ffff888125369c70 (&vm->mutex/1){+.+.}-{3:3}, at: i915_vma_pin_ww+0x38e/0xb40 [i915]
      <4>[  462.595934]
                        stack backtrace:
      <4>[  462.595939] CPU: 0 PID: 5540 Comm: i915_selftest Tainted: G     U            5.12.0-rc5-CI-Trybot_7644+ #1
      <4>[  462.595947] Hardware name: GOOGLE Kefka/Kefka, BIOS MrChromebox 02/04/2018
      <4>[  462.595952] Call Trace:
      <4>[  462.595961]  dump_stack+0x7f/0xad
      <4>[  462.595974]  check_noncircular+0x12e/0x150
      <4>[  462.595982]  ? save_stack.isra.17+0x3f/0x70
      <4>[  462.595991]  ? drm_mm_insert_node_in_range+0x34a/0x5b0
      <4>[  462.596000]  ? i915_vma_pin_ww+0x9ec/0xb40 [i915]
      <4>[  462.596410]  __lock_acquire+0x1520/0x2590
      <4>[  462.596419]  ? do_init_module+0x55/0x200
      <4>[  462.596429]  lock_acquire+0xd1/0x3d0
      <4>[  462.596435]  ? stop_machine+0x12/0x30
      <4>[  462.596445]  ? gen8_ggtt_insert_entries+0xf0/0xf0 [i915]
      <4>[  462.596816]  cpus_read_lock+0x39/0xc0
      <4>[  462.596824]  ? stop_machine+0x12/0x30
      <4>[  462.596831]  stop_machine+0x12/0x30
      <4>[  462.596839]  bxt_vtd_ggtt_insert_entries__BKL+0x36/0x50 [i915]
      <4>[  462.597210]  ggtt_bind_vma+0x5d/0x80 [i915]
      <4>[  462.597580]  i915_vma_bind+0xdc/0x1c0 [i915]
      <4>[  462.597986]  i915_vma_pin_ww+0x435/0xb40 [i915]
      <4>[  462.598395]  ? make_obj_busy+0xcb/0x330 [i915]
      <4>[  462.598786]  make_obj_busy+0xcb/0x330 [i915]
      <4>[  462.599180]  ? 0xffffffff81000000
      <4>[  462.599187]  ? debug_mutex_unlock+0x50/0xa0
      <4>[  462.599198]  igt_mmap_offset_exhaustion+0x45f/0x4c0 [i915]
      <4>[  462.599592]  __i915_subtests.cold.7+0x42/0x92 [i915]
      <4>[  462.600026]  ? i915_perf_selftests+0x20/0x20 [i915]
      <4>[  462.600422]  ? __i915_nop_setup+0x10/0x10 [i915]
      <4>[  462.600820]  __run_selftests.part.3+0x10d/0x172 [i915]
      <4>[  462.601253]  i915_live_selftests.cold.5+0x1f/0x47 [i915]
      <4>[  462.601686]  i915_pci_probe+0x93/0x1d0 [i915]
      <4>[  462.602037]  ? _raw_spin_unlock_irqrestore+0x3d/0x60
      <4>[  462.602047]  pci_device_probe+0x9e/0x110
      <4>[  462.602057]  really_probe+0xea/0x410
      <4>[  462.602067]  driver_probe_device+0xd9/0x140
      <4>[  462.602075]  device_driver_attach+0x4a/0x50
      <4>[  462.602084]  __driver_attach+0x83/0x140
      <4>[  462.602091]  ? device_driver_attach+0x50/0x50
      <4>[  462.602099]  ? device_driver_attach+0x50/0x50
      <4>[  462.602107]  bus_for_each_dev+0x75/0xc0
      <4>[  462.602116]  bus_add_driver+0x14b/0x1f0
      <4>[  462.602124]  driver_register+0x66/0xb0
      <4>[  462.602133]  i915_init+0x70/0x87 [i915]
      <4>[  462.602453]  ? 0xffffffffa0606000
      <4>[  462.602458]  do_one_initcall+0x56/0x2e0
      <4>[  462.602466]  ? kmem_cache_alloc_trace+0x374/0x430
      <4>[  462.602476]  do_init_module+0x55/0x200
      <4>[  462.602484]  load_module+0x2703/0x2990
      <4>[  462.602500]  ? __do_sys_finit_module+0xad/0x110
      <4>[  462.602507]  __do_sys_finit_module+0xad/0x110
      <4>[  462.602519]  do_syscall_64+0x33/0x80
      <4>[  462.602527]  entry_SYSCALL_64_after_hwframe+0x44/0xae
      <4>[  462.602535] RIP: 0033:0x7fab69d8d89d
      
      Changes since v1:
      - Add lockdep annotations during init, to ensure that lockdep is primed.
        This also fixes a false positive when reading /proc/lockdep_stats
        during module reload.
      Signed-off-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210426102351.921874-1-maarten.lankhorst@linux.intel.comReviewed-by: NThomas Hellström <thomas.hellstrom@linux.intel.com>
      bc6f80cc
  14. 27 4月, 2021 1 次提交
  15. 22 4月, 2021 1 次提交
  16. 14 4月, 2021 5 次提交
  17. 29 3月, 2021 6 次提交
  18. 25 3月, 2021 3 次提交
  19. 24 3月, 2021 3 次提交
    • M
      drm/i915: Move cmd parser pinning to execbuffer · 0edbb9ba
      Maarten Lankhorst 提交于
      We need to get rid of allocations in the cmd parser, because it needs
      to be called from a signaling context, first move all pinning to
      execbuf, where we already hold all locks.
      
      Allocate jump_whitelist in the execbuffer, and add annotations around
      intel_engine_cmd_parser(), to ensure we only call the command parser
      without allocating any memory, or taking any locks we're not supposed to.
      
      Because i915_gem_object_get_page() may also allocate memory, add a
      path to i915_gem_object_get_sg() that prevents memory allocations,
      and walk the sg list manually. It should be similarly fast.
      
      This has the added benefit of being able to catch all memory allocation
      errors before the point of no return, and return -ENOMEM safely to the
      execbuf submitter.
      Signed-off-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Acked-by: NThomas Hellström <thomas.hellstrom@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210323155059.628690-4-maarten.lankhorst@linux.intel.com
      0edbb9ba
    • M
      drm/i915: Add DISPLAY_VER() and related macros · 01eb15c9
      Matt Roper 提交于
      Although we've long referred to platforms by a single "GEN" number, the
      hardware teams have recommended that we stop doing this since the
      various component IP blocks are going to start using independent number
      schemes with varying cadence.  To support this, hardware platforms a bit
      down the road are going to start providing MMIO registers that the
      driver can read to obtain the "graphics version," "media version," and
      "display version" without needing to do a PCI ID -> platform -> version
      translation.
      
      Although our current platforms don't yet expose these registers (and the
      next couple we release probably won't have them yet either), the
      hardware teams would still like to see us move to this independent
      numbering scheme now in preparation.  For i915 that means we should try
      to eliminate all usage of INTEL_GEN() throughout our code and instead
      replace it with separate GRAPHICS_VER(), MEDIA_VER(), and DISPLAY_VER()
      constructs in the code.  For old platforms, these will all usually give
      the same value for each IP block (aside from a few special cases like
      GLK which we can no more accurately represent as graphics=9 +
      display=10), but future platforms will have more flexibility to bump IP
      version numbers independently.
      
      The upcoming ADL-P platform will have a display version of 13 and a
      graphics version of 12, so let's just the first step of breaking out
      DISPLAY_VER(), but leaving the rest of INTEL_GEN() untouched for now.
      For now we'll automatically derive the display version from the
      platform's INTEL_GEN() value except in cases where an alternative
      display version is explicitly provided in the device info structure.
      
      We also add some helper macros IS_DISPLAY_VER(i915, ver) and
      IS_DISPLAY_RANGE(i915, from, until) that match the behavior of the
      existing gen-based macros.  However unlike IS_GEN(), we will implement
      those macros with direct comparisons rather than trying to maintain a
      mask to help compiler optimization.  In practice the optimization winds
      up not being used in very many places (since the vast majority of our
      platform checks are of the form "gen >= x") so there is pretty minimal
      size reduction in the final driver binary[1].  We're also likely going
      to need to extend these version numbers to non-integer major.minor
      values at some point in the future, so the mask approach won't work at
      all once we get to platforms like that.
      
       [1] The results before/after the next patch in this series, which
           switches our code over to the new display macros:
      
              $ size i915.ko.{orig,new}
                 text    data     bss     dec     hex filename
              2940291  102944    5384 3048619  2e84ab i915.ko.orig
              2940723  102956    5384 3049063  2e8667 i915.ko.new
      
      v2:
       - Move version into device info's display sub-struct. (Jani)
       - Add extra parentheses to macros.  (Jani)
       - Note the lack of genmask optimization in the display-based macros and
         give size data.  (Lucas)
      
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Lucas De Marchi <lucas.demarchi@intel.com>
      Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: NLucas De Marchi <lucas.demarchi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210320044245.3920043-3-matthew.d.roper@intel.com
      01eb15c9
    • M
      drm/i915/display: Convert gen5/gen6 tests to IS_IRONLAKE/IS_SANDYBRIDGE · d47d29a6
      Matt Roper 提交于
      ILK is the only platform that we consider "gen5" and SNB is the only
      platform we consider "gen6."  Add an IS_SANDYBRIDGE() macro and then
      replace numeric platform tests for these two generations with direct
      platform tests with the following Coccinelle semantic patch:
      
              @@ expression dev_priv; @@
              - IS_GEN(dev_priv, 5)
              + IS_IRONLAKE(dev_priv)
      
              @@ expression dev_priv; @@
              - IS_GEN(dev_priv, 6)
              + IS_SANDYBRIDGE(dev_priv)
      
              @@ expression dev_priv; @@
              - IS_GEN_RANGE(dev_priv, 5, 6)
              + IS_IRONLAKE(dev_priv) || IS_SANDYBRIDGE(dev_priv)
      
      This will simplify our upcoming patches which eliminate INTEL_GEN()
      usage in the display code.
      
      v2:
       - Reverse ilk/snb order for IS_GEN_RANGE conversion.  (Ville)
       - Rebase + regenerate from semantic patch
      Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210320044245.3920043-2-matthew.d.roper@intel.com
      d47d29a6
  20. 18 3月, 2021 2 次提交