Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/i915/gt: Use pci_rebar_size_supported()

PCI core provides pci_rebar_size_supported() that helps in checking if an
encoded BAR Size is supported for the BAR or not. Use it in
i915_resize_lmem_bar() to simplify code.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Acked-by: Christian König <christian.koenig@amd.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patch.msgid.link/20251113180053.27944-7-ilpo.jarvinen@linux.intel.com

authored by

Ilpo Järvinen and committed by
Bjorn Helgaas
c59038d3 bb1fabd0

+3 -7
+3 -7
drivers/gpu/drm/i915/gt/intel_region_lmem.c
··· 49 49 current_size = roundup_pow_of_two(pci_resource_len(pdev, GEN12_LMEM_BAR)); 50 50 51 51 if (i915->params.lmem_bar_size) { 52 - u32 bar_sizes; 53 - 54 - rebar_size = i915->params.lmem_bar_size * 55 - (resource_size_t)SZ_1M; 56 - bar_sizes = pci_rebar_get_possible_sizes(pdev, GEN12_LMEM_BAR); 57 - 52 + rebar_size = i915->params.lmem_bar_size * (resource_size_t)SZ_1M; 58 53 if (rebar_size == current_size) 59 54 return; 60 55 61 - if (!(bar_sizes & BIT(pci_rebar_bytes_to_size(rebar_size))) || 56 + if (!pci_rebar_size_supported(pdev, GEN12_LMEM_BAR, 57 + pci_rebar_bytes_to_size(rebar_size)) || 62 58 rebar_size >= roundup_pow_of_two(lmem_size)) { 63 59 rebar_size = lmem_size; 64 60