Merge cd918ec241 ("orangefs: Do not truncate file size") into android16-6.12-lts
Steps on the way to 6.12.31 Change-Id: Ic4b1ed54cab9844c75f4824bb7ac3f28e37b3eb7 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -32,12 +32,12 @@ Temperature sensors and fans can be queried and set via the standard
|
||||
=============================== ======= =======================================
|
||||
Name Perm Description
|
||||
=============================== ======= =======================================
|
||||
fan[1-3]_input RO Fan speed in RPM.
|
||||
fan[1-3]_label RO Fan label.
|
||||
fan[1-3]_min RO Minimal Fan speed in RPM
|
||||
fan[1-3]_max RO Maximal Fan speed in RPM
|
||||
fan[1-3]_target RO Expected Fan speed in RPM
|
||||
pwm[1-3] RW Control the fan PWM duty-cycle.
|
||||
fan[1-4]_input RO Fan speed in RPM.
|
||||
fan[1-4]_label RO Fan label.
|
||||
fan[1-4]_min RO Minimal Fan speed in RPM
|
||||
fan[1-4]_max RO Maximal Fan speed in RPM
|
||||
fan[1-4]_target RO Expected Fan speed in RPM
|
||||
pwm[1-4] RW Control the fan PWM duty-cycle.
|
||||
pwm1_enable WO Enable or disable automatic BIOS fan
|
||||
control (not supported on all laptops,
|
||||
see below for details).
|
||||
@@ -93,7 +93,7 @@ Again, when you find new codes, we'd be happy to have your patches!
|
||||
---------------------------
|
||||
|
||||
The driver also exports the fans as thermal cooling devices with
|
||||
``type`` set to ``dell-smm-fan[1-3]``. This allows for easy fan control
|
||||
``type`` set to ``dell-smm-fan[1-4]``. This allows for easy fan control
|
||||
using one of the thermal governors.
|
||||
|
||||
Module parameters
|
||||
|
||||
@@ -139,7 +139,7 @@
|
||||
reg = <0x54400000 0x00040000>;
|
||||
clocks = <&tegra_car TEGRA114_CLK_DSIB>,
|
||||
<&tegra_car TEGRA114_CLK_DSIBLP>,
|
||||
<&tegra_car TEGRA114_CLK_PLL_D2_OUT0>;
|
||||
<&tegra_car TEGRA114_CLK_PLL_D_OUT0>;
|
||||
clock-names = "dsi", "lp", "parent";
|
||||
resets = <&tegra_car 82>;
|
||||
reset-names = "dsi";
|
||||
|
||||
@@ -1686,7 +1686,7 @@
|
||||
regulator-min-microvolt = <1800000>;
|
||||
regulator-max-microvolt = <1800000>;
|
||||
regulator-always-on;
|
||||
gpio = <&exp1 14 GPIO_ACTIVE_HIGH>;
|
||||
gpio = <&exp1 9 GPIO_ACTIVE_HIGH>;
|
||||
enable-active-high;
|
||||
vin-supply = <&vdd_1v8>;
|
||||
};
|
||||
|
||||
@@ -302,6 +302,16 @@
|
||||
};
|
||||
|
||||
pcie@141a0000 {
|
||||
reg = <0x00 0x141a0000 0x0 0x00020000 /* appl registers (128K) */
|
||||
0x00 0x3a000000 0x0 0x00040000 /* configuration space (256K) */
|
||||
0x00 0x3a040000 0x0 0x00040000 /* iATU_DMA reg space (256K) */
|
||||
0x00 0x3a080000 0x0 0x00040000 /* DBI reg space (256K) */
|
||||
0x2e 0x20000000 0x0 0x10000000>; /* ECAM (256MB) */
|
||||
|
||||
ranges = <0x81000000 0x00 0x3a100000 0x00 0x3a100000 0x0 0x00100000 /* downstream I/O (1MB) */
|
||||
0x82000000 0x00 0x40000000 0x2e 0x30000000 0x0 0x08000000 /* non-prefetchable memory (128MB) */
|
||||
0xc3000000 0x28 0x00000000 0x28 0x00000000 0x6 0x20000000>; /* prefetchable memory (25088MB) */
|
||||
|
||||
status = "okay";
|
||||
vddio-pex-ctl-supply = <&vdd_1v8_ls>;
|
||||
phys = <&p2u_nvhs_0>, <&p2u_nvhs_1>, <&p2u_nvhs_2>,
|
||||
|
||||
@@ -132,6 +132,7 @@
|
||||
#define FUJITSU_CPU_PART_A64FX 0x001
|
||||
|
||||
#define HISI_CPU_PART_TSV110 0xD01
|
||||
#define HISI_CPU_PART_HIP09 0xD02
|
||||
|
||||
#define APPLE_CPU_PART_M1_ICESTORM 0x022
|
||||
#define APPLE_CPU_PART_M1_FIRESTORM 0x023
|
||||
@@ -208,6 +209,7 @@
|
||||
#define MIDR_NVIDIA_CARMEL MIDR_CPU_MODEL(ARM_CPU_IMP_NVIDIA, NVIDIA_CPU_PART_CARMEL)
|
||||
#define MIDR_FUJITSU_A64FX MIDR_CPU_MODEL(ARM_CPU_IMP_FUJITSU, FUJITSU_CPU_PART_A64FX)
|
||||
#define MIDR_HISI_TSV110 MIDR_CPU_MODEL(ARM_CPU_IMP_HISI, HISI_CPU_PART_TSV110)
|
||||
#define MIDR_HISI_HIP09 MIDR_CPU_MODEL(ARM_CPU_IMP_HISI, HISI_CPU_PART_HIP09)
|
||||
#define MIDR_APPLE_M1_ICESTORM MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M1_ICESTORM)
|
||||
#define MIDR_APPLE_M1_FIRESTORM MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M1_FIRESTORM)
|
||||
#define MIDR_APPLE_M1_ICESTORM_PRO MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M1_ICESTORM_PRO)
|
||||
|
||||
@@ -554,18 +554,6 @@ static inline int pmd_protnone(pmd_t pmd)
|
||||
#endif
|
||||
|
||||
#define pmd_present(pmd) pte_present(pmd_pte(pmd))
|
||||
|
||||
/*
|
||||
* THP definitions.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
|
||||
static inline int pmd_trans_huge(pmd_t pmd)
|
||||
{
|
||||
return pmd_val(pmd) && pmd_present(pmd) && !(pmd_val(pmd) & PMD_TABLE_BIT);
|
||||
}
|
||||
#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
|
||||
|
||||
#define pmd_dirty(pmd) pte_dirty(pmd_pte(pmd))
|
||||
#define pmd_young(pmd) pte_young(pmd_pte(pmd))
|
||||
#define pmd_valid(pmd) pte_valid(pmd_pte(pmd))
|
||||
@@ -725,6 +713,18 @@ extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
|
||||
#define pmd_leaf_size(pmd) (pmd_cont(pmd) ? CONT_PMD_SIZE : PMD_SIZE)
|
||||
#define pte_leaf_size(pte) (pte_cont(pte) ? CONT_PTE_SIZE : PAGE_SIZE)
|
||||
|
||||
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
|
||||
static inline int pmd_trans_huge(pmd_t pmd)
|
||||
{
|
||||
/*
|
||||
* If pmd is present-invalid, pmd_table() won't detect it
|
||||
* as a table, so force the valid bit for the comparison.
|
||||
*/
|
||||
return pmd_val(pmd) && pmd_present(pmd) &&
|
||||
!pmd_table(__pmd(pmd_val(pmd) | PTE_VALID));
|
||||
}
|
||||
#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
|
||||
|
||||
#if defined(CONFIG_ARM64_64K_PAGES) || CONFIG_PGTABLE_LEVELS < 3
|
||||
static inline bool pud_sect(pud_t pud) { return false; }
|
||||
static inline bool pud_table(pud_t pud) { return true; }
|
||||
@@ -806,7 +806,8 @@ static inline unsigned long pmd_page_vaddr(pmd_t pmd)
|
||||
pr_err("%s:%d: bad pmd %016llx.\n", __FILE__, __LINE__, pmd_val(e))
|
||||
|
||||
#define pud_none(pud) (!pud_val(pud))
|
||||
#define pud_bad(pud) (!pud_table(pud))
|
||||
#define pud_bad(pud) ((pud_val(pud) & PUD_TYPE_MASK) != \
|
||||
PUD_TYPE_TABLE)
|
||||
#define pud_present(pud) pte_present(pud_pte(pud))
|
||||
#ifndef __PAGETABLE_PMD_FOLDED
|
||||
#define pud_leaf(pud) (pud_present(pud) && !pud_table(pud))
|
||||
|
||||
@@ -904,6 +904,7 @@ static u8 spectre_bhb_loop_affected(void)
|
||||
MIDR_ALL_VERSIONS(MIDR_CORTEX_A77),
|
||||
MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N1),
|
||||
MIDR_ALL_VERSIONS(MIDR_QCOM_KRYO_4XX_GOLD),
|
||||
MIDR_ALL_VERSIONS(MIDR_HISI_HIP09),
|
||||
{},
|
||||
};
|
||||
static const struct midr_range spectre_bhb_k11_list[] = {
|
||||
|
||||
@@ -2982,11 +2982,11 @@ static void __init fixup_device_tree_pmac(void)
|
||||
char type[8];
|
||||
phandle node;
|
||||
|
||||
// Some pmacs are missing #size-cells on escc nodes
|
||||
// Some pmacs are missing #size-cells on escc or i2s nodes
|
||||
for (node = 0; prom_next_node(&node); ) {
|
||||
type[0] = '\0';
|
||||
prom_getprop(node, "device_type", type, sizeof(type));
|
||||
if (prom_strcmp(type, "escc"))
|
||||
if (prom_strcmp(type, "escc") && prom_strcmp(type, "i2s"))
|
||||
continue;
|
||||
|
||||
if (prom_getproplen(node, "#size-cells") != PROM_ERROR)
|
||||
|
||||
@@ -26,12 +26,9 @@
|
||||
* When not using MMU this corresponds to the first free page in
|
||||
* physical memory (aligned on a page boundary).
|
||||
*/
|
||||
#ifdef CONFIG_64BIT
|
||||
#ifdef CONFIG_MMU
|
||||
#ifdef CONFIG_64BIT
|
||||
#define PAGE_OFFSET kernel_map.page_offset
|
||||
#else
|
||||
#define PAGE_OFFSET _AC(CONFIG_PAGE_OFFSET, UL)
|
||||
#endif
|
||||
/*
|
||||
* By default, CONFIG_PAGE_OFFSET value corresponds to SV57 address space so
|
||||
* define the PAGE_OFFSET value for SV48 and SV39.
|
||||
@@ -41,6 +38,9 @@
|
||||
#else
|
||||
#define PAGE_OFFSET _AC(CONFIG_PAGE_OFFSET, UL)
|
||||
#endif /* CONFIG_64BIT */
|
||||
#else
|
||||
#define PAGE_OFFSET ((unsigned long)phys_ram_base)
|
||||
#endif /* CONFIG_MMU */
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
@@ -97,11 +97,7 @@ typedef struct page *pgtable_t;
|
||||
#define MIN_MEMBLOCK_ADDR 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_MMU
|
||||
#define ARCH_PFN_OFFSET (PFN_DOWN((unsigned long)phys_ram_base))
|
||||
#else
|
||||
#define ARCH_PFN_OFFSET (PAGE_OFFSET >> PAGE_SHIFT)
|
||||
#endif /* CONFIG_MMU */
|
||||
|
||||
struct kernel_mapping {
|
||||
unsigned long page_offset;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <asm/pgtable-bits.h>
|
||||
|
||||
#ifndef CONFIG_MMU
|
||||
#define KERNEL_LINK_ADDR PAGE_OFFSET
|
||||
#define KERNEL_LINK_ADDR _AC(CONFIG_PAGE_OFFSET, UL)
|
||||
#define KERN_VIRT_SIZE (UL(-1))
|
||||
#else
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <linux/smp.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/hugetlb.h>
|
||||
#include <linux/mmu_notifier.h>
|
||||
#include <asm/sbi.h>
|
||||
#include <asm/mmu_context.h>
|
||||
|
||||
@@ -78,10 +79,17 @@ static void __ipi_flush_tlb_range_asid(void *info)
|
||||
local_flush_tlb_range_asid(d->start, d->size, d->stride, d->asid);
|
||||
}
|
||||
|
||||
static void __flush_tlb_range(const struct cpumask *cmask, unsigned long asid,
|
||||
static inline unsigned long get_mm_asid(struct mm_struct *mm)
|
||||
{
|
||||
return mm ? cntx2asid(atomic_long_read(&mm->context.id)) : FLUSH_TLB_NO_ASID;
|
||||
}
|
||||
|
||||
static void __flush_tlb_range(struct mm_struct *mm,
|
||||
const struct cpumask *cmask,
|
||||
unsigned long start, unsigned long size,
|
||||
unsigned long stride)
|
||||
{
|
||||
unsigned long asid = get_mm_asid(mm);
|
||||
unsigned int cpu;
|
||||
|
||||
if (cpumask_empty(cmask))
|
||||
@@ -105,30 +113,26 @@ static void __flush_tlb_range(const struct cpumask *cmask, unsigned long asid,
|
||||
}
|
||||
|
||||
put_cpu();
|
||||
}
|
||||
|
||||
static inline unsigned long get_mm_asid(struct mm_struct *mm)
|
||||
{
|
||||
return cntx2asid(atomic_long_read(&mm->context.id));
|
||||
if (mm)
|
||||
mmu_notifier_arch_invalidate_secondary_tlbs(mm, start, start + size);
|
||||
}
|
||||
|
||||
void flush_tlb_mm(struct mm_struct *mm)
|
||||
{
|
||||
__flush_tlb_range(mm_cpumask(mm), get_mm_asid(mm),
|
||||
0, FLUSH_TLB_MAX_SIZE, PAGE_SIZE);
|
||||
__flush_tlb_range(mm, mm_cpumask(mm), 0, FLUSH_TLB_MAX_SIZE, PAGE_SIZE);
|
||||
}
|
||||
|
||||
void flush_tlb_mm_range(struct mm_struct *mm,
|
||||
unsigned long start, unsigned long end,
|
||||
unsigned int page_size)
|
||||
{
|
||||
__flush_tlb_range(mm_cpumask(mm), get_mm_asid(mm),
|
||||
start, end - start, page_size);
|
||||
__flush_tlb_range(mm, mm_cpumask(mm), start, end - start, page_size);
|
||||
}
|
||||
|
||||
void flush_tlb_page(struct vm_area_struct *vma, unsigned long addr)
|
||||
{
|
||||
__flush_tlb_range(mm_cpumask(vma->vm_mm), get_mm_asid(vma->vm_mm),
|
||||
__flush_tlb_range(vma->vm_mm, mm_cpumask(vma->vm_mm),
|
||||
addr, PAGE_SIZE, PAGE_SIZE);
|
||||
}
|
||||
|
||||
@@ -161,13 +165,13 @@ void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
|
||||
}
|
||||
}
|
||||
|
||||
__flush_tlb_range(mm_cpumask(vma->vm_mm), get_mm_asid(vma->vm_mm),
|
||||
__flush_tlb_range(vma->vm_mm, mm_cpumask(vma->vm_mm),
|
||||
start, end - start, stride_size);
|
||||
}
|
||||
|
||||
void flush_tlb_kernel_range(unsigned long start, unsigned long end)
|
||||
{
|
||||
__flush_tlb_range(cpu_online_mask, FLUSH_TLB_NO_ASID,
|
||||
__flush_tlb_range(NULL, cpu_online_mask,
|
||||
start, end - start, PAGE_SIZE);
|
||||
}
|
||||
|
||||
@@ -175,7 +179,7 @@ void flush_tlb_kernel_range(unsigned long start, unsigned long end)
|
||||
void flush_pmd_tlb_range(struct vm_area_struct *vma, unsigned long start,
|
||||
unsigned long end)
|
||||
{
|
||||
__flush_tlb_range(mm_cpumask(vma->vm_mm), get_mm_asid(vma->vm_mm),
|
||||
__flush_tlb_range(vma->vm_mm, mm_cpumask(vma->vm_mm),
|
||||
start, end - start, PMD_SIZE);
|
||||
}
|
||||
#endif
|
||||
@@ -189,7 +193,10 @@ void arch_tlbbatch_add_pending(struct arch_tlbflush_unmap_batch *batch,
|
||||
struct mm_struct *mm,
|
||||
unsigned long uaddr)
|
||||
{
|
||||
unsigned long start = uaddr & PAGE_MASK;
|
||||
|
||||
cpumask_or(&batch->cpumask, &batch->cpumask, mm_cpumask(mm));
|
||||
mmu_notifier_arch_invalidate_secondary_tlbs(mm, start, start + PAGE_SIZE);
|
||||
}
|
||||
|
||||
void arch_flush_tlb_batched_pending(struct mm_struct *mm)
|
||||
@@ -199,7 +206,7 @@ void arch_flush_tlb_batched_pending(struct mm_struct *mm)
|
||||
|
||||
void arch_tlbbatch_flush(struct arch_tlbflush_unmap_batch *batch)
|
||||
{
|
||||
__flush_tlb_range(&batch->cpumask, FLUSH_TLB_NO_ASID, 0,
|
||||
FLUSH_TLB_MAX_SIZE, PAGE_SIZE);
|
||||
__flush_tlb_range(NULL, &batch->cpumask,
|
||||
0, FLUSH_TLB_MAX_SIZE, PAGE_SIZE);
|
||||
cpumask_clear(&batch->cpumask);
|
||||
}
|
||||
|
||||
@@ -208,6 +208,8 @@ static int hypfs_create_cpu_files(struct dentry *cpus_dir, void *cpu_info)
|
||||
snprintf(buffer, TMP_SIZE, "%d", cpu_info__cpu_addr(diag204_get_info_type(),
|
||||
cpu_info));
|
||||
cpu_dir = hypfs_mkdir(cpus_dir, buffer);
|
||||
if (IS_ERR(cpu_dir))
|
||||
return PTR_ERR(cpu_dir);
|
||||
rc = hypfs_create_u64(cpu_dir, "mgmtime",
|
||||
cpu_info__acc_time(diag204_get_info_type(), cpu_info) -
|
||||
cpu_info__lp_time(diag204_get_info_type(), cpu_info));
|
||||
|
||||
@@ -85,7 +85,7 @@ static inline void pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte,
|
||||
tlb->mm->context.flush_mm = 1;
|
||||
tlb->freed_tables = 1;
|
||||
tlb->cleared_pmds = 1;
|
||||
if (mm_alloc_pgste(tlb->mm))
|
||||
if (mm_has_pgste(tlb->mm))
|
||||
gmap_unlink(tlb->mm, (unsigned long *)pte, address);
|
||||
tlb_remove_ptdesc(tlb, pte);
|
||||
}
|
||||
|
||||
@@ -70,6 +70,7 @@ void __init mem_init(void)
|
||||
map_memory(brk_end, __pa(brk_end), uml_reserved - brk_end, 1, 1, 0);
|
||||
memblock_free((void *)brk_end, uml_reserved - brk_end);
|
||||
uml_reserved = brk_end;
|
||||
min_low_pfn = PFN_UP(__pa(uml_reserved));
|
||||
|
||||
/* this will put all low memory onto the freelists */
|
||||
memblock_free_all();
|
||||
|
||||
@@ -63,7 +63,7 @@ THUNK warn_thunk_thunk, __warn_thunk
|
||||
* entirely in the C code, and use an alias emitted by the linker script
|
||||
* instead.
|
||||
*/
|
||||
#ifdef CONFIG_STACKPROTECTOR
|
||||
#if defined(CONFIG_STACKPROTECTOR) && defined(CONFIG_SMP)
|
||||
EXPORT_SYMBOL(__ref_stack_chk_guard);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
#define INTEL_ANY IFM(X86_FAMILY_ANY, X86_MODEL_ANY)
|
||||
|
||||
#define INTEL_PENTIUM_PRO IFM(6, 0x01)
|
||||
#define INTEL_PENTIUM_III_DESCHUTES IFM(6, 0x05)
|
||||
|
||||
#define INTEL_CORE_YONAH IFM(6, 0x0E)
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#define XLF_5LEVEL_ENABLED (1<<6)
|
||||
#define XLF_MEM_ENCRYPTION (1<<7)
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
#ifndef __ASSEMBLER__
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/screen_info.h>
|
||||
@@ -210,6 +210,6 @@ enum x86_hardware_subarch {
|
||||
X86_NR_SUBARCHS,
|
||||
};
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __ASSEMBLER__ */
|
||||
|
||||
#endif /* _ASM_X86_BOOTPARAM_H */
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
*/
|
||||
#define E820_RESERVED_KERN 128
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
#ifndef __ASSEMBLER__
|
||||
#include <linux/types.h>
|
||||
struct e820entry {
|
||||
__u64 addr; /* start of memory segment */
|
||||
@@ -76,7 +76,7 @@ struct e820map {
|
||||
#define BIOS_ROM_BASE 0xffe00000
|
||||
#define BIOS_ROM_END 0xffffffff
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __ASSEMBLER__ */
|
||||
|
||||
|
||||
#endif /* _UAPI_ASM_X86_E820_H */
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
/* The size of each LDT entry. */
|
||||
#define LDT_ENTRY_SIZE 8
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
#ifndef __ASSEMBLER__
|
||||
/*
|
||||
* Note on 64bit base and limit is ignored and you cannot set DS/ES/CS
|
||||
* not to the default values if you still want to do syscalls. This
|
||||
@@ -44,5 +44,5 @@ struct user_desc {
|
||||
#define MODIFY_LDT_CONTENTS_STACK 1
|
||||
#define MODIFY_LDT_CONTENTS_CODE 2
|
||||
|
||||
#endif /* !__ASSEMBLY__ */
|
||||
#endif /* !__ASSEMBLER__ */
|
||||
#endif /* _ASM_X86_LDT_H */
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#ifndef _UAPI_ASM_X86_MSR_H
|
||||
#define _UAPI_ASM_X86_MSR_H
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
#ifndef __ASSEMBLER__
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/ioctl.h>
|
||||
@@ -10,5 +10,5 @@
|
||||
#define X86_IOC_RDMSR_REGS _IOWR('c', 0xA0, __u32[8])
|
||||
#define X86_IOC_WRMSR_REGS _IOWR('c', 0xA1, __u32[8])
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __ASSEMBLER__ */
|
||||
#endif /* _UAPI_ASM_X86_MSR_H */
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
#else /* __i386__ */
|
||||
|
||||
#if defined(__ASSEMBLY__) || defined(__FRAME_OFFSETS)
|
||||
#if defined(__ASSEMBLER__) || defined(__FRAME_OFFSETS)
|
||||
/*
|
||||
* C ABI says these regs are callee-preserved. They aren't saved on kernel entry
|
||||
* unless syscall needs a complete, fully filled "struct pt_regs".
|
||||
@@ -57,7 +57,7 @@
|
||||
#define EFLAGS 144
|
||||
#define RSP 152
|
||||
#define SS 160
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __ASSEMBLER__ */
|
||||
|
||||
/* top of stack page */
|
||||
#define FRAME_SIZE 168
|
||||
@@ -87,7 +87,7 @@
|
||||
|
||||
#define PTRACE_SINGLEBLOCK 33 /* resume execution until next branch */
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
#ifndef __ASSEMBLER__
|
||||
#include <linux/types.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include <asm/processor-flags.h>
|
||||
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
#ifndef __ASSEMBLER__
|
||||
|
||||
#ifdef __i386__
|
||||
/* this struct defines the way the registers are stored on the
|
||||
@@ -81,6 +81,6 @@ struct pt_regs {
|
||||
|
||||
|
||||
|
||||
#endif /* !__ASSEMBLY__ */
|
||||
#endif /* !__ASSEMBLER__ */
|
||||
|
||||
#endif /* _UAPI_ASM_X86_PTRACE_H */
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#define SETUP_INDIRECT (1<<31)
|
||||
#define SETUP_TYPE_MAX (SETUP_ENUM_MAX | SETUP_INDIRECT)
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
#ifndef __ASSEMBLER__
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
@@ -78,6 +78,6 @@ struct ima_setup_data {
|
||||
__u64 size;
|
||||
} __attribute__((packed));
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __ASSEMBLER__ */
|
||||
|
||||
#endif /* _UAPI_ASM_X86_SETUP_DATA_H */
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#ifndef _UAPI_ASM_X86_SIGNAL_H
|
||||
#define _UAPI_ASM_X86_SIGNAL_H
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
#ifndef __ASSEMBLER__
|
||||
#include <linux/types.h>
|
||||
#include <linux/compiler.h>
|
||||
|
||||
@@ -16,7 +16,7 @@ struct siginfo;
|
||||
typedef unsigned long sigset_t;
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __ASSEMBLER__ */
|
||||
|
||||
|
||||
#define SIGHUP 1
|
||||
@@ -68,7 +68,7 @@ typedef unsigned long sigset_t;
|
||||
|
||||
#include <asm-generic/signal-defs.h>
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
#ifndef __ASSEMBLER__
|
||||
|
||||
|
||||
# ifndef __KERNEL__
|
||||
@@ -106,6 +106,6 @@ typedef struct sigaltstack {
|
||||
__kernel_size_t ss_size;
|
||||
} stack_t;
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __ASSEMBLER__ */
|
||||
|
||||
#endif /* _UAPI_ASM_X86_SIGNAL_H */
|
||||
|
||||
@@ -74,7 +74,7 @@ void intel_collect_cpu_info(struct cpu_signature *sig)
|
||||
sig->pf = 0;
|
||||
sig->rev = intel_get_microcode_revision();
|
||||
|
||||
if (x86_model(sig->sig) >= 5 || x86_family(sig->sig) > 6) {
|
||||
if (IFM(x86_family(sig->sig), x86_model(sig->sig)) >= INTEL_PENTIUM_III_DESCHUTES) {
|
||||
unsigned int val[2];
|
||||
|
||||
/* get processor flags from MSR 0x17 */
|
||||
|
||||
@@ -681,9 +681,9 @@ static void __init smp_quirk_init_udelay(void)
|
||||
return;
|
||||
|
||||
/* if modern processor, use no delay */
|
||||
if (((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) && (boot_cpu_data.x86 == 6)) ||
|
||||
((boot_cpu_data.x86_vendor == X86_VENDOR_HYGON) && (boot_cpu_data.x86 >= 0x18)) ||
|
||||
((boot_cpu_data.x86_vendor == X86_VENDOR_AMD) && (boot_cpu_data.x86 >= 0xF))) {
|
||||
if ((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL && boot_cpu_data.x86_vfm >= INTEL_PENTIUM_PRO) ||
|
||||
(boot_cpu_data.x86_vendor == X86_VENDOR_HYGON && boot_cpu_data.x86 >= 0x18) ||
|
||||
(boot_cpu_data.x86_vendor == X86_VENDOR_AMD && boot_cpu_data.x86 >= 0xF)) {
|
||||
init_udelay = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -651,8 +651,13 @@ static void __init memory_map_top_down(unsigned long map_start,
|
||||
*/
|
||||
addr = memblock_phys_alloc_range(PMD_SIZE, PMD_SIZE, map_start,
|
||||
map_end);
|
||||
memblock_phys_free(addr, PMD_SIZE);
|
||||
real_end = addr + PMD_SIZE;
|
||||
if (!addr) {
|
||||
pr_warn("Failed to release memory for alloc_low_pages()");
|
||||
real_end = max(map_start, ALIGN_DOWN(map_end, PMD_SIZE));
|
||||
} else {
|
||||
memblock_phys_free(addr, PMD_SIZE);
|
||||
real_end = addr + PMD_SIZE;
|
||||
}
|
||||
|
||||
/* step_size need to be small so pgt_buf from BRK could cover it */
|
||||
step_size = PMD_SIZE;
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <asm/mmu_context.h>
|
||||
#include <asm/cpu_device_id.h>
|
||||
#include <asm/microcode.h>
|
||||
#include <asm/fred.h>
|
||||
|
||||
#ifdef CONFIG_X86_32
|
||||
__visible unsigned long saved_context_ebx;
|
||||
@@ -231,6 +232,19 @@ static void notrace __restore_processor_state(struct saved_context *ctxt)
|
||||
*/
|
||||
#ifdef CONFIG_X86_64
|
||||
wrmsrl(MSR_GS_BASE, ctxt->kernelmode_gs_base);
|
||||
|
||||
/*
|
||||
* Reinitialize FRED to ensure the FRED MSRs contain the same values
|
||||
* as before hibernation.
|
||||
*
|
||||
* Note, the setup of FRED RSPs requires access to percpu data
|
||||
* structures. Therefore, FRED reinitialization can only occur after
|
||||
* the percpu access pointer (i.e., MSR_GS_BASE) is restored.
|
||||
*/
|
||||
if (ctxt->cr4 & X86_CR4_FRED) {
|
||||
cpu_init_fred_exceptions();
|
||||
cpu_init_fred_rsps();
|
||||
}
|
||||
#else
|
||||
loadsegment(fs, __KERNEL_PERCPU);
|
||||
#endif
|
||||
|
||||
@@ -27,7 +27,6 @@ void get_regs_from_mc(struct uml_pt_regs *regs, mcontext_t *mc)
|
||||
COPY(RIP);
|
||||
COPY2(EFLAGS, EFL);
|
||||
COPY2(CS, CSGSFS);
|
||||
regs->gp[CS / sizeof(unsigned long)] &= 0xffff;
|
||||
regs->gp[CS / sizeof(unsigned long)] |= 3;
|
||||
regs->gp[SS / sizeof(unsigned long)] = mc->gregs[REG_CSGSFS] >> 48;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1349,14 +1349,15 @@ re_check:
|
||||
len = sectors;
|
||||
|
||||
update_sectors:
|
||||
/* This situation should never happen */
|
||||
WARN_ON(sectors < len);
|
||||
|
||||
s += len;
|
||||
sectors -= len;
|
||||
|
||||
if (sectors > 0)
|
||||
goto re_check;
|
||||
|
||||
WARN_ON(sectors < 0);
|
||||
|
||||
if (unacked_badblocks > 0)
|
||||
rv = -1;
|
||||
else if (acked_badblocks > 0)
|
||||
|
||||
17
block/bdev.c
17
block/bdev.c
@@ -173,9 +173,26 @@ int set_blocksize(struct file *file, int size)
|
||||
|
||||
/* Don't change the size if it is same as current */
|
||||
if (inode->i_blkbits != blksize_bits(size)) {
|
||||
/*
|
||||
* Flush and truncate the pagecache before we reconfigure the
|
||||
* mapping geometry because folio sizes are variable now. If a
|
||||
* reader has already allocated a folio whose size is smaller
|
||||
* than the new min_order but invokes readahead after the new
|
||||
* min_order becomes visible, readahead will think there are
|
||||
* "zero" blocks per folio and crash. Take the inode and
|
||||
* invalidation locks to avoid racing with
|
||||
* read/write/fallocate.
|
||||
*/
|
||||
inode_lock(inode);
|
||||
filemap_invalidate_lock(inode->i_mapping);
|
||||
|
||||
sync_blockdev(bdev);
|
||||
kill_bdev(bdev);
|
||||
|
||||
inode->i_blkbits = blksize_bits(size);
|
||||
kill_bdev(bdev);
|
||||
filemap_invalidate_unlock(inode->i_mapping);
|
||||
inode_unlock(inode);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1725,26 +1725,26 @@ int blkcg_policy_register(struct blkcg_policy *pol)
|
||||
struct blkcg *blkcg;
|
||||
int i, ret;
|
||||
|
||||
mutex_lock(&blkcg_pol_register_mutex);
|
||||
mutex_lock(&blkcg_pol_mutex);
|
||||
|
||||
/* find an empty slot */
|
||||
ret = -ENOSPC;
|
||||
for (i = 0; i < BLKCG_MAX_POLS; i++)
|
||||
if (!blkcg_policy[i])
|
||||
break;
|
||||
if (i >= BLKCG_MAX_POLS) {
|
||||
pr_warn("blkcg_policy_register: BLKCG_MAX_POLS too small\n");
|
||||
goto err_unlock;
|
||||
}
|
||||
|
||||
/*
|
||||
* Make sure cpd/pd_alloc_fn and cpd/pd_free_fn in pairs, and policy
|
||||
* without pd_alloc_fn/pd_free_fn can't be activated.
|
||||
*/
|
||||
if ((!pol->cpd_alloc_fn ^ !pol->cpd_free_fn) ||
|
||||
(!pol->pd_alloc_fn ^ !pol->pd_free_fn))
|
||||
return -EINVAL;
|
||||
|
||||
mutex_lock(&blkcg_pol_register_mutex);
|
||||
mutex_lock(&blkcg_pol_mutex);
|
||||
|
||||
/* find an empty slot */
|
||||
for (i = 0; i < BLKCG_MAX_POLS; i++)
|
||||
if (!blkcg_policy[i])
|
||||
break;
|
||||
if (i >= BLKCG_MAX_POLS) {
|
||||
pr_warn("blkcg_policy_register: BLKCG_MAX_POLS too small\n");
|
||||
ret = -ENOSPC;
|
||||
goto err_unlock;
|
||||
}
|
||||
|
||||
/* register @pol */
|
||||
pol->plid = i;
|
||||
@@ -1756,8 +1756,10 @@ int blkcg_policy_register(struct blkcg_policy *pol)
|
||||
struct blkcg_policy_data *cpd;
|
||||
|
||||
cpd = pol->cpd_alloc_fn(GFP_KERNEL);
|
||||
if (!cpd)
|
||||
if (!cpd) {
|
||||
ret = -ENOMEM;
|
||||
goto err_free_cpds;
|
||||
}
|
||||
|
||||
blkcg->cpd[pol->plid] = cpd;
|
||||
cpd->blkcg = blkcg;
|
||||
|
||||
@@ -347,6 +347,7 @@ int blkdev_zone_mgmt_ioctl(struct block_device *bdev, blk_mode_t mode,
|
||||
op = REQ_OP_ZONE_RESET;
|
||||
|
||||
/* Invalidate the page cache, including dirty pages. */
|
||||
inode_lock(bdev->bd_mapping->host);
|
||||
filemap_invalidate_lock(bdev->bd_mapping);
|
||||
ret = blkdev_truncate_zone_range(bdev, mode, &zrange);
|
||||
if (ret)
|
||||
@@ -368,8 +369,10 @@ int blkdev_zone_mgmt_ioctl(struct block_device *bdev, blk_mode_t mode,
|
||||
ret = blkdev_zone_mgmt(bdev, op, zrange.sector, zrange.nr_sectors);
|
||||
|
||||
fail:
|
||||
if (cmd == BLKRESETZONE)
|
||||
if (cmd == BLKRESETZONE) {
|
||||
filemap_invalidate_unlock(bdev->bd_mapping);
|
||||
inode_unlock(bdev->bd_mapping->host);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
16
block/fops.c
16
block/fops.c
@@ -721,7 +721,14 @@ static ssize_t blkdev_write_iter(struct kiocb *iocb, struct iov_iter *from)
|
||||
ret = direct_write_fallback(iocb, from, ret,
|
||||
blkdev_buffered_write(iocb, from));
|
||||
} else {
|
||||
/*
|
||||
* Take i_rwsem and invalidate_lock to avoid racing with
|
||||
* set_blocksize changing i_blkbits/folio order and punching
|
||||
* out the pagecache.
|
||||
*/
|
||||
inode_lock_shared(bd_inode);
|
||||
ret = blkdev_buffered_write(iocb, from);
|
||||
inode_unlock_shared(bd_inode);
|
||||
}
|
||||
|
||||
if (ret > 0)
|
||||
@@ -732,6 +739,7 @@ static ssize_t blkdev_write_iter(struct kiocb *iocb, struct iov_iter *from)
|
||||
|
||||
static ssize_t blkdev_read_iter(struct kiocb *iocb, struct iov_iter *to)
|
||||
{
|
||||
struct inode *bd_inode = bdev_file_inode(iocb->ki_filp);
|
||||
struct block_device *bdev = I_BDEV(iocb->ki_filp->f_mapping->host);
|
||||
loff_t size = bdev_nr_bytes(bdev);
|
||||
loff_t pos = iocb->ki_pos;
|
||||
@@ -768,7 +776,13 @@ static ssize_t blkdev_read_iter(struct kiocb *iocb, struct iov_iter *to)
|
||||
goto reexpand;
|
||||
}
|
||||
|
||||
/*
|
||||
* Take i_rwsem and invalidate_lock to avoid racing with set_blocksize
|
||||
* changing i_blkbits/folio order and punching out the pagecache.
|
||||
*/
|
||||
inode_lock_shared(bd_inode);
|
||||
ret = filemap_read(iocb, to, ret);
|
||||
inode_unlock_shared(bd_inode);
|
||||
|
||||
reexpand:
|
||||
if (unlikely(shorted))
|
||||
@@ -811,6 +825,7 @@ static long blkdev_fallocate(struct file *file, int mode, loff_t start,
|
||||
if ((start | len) & (bdev_logical_block_size(bdev) - 1))
|
||||
return -EINVAL;
|
||||
|
||||
inode_lock(inode);
|
||||
filemap_invalidate_lock(inode->i_mapping);
|
||||
|
||||
/*
|
||||
@@ -843,6 +858,7 @@ static long blkdev_fallocate(struct file *file, int mode, loff_t start,
|
||||
|
||||
fail:
|
||||
filemap_invalidate_unlock(inode->i_mapping);
|
||||
inode_unlock(inode);
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
@@ -141,6 +141,7 @@ static int blk_ioctl_discard(struct block_device *bdev, blk_mode_t mode,
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
inode_lock(bdev->bd_mapping->host);
|
||||
filemap_invalidate_lock(bdev->bd_mapping);
|
||||
err = truncate_bdev_range(bdev, mode, start, start + len - 1);
|
||||
if (err)
|
||||
@@ -173,6 +174,7 @@ out_unplug:
|
||||
blk_finish_plug(&plug);
|
||||
fail:
|
||||
filemap_invalidate_unlock(bdev->bd_mapping);
|
||||
inode_unlock(bdev->bd_mapping->host);
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -198,12 +200,14 @@ static int blk_ioctl_secure_erase(struct block_device *bdev, blk_mode_t mode,
|
||||
end > bdev_nr_bytes(bdev))
|
||||
return -EINVAL;
|
||||
|
||||
inode_lock(bdev->bd_mapping->host);
|
||||
filemap_invalidate_lock(bdev->bd_mapping);
|
||||
err = truncate_bdev_range(bdev, mode, start, end - 1);
|
||||
if (!err)
|
||||
err = blkdev_issue_secure_erase(bdev, start >> 9, len >> 9,
|
||||
GFP_KERNEL);
|
||||
filemap_invalidate_unlock(bdev->bd_mapping);
|
||||
inode_unlock(bdev->bd_mapping->host);
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -235,6 +239,7 @@ static int blk_ioctl_zeroout(struct block_device *bdev, blk_mode_t mode,
|
||||
return -EINVAL;
|
||||
|
||||
/* Invalidate the page cache, including dirty pages */
|
||||
inode_lock(bdev->bd_mapping->host);
|
||||
filemap_invalidate_lock(bdev->bd_mapping);
|
||||
err = truncate_bdev_range(bdev, mode, start, end);
|
||||
if (err)
|
||||
@@ -245,6 +250,7 @@ static int blk_ioctl_zeroout(struct block_device *bdev, blk_mode_t mode,
|
||||
|
||||
fail:
|
||||
filemap_invalidate_unlock(bdev->bd_mapping);
|
||||
inode_unlock(bdev->bd_mapping->host);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ static int __lzorle_compress(const u8 *src, unsigned int slen,
|
||||
size_t tmp_len = *dlen; /* size_t(ulong) <-> uint on 64 bit */
|
||||
int err;
|
||||
|
||||
err = lzorle1x_1_compress(src, slen, dst, &tmp_len, ctx);
|
||||
err = lzorle1x_1_compress_safe(src, slen, dst, &tmp_len, ctx);
|
||||
|
||||
if (err != LZO_E_OK)
|
||||
return -EINVAL;
|
||||
|
||||
@@ -55,7 +55,7 @@ static int __lzo_compress(const u8 *src, unsigned int slen,
|
||||
size_t tmp_len = *dlen; /* size_t(ulong) <-> uint on 64 bit */
|
||||
int err;
|
||||
|
||||
err = lzo1x_1_compress(src, slen, dst, &tmp_len, ctx);
|
||||
err = lzo1x_1_compress_safe(src, slen, dst, &tmp_len, ctx);
|
||||
|
||||
if (err != LZO_E_OK)
|
||||
return -EINVAL;
|
||||
|
||||
@@ -355,8 +355,10 @@ static bool acpi_pnp_match(const char *idstr, const struct acpi_device_id **matc
|
||||
* device represented by it.
|
||||
*/
|
||||
static const struct acpi_device_id acpi_nonpnp_device_ids[] = {
|
||||
{"INT3F0D"},
|
||||
{"INTC1080"},
|
||||
{"INTC1081"},
|
||||
{"INTC1099"},
|
||||
{""},
|
||||
};
|
||||
|
||||
|
||||
@@ -595,18 +595,19 @@ static int charlcd_init(struct charlcd *lcd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct charlcd *charlcd_alloc(void)
|
||||
struct charlcd *charlcd_alloc(unsigned int drvdata_size)
|
||||
{
|
||||
struct charlcd_priv *priv;
|
||||
struct charlcd *lcd;
|
||||
|
||||
priv = kzalloc(sizeof(*priv), GFP_KERNEL);
|
||||
priv = kzalloc(sizeof(*priv) + drvdata_size, GFP_KERNEL);
|
||||
if (!priv)
|
||||
return NULL;
|
||||
|
||||
priv->esc_seq.len = -1;
|
||||
|
||||
lcd = &priv->lcd;
|
||||
lcd->drvdata = priv->drvdata;
|
||||
|
||||
return lcd;
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ struct charlcd {
|
||||
unsigned long y;
|
||||
} addr;
|
||||
|
||||
void *drvdata;
|
||||
void *drvdata; /* Set by charlcd_alloc() */
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -95,7 +95,8 @@ struct charlcd_ops {
|
||||
};
|
||||
|
||||
void charlcd_backlight(struct charlcd *lcd, enum charlcd_onoff on);
|
||||
struct charlcd *charlcd_alloc(void);
|
||||
|
||||
struct charlcd *charlcd_alloc(unsigned int drvdata_size);
|
||||
void charlcd_free(struct charlcd *lcd);
|
||||
|
||||
int charlcd_register(struct charlcd *lcd);
|
||||
|
||||
@@ -226,7 +226,7 @@ static int hd44780_probe(struct platform_device *pdev)
|
||||
if (!hdc)
|
||||
return -ENOMEM;
|
||||
|
||||
lcd = charlcd_alloc();
|
||||
lcd = charlcd_alloc(0);
|
||||
if (!lcd)
|
||||
goto fail1;
|
||||
|
||||
|
||||
@@ -307,7 +307,7 @@ static int lcd2s_i2c_probe(struct i2c_client *i2c)
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
lcd = charlcd_alloc();
|
||||
lcd = charlcd_alloc(0);
|
||||
if (!lcd)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -835,7 +835,7 @@ static void lcd_init(void)
|
||||
if (!hdc)
|
||||
return;
|
||||
|
||||
charlcd = charlcd_alloc();
|
||||
charlcd = charlcd_alloc(0);
|
||||
if (!charlcd) {
|
||||
kfree(hdc);
|
||||
return;
|
||||
|
||||
@@ -610,7 +610,8 @@ static void btmtksdio_txrx_work(struct work_struct *work)
|
||||
} while (int_status || time_is_before_jiffies(txrx_timeout));
|
||||
|
||||
/* Enable interrupt */
|
||||
sdio_writel(bdev->func, C_INT_EN_SET, MTK_REG_CHLPCR, NULL);
|
||||
if (bdev->func->irq_handler)
|
||||
sdio_writel(bdev->func, C_INT_EN_SET, MTK_REG_CHLPCR, NULL);
|
||||
|
||||
sdio_release_host(bdev->func);
|
||||
|
||||
|
||||
@@ -974,7 +974,7 @@ int tpm2_start_auth_session(struct tpm_chip *chip)
|
||||
int rc;
|
||||
|
||||
if (chip->auth) {
|
||||
dev_warn_once(&chip->dev, "auth session is active\n");
|
||||
dev_dbg_once(&chip->dev, "auth session is active\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2025, Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/clk-provider.h>
|
||||
@@ -713,14 +714,24 @@ static const struct qcom_reset_map lpass_audio_cc_sc7280_resets[] = {
|
||||
[LPASS_AUDIO_SWR_WSA_CGCR] = { 0xb0, 1 },
|
||||
};
|
||||
|
||||
static const struct regmap_config lpass_audio_cc_sc7280_reset_regmap_config = {
|
||||
.name = "lpassaudio_cc_reset",
|
||||
.reg_bits = 32,
|
||||
.reg_stride = 4,
|
||||
.val_bits = 32,
|
||||
.fast_io = true,
|
||||
.max_register = 0xc8,
|
||||
};
|
||||
|
||||
static const struct qcom_cc_desc lpass_audio_cc_reset_sc7280_desc = {
|
||||
.config = &lpass_audio_cc_sc7280_regmap_config,
|
||||
.config = &lpass_audio_cc_sc7280_reset_regmap_config,
|
||||
.resets = lpass_audio_cc_sc7280_resets,
|
||||
.num_resets = ARRAY_SIZE(lpass_audio_cc_sc7280_resets),
|
||||
};
|
||||
|
||||
static const struct of_device_id lpass_audio_cc_sc7280_match_table[] = {
|
||||
{ .compatible = "qcom,sc7280-lpassaudiocc" },
|
||||
{ .compatible = "qcom,qcm6490-lpassaudiocc", .data = &lpass_audio_cc_reset_sc7280_desc },
|
||||
{ .compatible = "qcom,sc7280-lpassaudiocc", .data = &lpass_audio_cc_sc7280_desc },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, lpass_audio_cc_sc7280_match_table);
|
||||
@@ -752,13 +763,17 @@ static int lpass_audio_cc_sc7280_probe(struct platform_device *pdev)
|
||||
struct regmap *regmap;
|
||||
int ret;
|
||||
|
||||
desc = device_get_match_data(&pdev->dev);
|
||||
|
||||
if (of_device_is_compatible(pdev->dev.of_node, "qcom,qcm6490-lpassaudiocc"))
|
||||
return qcom_cc_probe_by_index(pdev, 1, desc);
|
||||
|
||||
ret = lpass_audio_setup_runtime_pm(pdev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
lpass_audio_cc_sc7280_regmap_config.name = "lpassaudio_cc";
|
||||
lpass_audio_cc_sc7280_regmap_config.max_register = 0x2f000;
|
||||
desc = &lpass_audio_cc_sc7280_desc;
|
||||
|
||||
regmap = qcom_cc_map(pdev, desc);
|
||||
if (IS_ERR(regmap)) {
|
||||
@@ -772,7 +787,7 @@ static int lpass_audio_cc_sc7280_probe(struct platform_device *pdev)
|
||||
regmap_write(regmap, 0x4, 0x3b);
|
||||
regmap_write(regmap, 0x8, 0xff05);
|
||||
|
||||
ret = qcom_cc_really_probe(&pdev->dev, &lpass_audio_cc_sc7280_desc, regmap);
|
||||
ret = qcom_cc_really_probe(&pdev->dev, desc, regmap);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "Failed to register LPASS AUDIO CC clocks\n");
|
||||
goto exit;
|
||||
|
||||
@@ -126,7 +126,13 @@ static int riscv_timer_starting_cpu(unsigned int cpu)
|
||||
|
||||
static int riscv_timer_dying_cpu(unsigned int cpu)
|
||||
{
|
||||
/*
|
||||
* Stop the timer when the cpu is going to be offline otherwise
|
||||
* the timer interrupt may be pending while performing power-down.
|
||||
*/
|
||||
riscv_clock_event_stop();
|
||||
disable_percpu_irq(riscv_clock_event_irq);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -172,6 +172,7 @@ static const struct of_device_id blocklist[] __initconst = {
|
||||
{ .compatible = "qcom,sm8350", },
|
||||
{ .compatible = "qcom,sm8450", },
|
||||
{ .compatible = "qcom,sm8550", },
|
||||
{ .compatible = "qcom,sm8650", },
|
||||
|
||||
{ .compatible = "st,stih407", },
|
||||
{ .compatible = "st,stih410", },
|
||||
|
||||
@@ -73,11 +73,18 @@ static int tegra186_cpufreq_init(struct cpufreq_policy *policy)
|
||||
{
|
||||
struct tegra186_cpufreq_data *data = cpufreq_get_driver_data();
|
||||
unsigned int cluster = data->cpus[policy->cpu].bpmp_cluster_id;
|
||||
u32 cpu;
|
||||
|
||||
policy->freq_table = data->clusters[cluster].table;
|
||||
policy->cpuinfo.transition_latency = 300 * 1000;
|
||||
policy->driver_data = NULL;
|
||||
|
||||
/* set same policy for all cpus in a cluster */
|
||||
for (cpu = 0; cpu < ARRAY_SIZE(tegra186_cpus); cpu++) {
|
||||
if (data->cpus[cpu].bpmp_cluster_id == cluster)
|
||||
cpumask_set_cpu(cpu, policy->cpus);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -264,9 +264,10 @@ static int cpt_process_ccode(struct otx2_cptlfs_info *lfs,
|
||||
break;
|
||||
}
|
||||
|
||||
dev_err(&pdev->dev,
|
||||
"Request failed with software error code 0x%x\n",
|
||||
cpt_status->s.uc_compcode);
|
||||
pr_debug("Request failed with software error code 0x%x: algo = %s driver = %s\n",
|
||||
cpt_status->s.uc_compcode,
|
||||
info->req->areq->tfm->__crt_alg->cra_name,
|
||||
info->req->areq->tfm->__crt_alg->cra_driver_name);
|
||||
otx2_cpt_dump_sg_list(pdev, info->req);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -265,12 +265,12 @@ static int mxs_dcp_run_aes(struct dcp_async_ctx *actx,
|
||||
MXS_DCP_CONTROL0_INTERRUPT |
|
||||
MXS_DCP_CONTROL0_ENABLE_CIPHER;
|
||||
|
||||
if (key_referenced)
|
||||
/* Set OTP key bit to select the key via KEY_SELECT. */
|
||||
desc->control0 |= MXS_DCP_CONTROL0_OTP_KEY;
|
||||
else
|
||||
if (!key_referenced)
|
||||
/* Payload contains the key. */
|
||||
desc->control0 |= MXS_DCP_CONTROL0_PAYLOAD_KEY;
|
||||
else if (actx->key[0] == DCP_PAES_KEY_OTP)
|
||||
/* Set OTP key bit to select the key via KEY_SELECT. */
|
||||
desc->control0 |= MXS_DCP_CONTROL0_OTP_KEY;
|
||||
|
||||
if (rctx->enc)
|
||||
desc->control0 |= MXS_DCP_CONTROL0_CIPHER_ENCRYPT;
|
||||
|
||||
@@ -170,6 +170,24 @@ static ssize_t amdgpu_device_get_pcie_replay_count(struct device *dev,
|
||||
static DEVICE_ATTR(pcie_replay_count, 0444,
|
||||
amdgpu_device_get_pcie_replay_count, NULL);
|
||||
|
||||
static int amdgpu_device_attr_sysfs_init(struct amdgpu_device *adev)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (!amdgpu_sriov_vf(adev))
|
||||
ret = sysfs_create_file(&adev->dev->kobj,
|
||||
&dev_attr_pcie_replay_count.attr);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void amdgpu_device_attr_sysfs_fini(struct amdgpu_device *adev)
|
||||
{
|
||||
if (!amdgpu_sriov_vf(adev))
|
||||
sysfs_remove_file(&adev->dev->kobj,
|
||||
&dev_attr_pcie_replay_count.attr);
|
||||
}
|
||||
|
||||
static ssize_t amdgpu_sysfs_reg_state_get(struct file *f, struct kobject *kobj,
|
||||
struct bin_attribute *attr, char *buf,
|
||||
loff_t ppos, size_t count)
|
||||
@@ -4030,11 +4048,6 @@ static bool amdgpu_device_check_iommu_remap(struct amdgpu_device *adev)
|
||||
}
|
||||
#endif
|
||||
|
||||
static const struct attribute *amdgpu_dev_attributes[] = {
|
||||
&dev_attr_pcie_replay_count.attr,
|
||||
NULL
|
||||
};
|
||||
|
||||
static void amdgpu_device_set_mcbp(struct amdgpu_device *adev)
|
||||
{
|
||||
if (amdgpu_mcbp == 1)
|
||||
@@ -4477,7 +4490,7 @@ fence_driver_init:
|
||||
} else
|
||||
adev->ucode_sysfs_en = true;
|
||||
|
||||
r = sysfs_create_files(&adev->dev->kobj, amdgpu_dev_attributes);
|
||||
r = amdgpu_device_attr_sysfs_init(adev);
|
||||
if (r)
|
||||
dev_err(adev->dev, "Could not create amdgpu device attr\n");
|
||||
|
||||
@@ -4614,7 +4627,7 @@ void amdgpu_device_fini_hw(struct amdgpu_device *adev)
|
||||
amdgpu_pm_sysfs_fini(adev);
|
||||
if (adev->ucode_sysfs_en)
|
||||
amdgpu_ucode_sysfs_fini(adev);
|
||||
sysfs_remove_files(&adev->dev->kobj, amdgpu_dev_attributes);
|
||||
amdgpu_device_attr_sysfs_fini(adev);
|
||||
amdgpu_fru_sysfs_fini(adev);
|
||||
|
||||
amdgpu_reg_state_sysfs_fini(adev);
|
||||
@@ -4664,6 +4677,9 @@ void amdgpu_device_fini_sw(struct amdgpu_device *adev)
|
||||
kfree(adev->fru_info);
|
||||
adev->fru_info = NULL;
|
||||
|
||||
kfree(adev->xcp_mgr);
|
||||
adev->xcp_mgr = NULL;
|
||||
|
||||
px = amdgpu_device_supports_px(adev_to_drm(adev));
|
||||
|
||||
if (px || (!dev_is_removable(&adev->pdev->dev) &&
|
||||
|
||||
@@ -111,8 +111,7 @@
|
||||
#include "amdgpu_isp.h"
|
||||
#endif
|
||||
|
||||
#define FIRMWARE_IP_DISCOVERY "amdgpu/ip_discovery.bin"
|
||||
MODULE_FIRMWARE(FIRMWARE_IP_DISCOVERY);
|
||||
MODULE_FIRMWARE("amdgpu/ip_discovery.bin");
|
||||
|
||||
#define mmIP_DISCOVERY_VERSION 0x16A00
|
||||
#define mmRCC_CONFIG_MEMSIZE 0xde3
|
||||
@@ -295,21 +294,13 @@ static int amdgpu_discovery_read_binary_from_mem(struct amdgpu_device *adev,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int amdgpu_discovery_read_binary_from_file(struct amdgpu_device *adev, uint8_t *binary)
|
||||
static int amdgpu_discovery_read_binary_from_file(struct amdgpu_device *adev,
|
||||
uint8_t *binary,
|
||||
const char *fw_name)
|
||||
{
|
||||
const struct firmware *fw;
|
||||
const char *fw_name;
|
||||
int r;
|
||||
|
||||
switch (amdgpu_discovery) {
|
||||
case 2:
|
||||
fw_name = FIRMWARE_IP_DISCOVERY;
|
||||
break;
|
||||
default:
|
||||
dev_warn(adev->dev, "amdgpu_discovery is not set properly\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
r = request_firmware(&fw, fw_name, adev->dev);
|
||||
if (r) {
|
||||
dev_err(adev->dev, "can't load firmware \"%s\"\n",
|
||||
@@ -402,10 +393,19 @@ static int amdgpu_discovery_verify_npsinfo(struct amdgpu_device *adev,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const char *amdgpu_discovery_get_fw_name(struct amdgpu_device *adev)
|
||||
{
|
||||
if (amdgpu_discovery == 2)
|
||||
return "amdgpu/ip_discovery.bin";
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int amdgpu_discovery_init(struct amdgpu_device *adev)
|
||||
{
|
||||
struct table_info *info;
|
||||
struct binary_header *bhdr;
|
||||
const char *fw_name;
|
||||
uint16_t offset;
|
||||
uint16_t size;
|
||||
uint16_t checksum;
|
||||
@@ -417,9 +417,10 @@ static int amdgpu_discovery_init(struct amdgpu_device *adev)
|
||||
return -ENOMEM;
|
||||
|
||||
/* Read from file if it is the preferred option */
|
||||
if (amdgpu_discovery == 2) {
|
||||
fw_name = amdgpu_discovery_get_fw_name(adev);
|
||||
if (fw_name != NULL) {
|
||||
dev_info(adev->dev, "use ip discovery information from file");
|
||||
r = amdgpu_discovery_read_binary_from_file(adev, adev->mman.discovery_bin);
|
||||
r = amdgpu_discovery_read_binary_from_file(adev, adev->mman.discovery_bin, fw_name);
|
||||
|
||||
if (r) {
|
||||
dev_err(adev->dev, "failed to read ip discovery binary from file\n");
|
||||
|
||||
@@ -42,6 +42,29 @@
|
||||
#include <linux/dma-fence-array.h>
|
||||
#include <linux/pci-p2pdma.h>
|
||||
|
||||
static const struct dma_buf_attach_ops amdgpu_dma_buf_attach_ops;
|
||||
|
||||
/**
|
||||
* dma_buf_attach_adev - Helper to get adev of an attachment
|
||||
*
|
||||
* @attach: attachment
|
||||
*
|
||||
* Returns:
|
||||
* A struct amdgpu_device * if the attaching device is an amdgpu device or
|
||||
* partition, NULL otherwise.
|
||||
*/
|
||||
static struct amdgpu_device *dma_buf_attach_adev(struct dma_buf_attachment *attach)
|
||||
{
|
||||
if (attach->importer_ops == &amdgpu_dma_buf_attach_ops) {
|
||||
struct drm_gem_object *obj = attach->importer_priv;
|
||||
struct amdgpu_bo *bo = gem_to_amdgpu_bo(obj);
|
||||
|
||||
return amdgpu_ttm_adev(bo->tbo.bdev);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* amdgpu_dma_buf_attach - &dma_buf_ops.attach implementation
|
||||
*
|
||||
@@ -53,11 +76,13 @@
|
||||
static int amdgpu_dma_buf_attach(struct dma_buf *dmabuf,
|
||||
struct dma_buf_attachment *attach)
|
||||
{
|
||||
struct amdgpu_device *attach_adev = dma_buf_attach_adev(attach);
|
||||
struct drm_gem_object *obj = dmabuf->priv;
|
||||
struct amdgpu_bo *bo = gem_to_amdgpu_bo(obj);
|
||||
struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev);
|
||||
|
||||
if (pci_p2pdma_distance(adev->pdev, attach->dev, false) < 0)
|
||||
if (!amdgpu_dmabuf_is_xgmi_accessible(attach_adev, bo) &&
|
||||
pci_p2pdma_distance(adev->pdev, attach->dev, false) < 0)
|
||||
attach->peer2peer = false;
|
||||
|
||||
return 0;
|
||||
@@ -456,6 +481,9 @@ bool amdgpu_dmabuf_is_xgmi_accessible(struct amdgpu_device *adev,
|
||||
struct drm_gem_object *obj = &bo->tbo.base;
|
||||
struct drm_gem_object *gobj;
|
||||
|
||||
if (!adev)
|
||||
return false;
|
||||
|
||||
if (obj->import_attach) {
|
||||
struct dma_buf *dma_buf = obj->import_attach->dmabuf;
|
||||
|
||||
|
||||
@@ -172,6 +172,7 @@ uint amdgpu_sdma_phase_quantum = 32;
|
||||
char *amdgpu_disable_cu;
|
||||
char *amdgpu_virtual_display;
|
||||
bool enforce_isolation;
|
||||
int amdgpu_modeset = -1;
|
||||
|
||||
/* Specifies the default granularity for SVM, used in buffer
|
||||
* migration and restoration of backing memory when handling
|
||||
@@ -1037,6 +1038,13 @@ module_param_named(user_partt_mode, amdgpu_user_partt_mode, uint, 0444);
|
||||
module_param(enforce_isolation, bool, 0444);
|
||||
MODULE_PARM_DESC(enforce_isolation, "enforce process isolation between graphics and compute . enforce_isolation = on");
|
||||
|
||||
/**
|
||||
* DOC: modeset (int)
|
||||
* Override nomodeset (1 = override, -1 = auto). The default is -1 (auto).
|
||||
*/
|
||||
MODULE_PARM_DESC(modeset, "Override nomodeset (1 = enable, -1 = auto)");
|
||||
module_param_named(modeset, amdgpu_modeset, int, 0444);
|
||||
|
||||
/**
|
||||
* DOC: seamless (int)
|
||||
* Seamless boot will keep the image on the screen during the boot process.
|
||||
@@ -2248,6 +2256,12 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
|
||||
int ret, retry = 0, i;
|
||||
bool supports_atomic = false;
|
||||
|
||||
if ((pdev->class >> 8) == PCI_CLASS_DISPLAY_VGA ||
|
||||
(pdev->class >> 8) == PCI_CLASS_DISPLAY_OTHER) {
|
||||
if (drm_firmware_drivers_only() && amdgpu_modeset == -1)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* skip devices which are owned by radeon */
|
||||
for (i = 0; i < ARRAY_SIZE(amdgpu_unsupported_pciidlist); i++) {
|
||||
if (amdgpu_unsupported_pciidlist[i] == pdev->device)
|
||||
|
||||
@@ -78,6 +78,9 @@ struct amdgpu_ih_ring {
|
||||
#define amdgpu_ih_ts_after(t1, t2) \
|
||||
(((int64_t)((t2) << 16) - (int64_t)((t1) << 16)) > 0LL)
|
||||
|
||||
#define amdgpu_ih_ts_after_or_equal(t1, t2) \
|
||||
(((int64_t)((t2) << 16) - (int64_t)((t1) << 16)) >= 0LL)
|
||||
|
||||
/* provided by the ih block */
|
||||
struct amdgpu_ih_funcs {
|
||||
/* ring read/write ptr handling, called from interrupt context */
|
||||
|
||||
@@ -63,6 +63,23 @@
|
||||
#define regPC_CONFIG_CNTL_1 0x194d
|
||||
#define regPC_CONFIG_CNTL_1_BASE_IDX 1
|
||||
|
||||
#define regCP_GFX_MQD_CONTROL_DEFAULT 0x00000100
|
||||
#define regCP_GFX_HQD_VMID_DEFAULT 0x00000000
|
||||
#define regCP_GFX_HQD_QUEUE_PRIORITY_DEFAULT 0x00000000
|
||||
#define regCP_GFX_HQD_QUANTUM_DEFAULT 0x00000a01
|
||||
#define regCP_GFX_HQD_CNTL_DEFAULT 0x00a00000
|
||||
#define regCP_RB_DOORBELL_CONTROL_DEFAULT 0x00000000
|
||||
#define regCP_GFX_HQD_RPTR_DEFAULT 0x00000000
|
||||
|
||||
#define regCP_HQD_EOP_CONTROL_DEFAULT 0x00000006
|
||||
#define regCP_HQD_PQ_DOORBELL_CONTROL_DEFAULT 0x00000000
|
||||
#define regCP_MQD_CONTROL_DEFAULT 0x00000100
|
||||
#define regCP_HQD_PQ_CONTROL_DEFAULT 0x00308509
|
||||
#define regCP_HQD_PQ_DOORBELL_CONTROL_DEFAULT 0x00000000
|
||||
#define regCP_HQD_PQ_RPTR_DEFAULT 0x00000000
|
||||
#define regCP_HQD_PERSISTENT_STATE_DEFAULT 0x0be05501
|
||||
#define regCP_HQD_IB_CONTROL_DEFAULT 0x00300000
|
||||
|
||||
MODULE_FIRMWARE("amdgpu/gc_11_0_0_pfp.bin");
|
||||
MODULE_FIRMWARE("amdgpu/gc_11_0_0_me.bin");
|
||||
MODULE_FIRMWARE("amdgpu/gc_11_0_0_mec.bin");
|
||||
@@ -3896,7 +3913,7 @@ static void gfx_v11_0_gfx_mqd_set_priority(struct amdgpu_device *adev,
|
||||
if (prop->hqd_pipe_priority == AMDGPU_GFX_PIPE_PRIO_HIGH)
|
||||
priority = 1;
|
||||
|
||||
tmp = RREG32_SOC15(GC, 0, regCP_GFX_HQD_QUEUE_PRIORITY);
|
||||
tmp = regCP_GFX_HQD_QUEUE_PRIORITY_DEFAULT;
|
||||
tmp = REG_SET_FIELD(tmp, CP_GFX_HQD_QUEUE_PRIORITY, PRIORITY_LEVEL, priority);
|
||||
mqd->cp_gfx_hqd_queue_priority = tmp;
|
||||
}
|
||||
@@ -3918,14 +3935,14 @@ static int gfx_v11_0_gfx_mqd_init(struct amdgpu_device *adev, void *m,
|
||||
mqd->cp_mqd_base_addr_hi = upper_32_bits(prop->mqd_gpu_addr);
|
||||
|
||||
/* set up mqd control */
|
||||
tmp = RREG32_SOC15(GC, 0, regCP_GFX_MQD_CONTROL);
|
||||
tmp = regCP_GFX_MQD_CONTROL_DEFAULT;
|
||||
tmp = REG_SET_FIELD(tmp, CP_GFX_MQD_CONTROL, VMID, 0);
|
||||
tmp = REG_SET_FIELD(tmp, CP_GFX_MQD_CONTROL, PRIV_STATE, 1);
|
||||
tmp = REG_SET_FIELD(tmp, CP_GFX_MQD_CONTROL, CACHE_POLICY, 0);
|
||||
mqd->cp_gfx_mqd_control = tmp;
|
||||
|
||||
/* set up gfx_hqd_vimd with 0x0 to indicate the ring buffer's vmid */
|
||||
tmp = RREG32_SOC15(GC, 0, regCP_GFX_HQD_VMID);
|
||||
tmp = regCP_GFX_HQD_VMID_DEFAULT;
|
||||
tmp = REG_SET_FIELD(tmp, CP_GFX_HQD_VMID, VMID, 0);
|
||||
mqd->cp_gfx_hqd_vmid = 0;
|
||||
|
||||
@@ -3933,7 +3950,7 @@ static int gfx_v11_0_gfx_mqd_init(struct amdgpu_device *adev, void *m,
|
||||
gfx_v11_0_gfx_mqd_set_priority(adev, mqd, prop);
|
||||
|
||||
/* set up time quantum */
|
||||
tmp = RREG32_SOC15(GC, 0, regCP_GFX_HQD_QUANTUM);
|
||||
tmp = regCP_GFX_HQD_QUANTUM_DEFAULT;
|
||||
tmp = REG_SET_FIELD(tmp, CP_GFX_HQD_QUANTUM, QUANTUM_EN, 1);
|
||||
mqd->cp_gfx_hqd_quantum = tmp;
|
||||
|
||||
@@ -3955,7 +3972,7 @@ static int gfx_v11_0_gfx_mqd_init(struct amdgpu_device *adev, void *m,
|
||||
|
||||
/* set up the gfx_hqd_control, similar as CP_RB0_CNTL */
|
||||
rb_bufsz = order_base_2(prop->queue_size / 4) - 1;
|
||||
tmp = RREG32_SOC15(GC, 0, regCP_GFX_HQD_CNTL);
|
||||
tmp = regCP_GFX_HQD_CNTL_DEFAULT;
|
||||
tmp = REG_SET_FIELD(tmp, CP_GFX_HQD_CNTL, RB_BUFSZ, rb_bufsz);
|
||||
tmp = REG_SET_FIELD(tmp, CP_GFX_HQD_CNTL, RB_BLKSZ, rb_bufsz - 2);
|
||||
#ifdef __BIG_ENDIAN
|
||||
@@ -3964,7 +3981,7 @@ static int gfx_v11_0_gfx_mqd_init(struct amdgpu_device *adev, void *m,
|
||||
mqd->cp_gfx_hqd_cntl = tmp;
|
||||
|
||||
/* set up cp_doorbell_control */
|
||||
tmp = RREG32_SOC15(GC, 0, regCP_RB_DOORBELL_CONTROL);
|
||||
tmp = regCP_RB_DOORBELL_CONTROL_DEFAULT;
|
||||
if (prop->use_doorbell) {
|
||||
tmp = REG_SET_FIELD(tmp, CP_RB_DOORBELL_CONTROL,
|
||||
DOORBELL_OFFSET, prop->doorbell_index);
|
||||
@@ -3976,7 +3993,7 @@ static int gfx_v11_0_gfx_mqd_init(struct amdgpu_device *adev, void *m,
|
||||
mqd->cp_rb_doorbell_control = tmp;
|
||||
|
||||
/* reset read and write pointers, similar to CP_RB0_WPTR/_RPTR */
|
||||
mqd->cp_gfx_hqd_rptr = RREG32_SOC15(GC, 0, regCP_GFX_HQD_RPTR);
|
||||
mqd->cp_gfx_hqd_rptr = regCP_GFX_HQD_RPTR_DEFAULT;
|
||||
|
||||
/* active the queue */
|
||||
mqd->cp_gfx_hqd_active = 1;
|
||||
@@ -4062,14 +4079,14 @@ static int gfx_v11_0_compute_mqd_init(struct amdgpu_device *adev, void *m,
|
||||
mqd->cp_hqd_eop_base_addr_hi = upper_32_bits(eop_base_addr);
|
||||
|
||||
/* set the EOP size, register value is 2^(EOP_SIZE+1) dwords */
|
||||
tmp = RREG32_SOC15(GC, 0, regCP_HQD_EOP_CONTROL);
|
||||
tmp = regCP_HQD_EOP_CONTROL_DEFAULT;
|
||||
tmp = REG_SET_FIELD(tmp, CP_HQD_EOP_CONTROL, EOP_SIZE,
|
||||
(order_base_2(GFX11_MEC_HPD_SIZE / 4) - 1));
|
||||
|
||||
mqd->cp_hqd_eop_control = tmp;
|
||||
|
||||
/* enable doorbell? */
|
||||
tmp = RREG32_SOC15(GC, 0, regCP_HQD_PQ_DOORBELL_CONTROL);
|
||||
tmp = regCP_HQD_PQ_DOORBELL_CONTROL_DEFAULT;
|
||||
|
||||
if (prop->use_doorbell) {
|
||||
tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_DOORBELL_CONTROL,
|
||||
@@ -4098,7 +4115,7 @@ static int gfx_v11_0_compute_mqd_init(struct amdgpu_device *adev, void *m,
|
||||
mqd->cp_mqd_base_addr_hi = upper_32_bits(prop->mqd_gpu_addr);
|
||||
|
||||
/* set MQD vmid to 0 */
|
||||
tmp = RREG32_SOC15(GC, 0, regCP_MQD_CONTROL);
|
||||
tmp = regCP_MQD_CONTROL_DEFAULT;
|
||||
tmp = REG_SET_FIELD(tmp, CP_MQD_CONTROL, VMID, 0);
|
||||
mqd->cp_mqd_control = tmp;
|
||||
|
||||
@@ -4108,7 +4125,7 @@ static int gfx_v11_0_compute_mqd_init(struct amdgpu_device *adev, void *m,
|
||||
mqd->cp_hqd_pq_base_hi = upper_32_bits(hqd_gpu_addr);
|
||||
|
||||
/* set up the HQD, this is similar to CP_RB0_CNTL */
|
||||
tmp = RREG32_SOC15(GC, 0, regCP_HQD_PQ_CONTROL);
|
||||
tmp = regCP_HQD_PQ_CONTROL_DEFAULT;
|
||||
tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL, QUEUE_SIZE,
|
||||
(order_base_2(prop->queue_size / 4) - 1));
|
||||
tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL, RPTR_BLOCK_SIZE,
|
||||
@@ -4134,7 +4151,7 @@ static int gfx_v11_0_compute_mqd_init(struct amdgpu_device *adev, void *m,
|
||||
tmp = 0;
|
||||
/* enable the doorbell if requested */
|
||||
if (prop->use_doorbell) {
|
||||
tmp = RREG32_SOC15(GC, 0, regCP_HQD_PQ_DOORBELL_CONTROL);
|
||||
tmp = regCP_HQD_PQ_DOORBELL_CONTROL_DEFAULT;
|
||||
tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_DOORBELL_CONTROL,
|
||||
DOORBELL_OFFSET, prop->doorbell_index);
|
||||
|
||||
@@ -4149,17 +4166,17 @@ static int gfx_v11_0_compute_mqd_init(struct amdgpu_device *adev, void *m,
|
||||
mqd->cp_hqd_pq_doorbell_control = tmp;
|
||||
|
||||
/* reset read and write pointers, similar to CP_RB0_WPTR/_RPTR */
|
||||
mqd->cp_hqd_pq_rptr = RREG32_SOC15(GC, 0, regCP_HQD_PQ_RPTR);
|
||||
mqd->cp_hqd_pq_rptr = regCP_HQD_PQ_RPTR_DEFAULT;
|
||||
|
||||
/* set the vmid for the queue */
|
||||
mqd->cp_hqd_vmid = 0;
|
||||
|
||||
tmp = RREG32_SOC15(GC, 0, regCP_HQD_PERSISTENT_STATE);
|
||||
tmp = regCP_HQD_PERSISTENT_STATE_DEFAULT;
|
||||
tmp = REG_SET_FIELD(tmp, CP_HQD_PERSISTENT_STATE, PRELOAD_SIZE, 0x55);
|
||||
mqd->cp_hqd_persistent_state = tmp;
|
||||
|
||||
/* set MIN_IB_AVAIL_SIZE */
|
||||
tmp = RREG32_SOC15(GC, 0, regCP_HQD_IB_CONTROL);
|
||||
tmp = regCP_HQD_IB_CONTROL_DEFAULT;
|
||||
tmp = REG_SET_FIELD(tmp, CP_HQD_IB_CONTROL, MIN_IB_AVAIL_SIZE, 3);
|
||||
mqd->cp_hqd_ib_control = tmp;
|
||||
|
||||
|
||||
@@ -52,6 +52,24 @@
|
||||
|
||||
#define RLCG_UCODE_LOADING_START_ADDRESS 0x00002000L
|
||||
|
||||
#define regCP_GFX_MQD_CONTROL_DEFAULT 0x00000100
|
||||
#define regCP_GFX_HQD_VMID_DEFAULT 0x00000000
|
||||
#define regCP_GFX_HQD_QUEUE_PRIORITY_DEFAULT 0x00000000
|
||||
#define regCP_GFX_HQD_QUANTUM_DEFAULT 0x00000a01
|
||||
#define regCP_GFX_HQD_CNTL_DEFAULT 0x00f00000
|
||||
#define regCP_RB_DOORBELL_CONTROL_DEFAULT 0x00000000
|
||||
#define regCP_GFX_HQD_RPTR_DEFAULT 0x00000000
|
||||
|
||||
#define regCP_HQD_EOP_CONTROL_DEFAULT 0x00000006
|
||||
#define regCP_HQD_PQ_DOORBELL_CONTROL_DEFAULT 0x00000000
|
||||
#define regCP_MQD_CONTROL_DEFAULT 0x00000100
|
||||
#define regCP_HQD_PQ_CONTROL_DEFAULT 0x00308509
|
||||
#define regCP_HQD_PQ_DOORBELL_CONTROL_DEFAULT 0x00000000
|
||||
#define regCP_HQD_PQ_RPTR_DEFAULT 0x00000000
|
||||
#define regCP_HQD_PERSISTENT_STATE_DEFAULT 0x0be05501
|
||||
#define regCP_HQD_IB_CONTROL_DEFAULT 0x00300000
|
||||
|
||||
|
||||
MODULE_FIRMWARE("amdgpu/gc_12_0_0_pfp.bin");
|
||||
MODULE_FIRMWARE("amdgpu/gc_12_0_0_me.bin");
|
||||
MODULE_FIRMWARE("amdgpu/gc_12_0_0_mec.bin");
|
||||
@@ -2851,25 +2869,25 @@ static int gfx_v12_0_gfx_mqd_init(struct amdgpu_device *adev, void *m,
|
||||
mqd->cp_mqd_base_addr_hi = upper_32_bits(prop->mqd_gpu_addr);
|
||||
|
||||
/* set up mqd control */
|
||||
tmp = RREG32_SOC15(GC, 0, regCP_GFX_MQD_CONTROL);
|
||||
tmp = regCP_GFX_MQD_CONTROL_DEFAULT;
|
||||
tmp = REG_SET_FIELD(tmp, CP_GFX_MQD_CONTROL, VMID, 0);
|
||||
tmp = REG_SET_FIELD(tmp, CP_GFX_MQD_CONTROL, PRIV_STATE, 1);
|
||||
tmp = REG_SET_FIELD(tmp, CP_GFX_MQD_CONTROL, CACHE_POLICY, 0);
|
||||
mqd->cp_gfx_mqd_control = tmp;
|
||||
|
||||
/* set up gfx_hqd_vimd with 0x0 to indicate the ring buffer's vmid */
|
||||
tmp = RREG32_SOC15(GC, 0, regCP_GFX_HQD_VMID);
|
||||
tmp = regCP_GFX_HQD_VMID_DEFAULT;
|
||||
tmp = REG_SET_FIELD(tmp, CP_GFX_HQD_VMID, VMID, 0);
|
||||
mqd->cp_gfx_hqd_vmid = 0;
|
||||
|
||||
/* set up default queue priority level
|
||||
* 0x0 = low priority, 0x1 = high priority */
|
||||
tmp = RREG32_SOC15(GC, 0, regCP_GFX_HQD_QUEUE_PRIORITY);
|
||||
tmp = regCP_GFX_HQD_QUEUE_PRIORITY_DEFAULT;
|
||||
tmp = REG_SET_FIELD(tmp, CP_GFX_HQD_QUEUE_PRIORITY, PRIORITY_LEVEL, 0);
|
||||
mqd->cp_gfx_hqd_queue_priority = tmp;
|
||||
|
||||
/* set up time quantum */
|
||||
tmp = RREG32_SOC15(GC, 0, regCP_GFX_HQD_QUANTUM);
|
||||
tmp = regCP_GFX_HQD_QUANTUM_DEFAULT;
|
||||
tmp = REG_SET_FIELD(tmp, CP_GFX_HQD_QUANTUM, QUANTUM_EN, 1);
|
||||
mqd->cp_gfx_hqd_quantum = tmp;
|
||||
|
||||
@@ -2891,7 +2909,7 @@ static int gfx_v12_0_gfx_mqd_init(struct amdgpu_device *adev, void *m,
|
||||
|
||||
/* set up the gfx_hqd_control, similar as CP_RB0_CNTL */
|
||||
rb_bufsz = order_base_2(prop->queue_size / 4) - 1;
|
||||
tmp = RREG32_SOC15(GC, 0, regCP_GFX_HQD_CNTL);
|
||||
tmp = regCP_GFX_HQD_CNTL_DEFAULT;
|
||||
tmp = REG_SET_FIELD(tmp, CP_GFX_HQD_CNTL, RB_BUFSZ, rb_bufsz);
|
||||
tmp = REG_SET_FIELD(tmp, CP_GFX_HQD_CNTL, RB_BLKSZ, rb_bufsz - 2);
|
||||
#ifdef __BIG_ENDIAN
|
||||
@@ -2900,7 +2918,7 @@ static int gfx_v12_0_gfx_mqd_init(struct amdgpu_device *adev, void *m,
|
||||
mqd->cp_gfx_hqd_cntl = tmp;
|
||||
|
||||
/* set up cp_doorbell_control */
|
||||
tmp = RREG32_SOC15(GC, 0, regCP_RB_DOORBELL_CONTROL);
|
||||
tmp = regCP_RB_DOORBELL_CONTROL_DEFAULT;
|
||||
if (prop->use_doorbell) {
|
||||
tmp = REG_SET_FIELD(tmp, CP_RB_DOORBELL_CONTROL,
|
||||
DOORBELL_OFFSET, prop->doorbell_index);
|
||||
@@ -2912,7 +2930,7 @@ static int gfx_v12_0_gfx_mqd_init(struct amdgpu_device *adev, void *m,
|
||||
mqd->cp_rb_doorbell_control = tmp;
|
||||
|
||||
/* reset read and write pointers, similar to CP_RB0_WPTR/_RPTR */
|
||||
mqd->cp_gfx_hqd_rptr = RREG32_SOC15(GC, 0, regCP_GFX_HQD_RPTR);
|
||||
mqd->cp_gfx_hqd_rptr = regCP_GFX_HQD_RPTR_DEFAULT;
|
||||
|
||||
/* active the queue */
|
||||
mqd->cp_gfx_hqd_active = 1;
|
||||
@@ -3007,14 +3025,14 @@ static int gfx_v12_0_compute_mqd_init(struct amdgpu_device *adev, void *m,
|
||||
mqd->cp_hqd_eop_base_addr_hi = upper_32_bits(eop_base_addr);
|
||||
|
||||
/* set the EOP size, register value is 2^(EOP_SIZE+1) dwords */
|
||||
tmp = RREG32_SOC15(GC, 0, regCP_HQD_EOP_CONTROL);
|
||||
tmp = regCP_HQD_EOP_CONTROL_DEFAULT;
|
||||
tmp = REG_SET_FIELD(tmp, CP_HQD_EOP_CONTROL, EOP_SIZE,
|
||||
(order_base_2(GFX12_MEC_HPD_SIZE / 4) - 1));
|
||||
|
||||
mqd->cp_hqd_eop_control = tmp;
|
||||
|
||||
/* enable doorbell? */
|
||||
tmp = RREG32_SOC15(GC, 0, regCP_HQD_PQ_DOORBELL_CONTROL);
|
||||
tmp = regCP_HQD_PQ_DOORBELL_CONTROL_DEFAULT;
|
||||
|
||||
if (prop->use_doorbell) {
|
||||
tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_DOORBELL_CONTROL,
|
||||
@@ -3043,7 +3061,7 @@ static int gfx_v12_0_compute_mqd_init(struct amdgpu_device *adev, void *m,
|
||||
mqd->cp_mqd_base_addr_hi = upper_32_bits(prop->mqd_gpu_addr);
|
||||
|
||||
/* set MQD vmid to 0 */
|
||||
tmp = RREG32_SOC15(GC, 0, regCP_MQD_CONTROL);
|
||||
tmp = regCP_MQD_CONTROL_DEFAULT;
|
||||
tmp = REG_SET_FIELD(tmp, CP_MQD_CONTROL, VMID, 0);
|
||||
mqd->cp_mqd_control = tmp;
|
||||
|
||||
@@ -3053,7 +3071,7 @@ static int gfx_v12_0_compute_mqd_init(struct amdgpu_device *adev, void *m,
|
||||
mqd->cp_hqd_pq_base_hi = upper_32_bits(hqd_gpu_addr);
|
||||
|
||||
/* set up the HQD, this is similar to CP_RB0_CNTL */
|
||||
tmp = RREG32_SOC15(GC, 0, regCP_HQD_PQ_CONTROL);
|
||||
tmp = regCP_HQD_PQ_CONTROL_DEFAULT;
|
||||
tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL, QUEUE_SIZE,
|
||||
(order_base_2(prop->queue_size / 4) - 1));
|
||||
tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL, RPTR_BLOCK_SIZE,
|
||||
@@ -3078,7 +3096,7 @@ static int gfx_v12_0_compute_mqd_init(struct amdgpu_device *adev, void *m,
|
||||
tmp = 0;
|
||||
/* enable the doorbell if requested */
|
||||
if (prop->use_doorbell) {
|
||||
tmp = RREG32_SOC15(GC, 0, regCP_HQD_PQ_DOORBELL_CONTROL);
|
||||
tmp = regCP_HQD_PQ_DOORBELL_CONTROL_DEFAULT;
|
||||
tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_DOORBELL_CONTROL,
|
||||
DOORBELL_OFFSET, prop->doorbell_index);
|
||||
|
||||
@@ -3093,17 +3111,17 @@ static int gfx_v12_0_compute_mqd_init(struct amdgpu_device *adev, void *m,
|
||||
mqd->cp_hqd_pq_doorbell_control = tmp;
|
||||
|
||||
/* reset read and write pointers, similar to CP_RB0_WPTR/_RPTR */
|
||||
mqd->cp_hqd_pq_rptr = RREG32_SOC15(GC, 0, regCP_HQD_PQ_RPTR);
|
||||
mqd->cp_hqd_pq_rptr = regCP_HQD_PQ_RPTR_DEFAULT;
|
||||
|
||||
/* set the vmid for the queue */
|
||||
mqd->cp_hqd_vmid = 0;
|
||||
|
||||
tmp = RREG32_SOC15(GC, 0, regCP_HQD_PERSISTENT_STATE);
|
||||
tmp = regCP_HQD_PERSISTENT_STATE_DEFAULT;
|
||||
tmp = REG_SET_FIELD(tmp, CP_HQD_PERSISTENT_STATE, PRELOAD_SIZE, 0x55);
|
||||
mqd->cp_hqd_persistent_state = tmp;
|
||||
|
||||
/* set MIN_IB_AVAIL_SIZE */
|
||||
tmp = RREG32_SOC15(GC, 0, regCP_HQD_IB_CONTROL);
|
||||
tmp = regCP_HQD_IB_CONTROL_DEFAULT;
|
||||
tmp = REG_SET_FIELD(tmp, CP_HQD_IB_CONTROL, MIN_IB_AVAIL_SIZE, 3);
|
||||
mqd->cp_hqd_ib_control = tmp;
|
||||
|
||||
|
||||
@@ -141,23 +141,23 @@ static struct amdgpu_video_codec_info sriov_sc_video_codecs_encode_array[] = {
|
||||
};
|
||||
|
||||
static struct amdgpu_video_codec_info sriov_sc_video_codecs_decode_array_vcn0[] = {
|
||||
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG2, 4096, 4096, 3)},
|
||||
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4, 4096, 4096, 5)},
|
||||
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG2, 1920, 1088, 3)},
|
||||
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4, 1920, 1088, 5)},
|
||||
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4_AVC, 4096, 4096, 52)},
|
||||
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_VC1, 4096, 4096, 4)},
|
||||
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_VC1, 1920, 1088, 4)},
|
||||
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_HEVC, 8192, 4352, 186)},
|
||||
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_JPEG, 4096, 4096, 0)},
|
||||
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_JPEG, 16384, 16384, 0)},
|
||||
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_VP9, 8192, 4352, 0)},
|
||||
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_AV1, 8192, 4352, 0)},
|
||||
};
|
||||
|
||||
static struct amdgpu_video_codec_info sriov_sc_video_codecs_decode_array_vcn1[] = {
|
||||
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG2, 4096, 4096, 3)},
|
||||
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4, 4096, 4096, 5)},
|
||||
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG2, 1920, 1088, 3)},
|
||||
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4, 1920, 1088, 5)},
|
||||
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4_AVC, 4096, 4096, 52)},
|
||||
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_VC1, 4096, 4096, 4)},
|
||||
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_VC1, 1920, 1088, 4)},
|
||||
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_HEVC, 8192, 4352, 186)},
|
||||
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_JPEG, 4096, 4096, 0)},
|
||||
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_JPEG, 16384, 16384, 0)},
|
||||
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_VP9, 8192, 4352, 0)},
|
||||
};
|
||||
|
||||
|
||||
@@ -117,23 +117,17 @@ static struct amdgpu_video_codecs sriov_vcn_4_0_0_video_codecs_encode_vcn1 = {
|
||||
};
|
||||
|
||||
static struct amdgpu_video_codec_info sriov_vcn_4_0_0_video_codecs_decode_array_vcn0[] = {
|
||||
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG2, 4096, 4096, 3)},
|
||||
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4, 4096, 4096, 5)},
|
||||
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4_AVC, 4096, 4096, 52)},
|
||||
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_VC1, 4096, 4096, 4)},
|
||||
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_HEVC, 8192, 4352, 186)},
|
||||
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_JPEG, 4096, 4096, 0)},
|
||||
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_JPEG, 16384, 16384, 0)},
|
||||
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_VP9, 8192, 4352, 0)},
|
||||
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_AV1, 8192, 4352, 0)},
|
||||
};
|
||||
|
||||
static struct amdgpu_video_codec_info sriov_vcn_4_0_0_video_codecs_decode_array_vcn1[] = {
|
||||
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG2, 4096, 4096, 3)},
|
||||
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4, 4096, 4096, 5)},
|
||||
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4_AVC, 4096, 4096, 52)},
|
||||
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_VC1, 4096, 4096, 4)},
|
||||
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_HEVC, 8192, 4352, 186)},
|
||||
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_JPEG, 4096, 4096, 0)},
|
||||
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_JPEG, 16384, 16384, 0)},
|
||||
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_VP9, 8192, 4352, 0)},
|
||||
};
|
||||
|
||||
|
||||
@@ -2453,14 +2453,6 @@ failed_try_destroy_debugged_queue:
|
||||
return retval;
|
||||
}
|
||||
|
||||
/*
|
||||
* Low bits must be 0000/FFFF as required by HW, high bits must be 0 to
|
||||
* stay in user mode.
|
||||
*/
|
||||
#define APE1_FIXED_BITS_MASK 0xFFFF80000000FFFFULL
|
||||
/* APE1 limit is inclusive and 64K aligned. */
|
||||
#define APE1_LIMIT_ALIGNMENT 0xFFFF
|
||||
|
||||
static bool set_cache_memory_policy(struct device_queue_manager *dqm,
|
||||
struct qcm_process_device *qpd,
|
||||
enum cache_policy default_policy,
|
||||
@@ -2475,34 +2467,6 @@ static bool set_cache_memory_policy(struct device_queue_manager *dqm,
|
||||
|
||||
dqm_lock(dqm);
|
||||
|
||||
if (alternate_aperture_size == 0) {
|
||||
/* base > limit disables APE1 */
|
||||
qpd->sh_mem_ape1_base = 1;
|
||||
qpd->sh_mem_ape1_limit = 0;
|
||||
} else {
|
||||
/*
|
||||
* In FSA64, APE1_Base[63:0] = { 16{SH_MEM_APE1_BASE[31]},
|
||||
* SH_MEM_APE1_BASE[31:0], 0x0000 }
|
||||
* APE1_Limit[63:0] = { 16{SH_MEM_APE1_LIMIT[31]},
|
||||
* SH_MEM_APE1_LIMIT[31:0], 0xFFFF }
|
||||
* Verify that the base and size parameters can be
|
||||
* represented in this format and convert them.
|
||||
* Additionally restrict APE1 to user-mode addresses.
|
||||
*/
|
||||
|
||||
uint64_t base = (uintptr_t)alternate_aperture_base;
|
||||
uint64_t limit = base + alternate_aperture_size - 1;
|
||||
|
||||
if (limit <= base || (base & APE1_FIXED_BITS_MASK) != 0 ||
|
||||
(limit & APE1_FIXED_BITS_MASK) != APE1_LIMIT_ALIGNMENT) {
|
||||
retval = false;
|
||||
goto out;
|
||||
}
|
||||
|
||||
qpd->sh_mem_ape1_base = base >> 16;
|
||||
qpd->sh_mem_ape1_limit = limit >> 16;
|
||||
}
|
||||
|
||||
retval = dqm->asic_ops.set_cache_memory_policy(
|
||||
dqm,
|
||||
qpd,
|
||||
@@ -2511,6 +2475,9 @@ static bool set_cache_memory_policy(struct device_queue_manager *dqm,
|
||||
alternate_aperture_base,
|
||||
alternate_aperture_size);
|
||||
|
||||
if (retval)
|
||||
goto out;
|
||||
|
||||
if ((dqm->sched_policy == KFD_SCHED_POLICY_NO_HWS) && (qpd->vmid != 0))
|
||||
program_sh_mem_settings(dqm, qpd);
|
||||
|
||||
|
||||
@@ -27,6 +27,14 @@
|
||||
#include "oss/oss_2_4_sh_mask.h"
|
||||
#include "gca/gfx_7_2_sh_mask.h"
|
||||
|
||||
/*
|
||||
* Low bits must be 0000/FFFF as required by HW, high bits must be 0 to
|
||||
* stay in user mode.
|
||||
*/
|
||||
#define APE1_FIXED_BITS_MASK 0xFFFF80000000FFFFULL
|
||||
/* APE1 limit is inclusive and 64K aligned. */
|
||||
#define APE1_LIMIT_ALIGNMENT 0xFFFF
|
||||
|
||||
static bool set_cache_memory_policy_cik(struct device_queue_manager *dqm,
|
||||
struct qcm_process_device *qpd,
|
||||
enum cache_policy default_policy,
|
||||
@@ -84,6 +92,36 @@ static bool set_cache_memory_policy_cik(struct device_queue_manager *dqm,
|
||||
{
|
||||
uint32_t default_mtype;
|
||||
uint32_t ape1_mtype;
|
||||
unsigned int temp;
|
||||
bool retval = true;
|
||||
|
||||
if (alternate_aperture_size == 0) {
|
||||
/* base > limit disables APE1 */
|
||||
qpd->sh_mem_ape1_base = 1;
|
||||
qpd->sh_mem_ape1_limit = 0;
|
||||
} else {
|
||||
/*
|
||||
* In FSA64, APE1_Base[63:0] = { 16{SH_MEM_APE1_BASE[31]},
|
||||
* SH_MEM_APE1_BASE[31:0], 0x0000 }
|
||||
* APE1_Limit[63:0] = { 16{SH_MEM_APE1_LIMIT[31]},
|
||||
* SH_MEM_APE1_LIMIT[31:0], 0xFFFF }
|
||||
* Verify that the base and size parameters can be
|
||||
* represented in this format and convert them.
|
||||
* Additionally restrict APE1 to user-mode addresses.
|
||||
*/
|
||||
|
||||
uint64_t base = (uintptr_t)alternate_aperture_base;
|
||||
uint64_t limit = base + alternate_aperture_size - 1;
|
||||
|
||||
if (limit <= base || (base & APE1_FIXED_BITS_MASK) != 0 ||
|
||||
(limit & APE1_FIXED_BITS_MASK) != APE1_LIMIT_ALIGNMENT) {
|
||||
retval = false;
|
||||
goto out;
|
||||
}
|
||||
|
||||
qpd->sh_mem_ape1_base = base >> 16;
|
||||
qpd->sh_mem_ape1_limit = limit >> 16;
|
||||
}
|
||||
|
||||
default_mtype = (default_policy == cache_policy_coherent) ?
|
||||
MTYPE_NONCACHED :
|
||||
@@ -97,37 +135,22 @@ static bool set_cache_memory_policy_cik(struct device_queue_manager *dqm,
|
||||
| ALIGNMENT_MODE(SH_MEM_ALIGNMENT_MODE_UNALIGNED)
|
||||
| DEFAULT_MTYPE(default_mtype)
|
||||
| APE1_MTYPE(ape1_mtype);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static int update_qpd_cik(struct device_queue_manager *dqm,
|
||||
struct qcm_process_device *qpd)
|
||||
{
|
||||
struct kfd_process_device *pdd;
|
||||
unsigned int temp;
|
||||
|
||||
pdd = qpd_to_pdd(qpd);
|
||||
|
||||
/* check if sh_mem_config register already configured */
|
||||
if (qpd->sh_mem_config == 0) {
|
||||
qpd->sh_mem_config =
|
||||
ALIGNMENT_MODE(SH_MEM_ALIGNMENT_MODE_UNALIGNED) |
|
||||
DEFAULT_MTYPE(MTYPE_NONCACHED) |
|
||||
APE1_MTYPE(MTYPE_NONCACHED);
|
||||
qpd->sh_mem_ape1_limit = 0;
|
||||
qpd->sh_mem_ape1_base = 0;
|
||||
}
|
||||
|
||||
/* On dGPU we're always in GPUVM64 addressing mode with 64-bit
|
||||
* aperture addresses.
|
||||
*/
|
||||
temp = get_sh_mem_bases_nybble_64(pdd);
|
||||
temp = get_sh_mem_bases_nybble_64(qpd_to_pdd(qpd));
|
||||
qpd->sh_mem_bases = compute_sh_mem_bases_64bit(temp);
|
||||
|
||||
pr_debug("is32bit process: %d sh_mem_bases nybble: 0x%X and register 0x%X\n",
|
||||
qpd->pqm->process->is_32bit_user_mode, temp, qpd->sh_mem_bases);
|
||||
|
||||
out:
|
||||
return retval;
|
||||
}
|
||||
|
||||
static int update_qpd_cik(struct device_queue_manager *dqm,
|
||||
struct qcm_process_device *qpd)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,10 +31,17 @@ static int update_qpd_v10(struct device_queue_manager *dqm,
|
||||
struct qcm_process_device *qpd);
|
||||
static void init_sdma_vm_v10(struct device_queue_manager *dqm, struct queue *q,
|
||||
struct qcm_process_device *qpd);
|
||||
static bool set_cache_memory_policy_v10(struct device_queue_manager *dqm,
|
||||
struct qcm_process_device *qpd,
|
||||
enum cache_policy default_policy,
|
||||
enum cache_policy alternate_policy,
|
||||
void __user *alternate_aperture_base,
|
||||
uint64_t alternate_aperture_size);
|
||||
|
||||
void device_queue_manager_init_v10(
|
||||
struct device_queue_manager_asic_ops *asic_ops)
|
||||
{
|
||||
asic_ops->set_cache_memory_policy = set_cache_memory_policy_v10;
|
||||
asic_ops->update_qpd = update_qpd_v10;
|
||||
asic_ops->init_sdma_vm = init_sdma_vm_v10;
|
||||
asic_ops->mqd_manager_init = mqd_manager_init_v10;
|
||||
@@ -49,27 +56,27 @@ static uint32_t compute_sh_mem_bases_64bit(struct kfd_process_device *pdd)
|
||||
private_base;
|
||||
}
|
||||
|
||||
static bool set_cache_memory_policy_v10(struct device_queue_manager *dqm,
|
||||
struct qcm_process_device *qpd,
|
||||
enum cache_policy default_policy,
|
||||
enum cache_policy alternate_policy,
|
||||
void __user *alternate_aperture_base,
|
||||
uint64_t alternate_aperture_size)
|
||||
{
|
||||
qpd->sh_mem_config = (SH_MEM_ALIGNMENT_MODE_UNALIGNED <<
|
||||
SH_MEM_CONFIG__ALIGNMENT_MODE__SHIFT) |
|
||||
(3 << SH_MEM_CONFIG__INITIAL_INST_PREFETCH__SHIFT);
|
||||
qpd->sh_mem_ape1_limit = 0;
|
||||
qpd->sh_mem_ape1_base = 0;
|
||||
qpd->sh_mem_bases = compute_sh_mem_bases_64bit(qpd_to_pdd(qpd));
|
||||
|
||||
pr_debug("sh_mem_bases 0x%X\n", qpd->sh_mem_bases);
|
||||
return true;
|
||||
}
|
||||
|
||||
static int update_qpd_v10(struct device_queue_manager *dqm,
|
||||
struct qcm_process_device *qpd)
|
||||
{
|
||||
struct kfd_process_device *pdd;
|
||||
|
||||
pdd = qpd_to_pdd(qpd);
|
||||
|
||||
/* check if sh_mem_config register already configured */
|
||||
if (qpd->sh_mem_config == 0) {
|
||||
qpd->sh_mem_config =
|
||||
(SH_MEM_ALIGNMENT_MODE_UNALIGNED <<
|
||||
SH_MEM_CONFIG__ALIGNMENT_MODE__SHIFT) |
|
||||
(3 << SH_MEM_CONFIG__INITIAL_INST_PREFETCH__SHIFT);
|
||||
qpd->sh_mem_ape1_limit = 0;
|
||||
qpd->sh_mem_ape1_base = 0;
|
||||
}
|
||||
|
||||
qpd->sh_mem_bases = compute_sh_mem_bases_64bit(pdd);
|
||||
|
||||
pr_debug("sh_mem_bases 0x%X\n", qpd->sh_mem_bases);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,10 +30,17 @@ static int update_qpd_v11(struct device_queue_manager *dqm,
|
||||
struct qcm_process_device *qpd);
|
||||
static void init_sdma_vm_v11(struct device_queue_manager *dqm, struct queue *q,
|
||||
struct qcm_process_device *qpd);
|
||||
static bool set_cache_memory_policy_v11(struct device_queue_manager *dqm,
|
||||
struct qcm_process_device *qpd,
|
||||
enum cache_policy default_policy,
|
||||
enum cache_policy alternate_policy,
|
||||
void __user *alternate_aperture_base,
|
||||
uint64_t alternate_aperture_size);
|
||||
|
||||
void device_queue_manager_init_v11(
|
||||
struct device_queue_manager_asic_ops *asic_ops)
|
||||
{
|
||||
asic_ops->set_cache_memory_policy = set_cache_memory_policy_v11;
|
||||
asic_ops->update_qpd = update_qpd_v11;
|
||||
asic_ops->init_sdma_vm = init_sdma_vm_v11;
|
||||
asic_ops->mqd_manager_init = mqd_manager_init_v11;
|
||||
@@ -48,28 +55,28 @@ static uint32_t compute_sh_mem_bases_64bit(struct kfd_process_device *pdd)
|
||||
private_base;
|
||||
}
|
||||
|
||||
static bool set_cache_memory_policy_v11(struct device_queue_manager *dqm,
|
||||
struct qcm_process_device *qpd,
|
||||
enum cache_policy default_policy,
|
||||
enum cache_policy alternate_policy,
|
||||
void __user *alternate_aperture_base,
|
||||
uint64_t alternate_aperture_size)
|
||||
{
|
||||
qpd->sh_mem_config = (SH_MEM_ALIGNMENT_MODE_UNALIGNED <<
|
||||
SH_MEM_CONFIG__ALIGNMENT_MODE__SHIFT) |
|
||||
(3 << SH_MEM_CONFIG__INITIAL_INST_PREFETCH__SHIFT);
|
||||
|
||||
qpd->sh_mem_ape1_limit = 0;
|
||||
qpd->sh_mem_ape1_base = 0;
|
||||
qpd->sh_mem_bases = compute_sh_mem_bases_64bit(qpd_to_pdd(qpd));
|
||||
|
||||
pr_debug("sh_mem_bases 0x%X\n", qpd->sh_mem_bases);
|
||||
return true;
|
||||
}
|
||||
|
||||
static int update_qpd_v11(struct device_queue_manager *dqm,
|
||||
struct qcm_process_device *qpd)
|
||||
{
|
||||
struct kfd_process_device *pdd;
|
||||
|
||||
pdd = qpd_to_pdd(qpd);
|
||||
|
||||
/* check if sh_mem_config register already configured */
|
||||
if (qpd->sh_mem_config == 0) {
|
||||
qpd->sh_mem_config =
|
||||
(SH_MEM_ALIGNMENT_MODE_UNALIGNED <<
|
||||
SH_MEM_CONFIG__ALIGNMENT_MODE__SHIFT) |
|
||||
(3 << SH_MEM_CONFIG__INITIAL_INST_PREFETCH__SHIFT);
|
||||
|
||||
qpd->sh_mem_ape1_limit = 0;
|
||||
qpd->sh_mem_ape1_base = 0;
|
||||
}
|
||||
|
||||
qpd->sh_mem_bases = compute_sh_mem_bases_64bit(pdd);
|
||||
|
||||
pr_debug("sh_mem_bases 0x%X\n", qpd->sh_mem_bases);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,10 +30,17 @@ static int update_qpd_v12(struct device_queue_manager *dqm,
|
||||
struct qcm_process_device *qpd);
|
||||
static void init_sdma_vm_v12(struct device_queue_manager *dqm, struct queue *q,
|
||||
struct qcm_process_device *qpd);
|
||||
static bool set_cache_memory_policy_v12(struct device_queue_manager *dqm,
|
||||
struct qcm_process_device *qpd,
|
||||
enum cache_policy default_policy,
|
||||
enum cache_policy alternate_policy,
|
||||
void __user *alternate_aperture_base,
|
||||
uint64_t alternate_aperture_size);
|
||||
|
||||
void device_queue_manager_init_v12(
|
||||
struct device_queue_manager_asic_ops *asic_ops)
|
||||
{
|
||||
asic_ops->set_cache_memory_policy = set_cache_memory_policy_v12;
|
||||
asic_ops->update_qpd = update_qpd_v12;
|
||||
asic_ops->init_sdma_vm = init_sdma_vm_v12;
|
||||
asic_ops->mqd_manager_init = mqd_manager_init_v12;
|
||||
@@ -48,28 +55,28 @@ static uint32_t compute_sh_mem_bases_64bit(struct kfd_process_device *pdd)
|
||||
private_base;
|
||||
}
|
||||
|
||||
static bool set_cache_memory_policy_v12(struct device_queue_manager *dqm,
|
||||
struct qcm_process_device *qpd,
|
||||
enum cache_policy default_policy,
|
||||
enum cache_policy alternate_policy,
|
||||
void __user *alternate_aperture_base,
|
||||
uint64_t alternate_aperture_size)
|
||||
{
|
||||
qpd->sh_mem_config = (SH_MEM_ALIGNMENT_MODE_UNALIGNED <<
|
||||
SH_MEM_CONFIG__ALIGNMENT_MODE__SHIFT) |
|
||||
(3 << SH_MEM_CONFIG__INITIAL_INST_PREFETCH__SHIFT);
|
||||
|
||||
qpd->sh_mem_ape1_limit = 0;
|
||||
qpd->sh_mem_ape1_base = 0;
|
||||
qpd->sh_mem_bases = compute_sh_mem_bases_64bit(qpd_to_pdd(qpd));
|
||||
|
||||
pr_debug("sh_mem_bases 0x%X\n", qpd->sh_mem_bases);
|
||||
return true;
|
||||
}
|
||||
|
||||
static int update_qpd_v12(struct device_queue_manager *dqm,
|
||||
struct qcm_process_device *qpd)
|
||||
{
|
||||
struct kfd_process_device *pdd;
|
||||
|
||||
pdd = qpd_to_pdd(qpd);
|
||||
|
||||
/* check if sh_mem_config register already configured */
|
||||
if (qpd->sh_mem_config == 0) {
|
||||
qpd->sh_mem_config =
|
||||
(SH_MEM_ALIGNMENT_MODE_UNALIGNED <<
|
||||
SH_MEM_CONFIG__ALIGNMENT_MODE__SHIFT) |
|
||||
(3 << SH_MEM_CONFIG__INITIAL_INST_PREFETCH__SHIFT);
|
||||
|
||||
qpd->sh_mem_ape1_limit = 0;
|
||||
qpd->sh_mem_ape1_base = 0;
|
||||
}
|
||||
|
||||
qpd->sh_mem_bases = compute_sh_mem_bases_64bit(pdd);
|
||||
|
||||
pr_debug("sh_mem_bases 0x%X\n", qpd->sh_mem_bases);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,10 +30,17 @@ static int update_qpd_v9(struct device_queue_manager *dqm,
|
||||
struct qcm_process_device *qpd);
|
||||
static void init_sdma_vm_v9(struct device_queue_manager *dqm, struct queue *q,
|
||||
struct qcm_process_device *qpd);
|
||||
static bool set_cache_memory_policy_v9(struct device_queue_manager *dqm,
|
||||
struct qcm_process_device *qpd,
|
||||
enum cache_policy default_policy,
|
||||
enum cache_policy alternate_policy,
|
||||
void __user *alternate_aperture_base,
|
||||
uint64_t alternate_aperture_size);
|
||||
|
||||
void device_queue_manager_init_v9(
|
||||
struct device_queue_manager_asic_ops *asic_ops)
|
||||
{
|
||||
asic_ops->set_cache_memory_policy = set_cache_memory_policy_v9;
|
||||
asic_ops->update_qpd = update_qpd_v9;
|
||||
asic_ops->init_sdma_vm = init_sdma_vm_v9;
|
||||
asic_ops->mqd_manager_init = mqd_manager_init_v9;
|
||||
@@ -48,10 +55,37 @@ static uint32_t compute_sh_mem_bases_64bit(struct kfd_process_device *pdd)
|
||||
private_base;
|
||||
}
|
||||
|
||||
static bool set_cache_memory_policy_v9(struct device_queue_manager *dqm,
|
||||
struct qcm_process_device *qpd,
|
||||
enum cache_policy default_policy,
|
||||
enum cache_policy alternate_policy,
|
||||
void __user *alternate_aperture_base,
|
||||
uint64_t alternate_aperture_size)
|
||||
{
|
||||
qpd->sh_mem_config = SH_MEM_ALIGNMENT_MODE_UNALIGNED <<
|
||||
SH_MEM_CONFIG__ALIGNMENT_MODE__SHIFT;
|
||||
|
||||
if (dqm->dev->kfd->noretry)
|
||||
qpd->sh_mem_config |= 1 << SH_MEM_CONFIG__RETRY_DISABLE__SHIFT;
|
||||
|
||||
if (KFD_GC_VERSION(dqm->dev->kfd) == IP_VERSION(9, 4, 3) ||
|
||||
KFD_GC_VERSION(dqm->dev->kfd) == IP_VERSION(9, 4, 4) ||
|
||||
KFD_GC_VERSION(dqm->dev->kfd) == IP_VERSION(9, 5, 0))
|
||||
qpd->sh_mem_config |= (1 << SH_MEM_CONFIG__F8_MODE__SHIFT);
|
||||
|
||||
qpd->sh_mem_ape1_limit = 0;
|
||||
qpd->sh_mem_ape1_base = 0;
|
||||
qpd->sh_mem_bases = compute_sh_mem_bases_64bit(qpd_to_pdd(qpd));
|
||||
|
||||
pr_debug("sh_mem_bases 0x%X sh_mem_config 0x%X\n", qpd->sh_mem_bases,
|
||||
qpd->sh_mem_config);
|
||||
return true;
|
||||
}
|
||||
|
||||
static int update_qpd_v9(struct device_queue_manager *dqm,
|
||||
struct qcm_process_device *qpd)
|
||||
{
|
||||
struct kfd_process_device *pdd;
|
||||
struct kfd_process_device *pdd = qpd_to_pdd(qpd);
|
||||
|
||||
pdd = qpd_to_pdd(qpd);
|
||||
|
||||
|
||||
@@ -27,6 +27,14 @@
|
||||
#include "gca/gfx_8_0_sh_mask.h"
|
||||
#include "oss/oss_3_0_sh_mask.h"
|
||||
|
||||
/*
|
||||
* Low bits must be 0000/FFFF as required by HW, high bits must be 0 to
|
||||
* stay in user mode.
|
||||
*/
|
||||
#define APE1_FIXED_BITS_MASK 0xFFFF80000000FFFFULL
|
||||
/* APE1 limit is inclusive and 64K aligned. */
|
||||
#define APE1_LIMIT_ALIGNMENT 0xFFFF
|
||||
|
||||
static bool set_cache_memory_policy_vi(struct device_queue_manager *dqm,
|
||||
struct qcm_process_device *qpd,
|
||||
enum cache_policy default_policy,
|
||||
@@ -85,6 +93,36 @@ static bool set_cache_memory_policy_vi(struct device_queue_manager *dqm,
|
||||
{
|
||||
uint32_t default_mtype;
|
||||
uint32_t ape1_mtype;
|
||||
unsigned int temp;
|
||||
bool retval = true;
|
||||
|
||||
if (alternate_aperture_size == 0) {
|
||||
/* base > limit disables APE1 */
|
||||
qpd->sh_mem_ape1_base = 1;
|
||||
qpd->sh_mem_ape1_limit = 0;
|
||||
} else {
|
||||
/*
|
||||
* In FSA64, APE1_Base[63:0] = { 16{SH_MEM_APE1_BASE[31]},
|
||||
* SH_MEM_APE1_BASE[31:0], 0x0000 }
|
||||
* APE1_Limit[63:0] = { 16{SH_MEM_APE1_LIMIT[31]},
|
||||
* SH_MEM_APE1_LIMIT[31:0], 0xFFFF }
|
||||
* Verify that the base and size parameters can be
|
||||
* represented in this format and convert them.
|
||||
* Additionally restrict APE1 to user-mode addresses.
|
||||
*/
|
||||
|
||||
uint64_t base = (uintptr_t)alternate_aperture_base;
|
||||
uint64_t limit = base + alternate_aperture_size - 1;
|
||||
|
||||
if (limit <= base || (base & APE1_FIXED_BITS_MASK) != 0 ||
|
||||
(limit & APE1_FIXED_BITS_MASK) != APE1_LIMIT_ALIGNMENT) {
|
||||
retval = false;
|
||||
goto out;
|
||||
}
|
||||
|
||||
qpd->sh_mem_ape1_base = base >> 16;
|
||||
qpd->sh_mem_ape1_limit = limit >> 16;
|
||||
}
|
||||
|
||||
default_mtype = (default_policy == cache_policy_coherent) ?
|
||||
MTYPE_UC :
|
||||
@@ -100,40 +138,21 @@ static bool set_cache_memory_policy_vi(struct device_queue_manager *dqm,
|
||||
default_mtype << SH_MEM_CONFIG__DEFAULT_MTYPE__SHIFT |
|
||||
ape1_mtype << SH_MEM_CONFIG__APE1_MTYPE__SHIFT;
|
||||
|
||||
return true;
|
||||
/* On dGPU we're always in GPUVM64 addressing mode with 64-bit
|
||||
* aperture addresses.
|
||||
*/
|
||||
temp = get_sh_mem_bases_nybble_64(qpd_to_pdd(qpd));
|
||||
qpd->sh_mem_bases = compute_sh_mem_bases_64bit(temp);
|
||||
|
||||
pr_debug("sh_mem_bases nybble: 0x%X and register 0x%X\n",
|
||||
temp, qpd->sh_mem_bases);
|
||||
out:
|
||||
return retval;
|
||||
}
|
||||
|
||||
static int update_qpd_vi(struct device_queue_manager *dqm,
|
||||
struct qcm_process_device *qpd)
|
||||
{
|
||||
struct kfd_process_device *pdd;
|
||||
unsigned int temp;
|
||||
|
||||
pdd = qpd_to_pdd(qpd);
|
||||
|
||||
/* check if sh_mem_config register already configured */
|
||||
if (qpd->sh_mem_config == 0) {
|
||||
qpd->sh_mem_config =
|
||||
SH_MEM_ALIGNMENT_MODE_UNALIGNED <<
|
||||
SH_MEM_CONFIG__ALIGNMENT_MODE__SHIFT |
|
||||
MTYPE_UC <<
|
||||
SH_MEM_CONFIG__DEFAULT_MTYPE__SHIFT |
|
||||
MTYPE_UC <<
|
||||
SH_MEM_CONFIG__APE1_MTYPE__SHIFT;
|
||||
|
||||
qpd->sh_mem_ape1_limit = 0;
|
||||
qpd->sh_mem_ape1_base = 0;
|
||||
}
|
||||
|
||||
/* On dGPU we're always in GPUVM64 addressing mode with 64-bit
|
||||
* aperture addresses.
|
||||
*/
|
||||
temp = get_sh_mem_bases_nybble_64(pdd);
|
||||
qpd->sh_mem_bases = compute_sh_mem_bases_64bit(temp);
|
||||
|
||||
pr_debug("sh_mem_bases nybble: 0x%X and register 0x%X\n",
|
||||
temp, qpd->sh_mem_bases);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -3014,7 +3014,7 @@ retry_write_locked:
|
||||
|
||||
/* check if this page fault time stamp is before svms->checkpoint_ts */
|
||||
if (svms->checkpoint_ts[gpuidx] != 0) {
|
||||
if (amdgpu_ih_ts_after(ts, svms->checkpoint_ts[gpuidx])) {
|
||||
if (amdgpu_ih_ts_after_or_equal(ts, svms->checkpoint_ts[gpuidx])) {
|
||||
pr_debug("draining retry fault, drop fault 0x%llx\n", addr);
|
||||
r = -EAGAIN;
|
||||
goto out_unlock_svms;
|
||||
|
||||
@@ -2002,10 +2002,6 @@ static void kfd_topology_set_capabilities(struct kfd_topology_device *dev)
|
||||
dev->node_props.debug_prop |= HSA_DBG_WATCH_ADDR_MASK_LO_BIT_GFX10 |
|
||||
HSA_DBG_WATCH_ADDR_MASK_HI_BIT;
|
||||
|
||||
if (KFD_GC_VERSION(dev->gpu) >= IP_VERSION(11, 0, 0))
|
||||
dev->node_props.capability |=
|
||||
HSA_CAP_TRAP_DEBUG_PRECISE_MEMORY_OPERATIONS_SUPPORTED;
|
||||
|
||||
if (KFD_GC_VERSION(dev->gpu) >= IP_VERSION(12, 0, 0))
|
||||
dev->node_props.capability |=
|
||||
HSA_CAP_TRAP_DEBUG_PRECISE_ALU_OPERATIONS_SUPPORTED;
|
||||
|
||||
@@ -365,6 +365,8 @@ get_crtc_by_otg_inst(struct amdgpu_device *adev,
|
||||
static inline bool is_dc_timing_adjust_needed(struct dm_crtc_state *old_state,
|
||||
struct dm_crtc_state *new_state)
|
||||
{
|
||||
if (new_state->stream->adjust.timing_adjust_pending)
|
||||
return true;
|
||||
if (new_state->freesync_config.state == VRR_STATE_ACTIVE_FIXED)
|
||||
return true;
|
||||
else if (amdgpu_dm_crtc_vrr_active(old_state) != amdgpu_dm_crtc_vrr_active(new_state))
|
||||
|
||||
@@ -130,7 +130,7 @@ static void dcn315_update_clocks(struct clk_mgr *clk_mgr_base,
|
||||
struct clk_mgr_internal *clk_mgr = TO_CLK_MGR_INTERNAL(clk_mgr_base);
|
||||
struct dc_clocks *new_clocks = &context->bw_ctx.bw.dcn.clk;
|
||||
struct dc *dc = clk_mgr_base->ctx->dc;
|
||||
int display_count;
|
||||
int display_count = 0;
|
||||
bool update_dppclk = false;
|
||||
bool update_dispclk = false;
|
||||
bool dpp_clock_lowered = false;
|
||||
@@ -194,8 +194,6 @@ static void dcn315_update_clocks(struct clk_mgr *clk_mgr_base,
|
||||
// workaround: Limit dppclk to 100Mhz to avoid lower eDP panel switch to plus 4K monitor underflow.
|
||||
if (new_clocks->dppclk_khz < MIN_DPP_DISP_CLK)
|
||||
new_clocks->dppclk_khz = MIN_DPP_DISP_CLK;
|
||||
if (new_clocks->dispclk_khz < MIN_DPP_DISP_CLK)
|
||||
new_clocks->dispclk_khz = MIN_DPP_DISP_CLK;
|
||||
|
||||
if (should_set_clock(safe_to_lower, new_clocks->dppclk_khz, clk_mgr->base.clks.dppclk_khz)) {
|
||||
if (clk_mgr->base.clks.dppclk_khz > new_clocks->dppclk_khz)
|
||||
@@ -204,15 +202,19 @@ static void dcn315_update_clocks(struct clk_mgr *clk_mgr_base,
|
||||
update_dppclk = true;
|
||||
}
|
||||
|
||||
if (should_set_clock(safe_to_lower, new_clocks->dispclk_khz, clk_mgr_base->clks.dispclk_khz)) {
|
||||
/* No need to apply the w/a if we haven't taken over from bios yet */
|
||||
if (clk_mgr_base->clks.dispclk_khz)
|
||||
dcn315_disable_otg_wa(clk_mgr_base, context, true);
|
||||
if (should_set_clock(safe_to_lower, new_clocks->dispclk_khz, clk_mgr_base->clks.dispclk_khz) &&
|
||||
(new_clocks->dispclk_khz > 0 || (safe_to_lower && display_count == 0))) {
|
||||
int requested_dispclk_khz = new_clocks->dispclk_khz;
|
||||
|
||||
dcn315_disable_otg_wa(clk_mgr_base, context, true);
|
||||
|
||||
/* Clamp the requested clock to PMFW based on their limit. */
|
||||
if (dc->debug.min_disp_clk_khz > 0 && requested_dispclk_khz < dc->debug.min_disp_clk_khz)
|
||||
requested_dispclk_khz = dc->debug.min_disp_clk_khz;
|
||||
|
||||
dcn315_smu_set_dispclk(clk_mgr, requested_dispclk_khz);
|
||||
clk_mgr_base->clks.dispclk_khz = new_clocks->dispclk_khz;
|
||||
dcn315_smu_set_dispclk(clk_mgr, clk_mgr_base->clks.dispclk_khz);
|
||||
if (clk_mgr_base->clks.dispclk_khz)
|
||||
dcn315_disable_otg_wa(clk_mgr_base, context, false);
|
||||
dcn315_disable_otg_wa(clk_mgr_base, context, false);
|
||||
|
||||
update_dispclk = true;
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ static void dcn316_update_clocks(struct clk_mgr *clk_mgr_base,
|
||||
struct clk_mgr_internal *clk_mgr = TO_CLK_MGR_INTERNAL(clk_mgr_base);
|
||||
struct dc_clocks *new_clocks = &context->bw_ctx.bw.dcn.clk;
|
||||
struct dc *dc = clk_mgr_base->ctx->dc;
|
||||
int display_count;
|
||||
int display_count = 0;
|
||||
bool update_dppclk = false;
|
||||
bool update_dispclk = false;
|
||||
bool dpp_clock_lowered = false;
|
||||
@@ -201,8 +201,6 @@ static void dcn316_update_clocks(struct clk_mgr *clk_mgr_base,
|
||||
// workaround: Limit dppclk to 100Mhz to avoid lower eDP panel switch to plus 4K monitor underflow.
|
||||
if (new_clocks->dppclk_khz < 100000)
|
||||
new_clocks->dppclk_khz = 100000;
|
||||
if (new_clocks->dispclk_khz < 100000)
|
||||
new_clocks->dispclk_khz = 100000;
|
||||
|
||||
if (should_set_clock(safe_to_lower, new_clocks->dppclk_khz, clk_mgr->base.clks.dppclk_khz)) {
|
||||
if (clk_mgr->base.clks.dppclk_khz > new_clocks->dppclk_khz)
|
||||
@@ -211,11 +209,18 @@ static void dcn316_update_clocks(struct clk_mgr *clk_mgr_base,
|
||||
update_dppclk = true;
|
||||
}
|
||||
|
||||
if (should_set_clock(safe_to_lower, new_clocks->dispclk_khz, clk_mgr_base->clks.dispclk_khz)) {
|
||||
if (should_set_clock(safe_to_lower, new_clocks->dispclk_khz, clk_mgr_base->clks.dispclk_khz) &&
|
||||
(new_clocks->dispclk_khz > 0 || (safe_to_lower && display_count == 0))) {
|
||||
int requested_dispclk_khz = new_clocks->dispclk_khz;
|
||||
|
||||
dcn316_disable_otg_wa(clk_mgr_base, context, safe_to_lower, true);
|
||||
|
||||
/* Clamp the requested clock to PMFW based on their limit. */
|
||||
if (dc->debug.min_disp_clk_khz > 0 && requested_dispclk_khz < dc->debug.min_disp_clk_khz)
|
||||
requested_dispclk_khz = dc->debug.min_disp_clk_khz;
|
||||
|
||||
dcn316_smu_set_dispclk(clk_mgr, requested_dispclk_khz);
|
||||
clk_mgr_base->clks.dispclk_khz = new_clocks->dispclk_khz;
|
||||
dcn316_smu_set_dispclk(clk_mgr, clk_mgr_base->clks.dispclk_khz);
|
||||
dcn316_disable_otg_wa(clk_mgr_base, context, safe_to_lower, false);
|
||||
|
||||
update_dispclk = true;
|
||||
|
||||
@@ -438,9 +438,12 @@ bool dc_stream_adjust_vmin_vmax(struct dc *dc,
|
||||
* Don't adjust DRR while there's bandwidth optimizations pending to
|
||||
* avoid conflicting with firmware updates.
|
||||
*/
|
||||
if (dc->ctx->dce_version > DCE_VERSION_MAX)
|
||||
if (dc->optimized_required || dc->wm_optimized_required)
|
||||
if (dc->ctx->dce_version > DCE_VERSION_MAX) {
|
||||
if (dc->optimized_required || dc->wm_optimized_required) {
|
||||
stream->adjust.timing_adjust_pending = true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
dc_exit_ips_for_hw_access(dc);
|
||||
|
||||
@@ -452,6 +455,7 @@ bool dc_stream_adjust_vmin_vmax(struct dc *dc,
|
||||
|
||||
if (dc->caps.max_v_total != 0 &&
|
||||
(adjust->v_total_max > dc->caps.max_v_total || adjust->v_total_min > dc->caps.max_v_total)) {
|
||||
stream->adjust.timing_adjust_pending = false;
|
||||
if (adjust->allow_otg_v_count_halt)
|
||||
return set_long_vtotal(dc, stream, adjust);
|
||||
else
|
||||
@@ -465,7 +469,7 @@ bool dc_stream_adjust_vmin_vmax(struct dc *dc,
|
||||
dc->hwss.set_drr(&pipe,
|
||||
1,
|
||||
*adjust);
|
||||
|
||||
stream->adjust.timing_adjust_pending = false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -2975,8 +2979,14 @@ static void copy_stream_update_to_stream(struct dc *dc,
|
||||
if (update->vrr_active_fixed)
|
||||
stream->vrr_active_fixed = *update->vrr_active_fixed;
|
||||
|
||||
if (update->crtc_timing_adjust)
|
||||
if (update->crtc_timing_adjust) {
|
||||
if (stream->adjust.v_total_min != update->crtc_timing_adjust->v_total_min ||
|
||||
stream->adjust.v_total_max != update->crtc_timing_adjust->v_total_max ||
|
||||
stream->adjust.timing_adjust_pending)
|
||||
update->crtc_timing_adjust->timing_adjust_pending = true;
|
||||
stream->adjust = *update->crtc_timing_adjust;
|
||||
update->crtc_timing_adjust->timing_adjust_pending = false;
|
||||
}
|
||||
|
||||
if (update->dpms_off)
|
||||
stream->dpms_off = *update->dpms_off;
|
||||
|
||||
@@ -554,6 +554,21 @@ void set_p_state_switch_method(
|
||||
}
|
||||
}
|
||||
|
||||
void set_drr_and_clear_adjust_pending(
|
||||
struct pipe_ctx *pipe_ctx,
|
||||
struct dc_stream_state *stream,
|
||||
struct drr_params *params)
|
||||
{
|
||||
/* params can be null.*/
|
||||
if (pipe_ctx && pipe_ctx->stream_res.tg &&
|
||||
pipe_ctx->stream_res.tg->funcs->set_drr)
|
||||
pipe_ctx->stream_res.tg->funcs->set_drr(
|
||||
pipe_ctx->stream_res.tg, params);
|
||||
|
||||
if (stream)
|
||||
stream->adjust.timing_adjust_pending = false;
|
||||
}
|
||||
|
||||
void get_fams2_visual_confirm_color(
|
||||
struct dc *dc,
|
||||
struct dc_state *context,
|
||||
|
||||
@@ -1000,6 +1000,7 @@ struct dc_crtc_timing_adjust {
|
||||
uint32_t v_total_mid;
|
||||
uint32_t v_total_mid_frame_num;
|
||||
uint32_t allow_otg_v_count_halt;
|
||||
uint8_t timing_adjust_pending;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -580,9 +580,6 @@ static void dccg401_set_dpstreamclk(
|
||||
int otg_inst,
|
||||
int dp_hpo_inst)
|
||||
{
|
||||
/* set the dtbclk_p source */
|
||||
dccg401_set_dtbclk_p_src(dccg, src, otg_inst);
|
||||
|
||||
/* enabled to select one of the DTBCLKs for pipe */
|
||||
if (src == REFCLK)
|
||||
dccg401_disable_dpstreamclk(dccg, dp_hpo_inst);
|
||||
|
||||
@@ -195,9 +195,9 @@ struct _vcs_dpi_soc_bounding_box_st dcn3_5_soc = {
|
||||
.dcn_downspread_percent = 0.5,
|
||||
.gpuvm_min_page_size_bytes = 4096,
|
||||
.hostvm_min_page_size_bytes = 4096,
|
||||
.do_urgent_latency_adjustment = 0,
|
||||
.do_urgent_latency_adjustment = 1,
|
||||
.urgent_latency_adjustment_fabric_clock_component_us = 0,
|
||||
.urgent_latency_adjustment_fabric_clock_reference_mhz = 0,
|
||||
.urgent_latency_adjustment_fabric_clock_reference_mhz = 3000,
|
||||
};
|
||||
|
||||
void dcn35_build_wm_range_table_fpu(struct clk_mgr *clk_mgr)
|
||||
|
||||
@@ -1064,7 +1064,8 @@ void dce110_edp_backlight_control(
|
||||
DC_LOG_DC("edp_receiver_ready_T9 skipped\n");
|
||||
}
|
||||
|
||||
if (!enable && link->dpcd_sink_ext_caps.bits.oled) {
|
||||
if (!enable) {
|
||||
/*follow oem panel config's requirement*/
|
||||
pre_T11_delay += link->panel_config.pps.extra_pre_t11_ms;
|
||||
msleep(pre_T11_delay);
|
||||
}
|
||||
@@ -1653,9 +1654,7 @@ enum dc_status dce110_apply_single_controller_ctx_to_hw(
|
||||
|
||||
params.vertical_total_min = stream->adjust.v_total_min;
|
||||
params.vertical_total_max = stream->adjust.v_total_max;
|
||||
if (pipe_ctx->stream_res.tg->funcs->set_drr)
|
||||
pipe_ctx->stream_res.tg->funcs->set_drr(
|
||||
pipe_ctx->stream_res.tg, ¶ms);
|
||||
set_drr_and_clear_adjust_pending(pipe_ctx, stream, ¶ms);
|
||||
|
||||
// DRR should set trigger event to monitor surface update event
|
||||
if (stream->adjust.v_total_min != 0 && stream->adjust.v_total_max != 0)
|
||||
@@ -2103,8 +2102,7 @@ static void set_drr(struct pipe_ctx **pipe_ctx,
|
||||
struct timing_generator *tg = pipe_ctx[i]->stream_res.tg;
|
||||
|
||||
if ((tg != NULL) && tg->funcs) {
|
||||
if (tg->funcs->set_drr)
|
||||
tg->funcs->set_drr(tg, ¶ms);
|
||||
set_drr_and_clear_adjust_pending(pipe_ctx[i], pipe_ctx[i]->stream, ¶ms);
|
||||
if (adjust.v_total_max != 0 && adjust.v_total_min != 0)
|
||||
if (tg->funcs->set_static_screen_control)
|
||||
tg->funcs->set_static_screen_control(
|
||||
|
||||
@@ -1112,9 +1112,7 @@ static void dcn10_reset_back_end_for_pipe(
|
||||
pipe_ctx->stream_res.tg->funcs->disable_crtc(pipe_ctx->stream_res.tg);
|
||||
|
||||
pipe_ctx->stream_res.tg->funcs->enable_optc_clock(pipe_ctx->stream_res.tg, false);
|
||||
if (pipe_ctx->stream_res.tg->funcs->set_drr)
|
||||
pipe_ctx->stream_res.tg->funcs->set_drr(
|
||||
pipe_ctx->stream_res.tg, NULL);
|
||||
set_drr_and_clear_adjust_pending(pipe_ctx, pipe_ctx->stream, NULL);
|
||||
if (dc_is_hdmi_tmds_signal(pipe_ctx->stream->signal))
|
||||
pipe_ctx->stream->link->phy_state.symclk_ref_cnts.otg = 0;
|
||||
}
|
||||
@@ -3217,8 +3215,7 @@ void dcn10_set_drr(struct pipe_ctx **pipe_ctx,
|
||||
struct timing_generator *tg = pipe_ctx[i]->stream_res.tg;
|
||||
|
||||
if ((tg != NULL) && tg->funcs) {
|
||||
if (tg->funcs->set_drr)
|
||||
tg->funcs->set_drr(tg, ¶ms);
|
||||
set_drr_and_clear_adjust_pending(pipe_ctx[i], pipe_ctx[i]->stream, ¶ms);
|
||||
if (adjust.v_total_max != 0 && adjust.v_total_min != 0)
|
||||
if (tg->funcs->set_static_screen_control)
|
||||
tg->funcs->set_static_screen_control(
|
||||
|
||||
@@ -952,9 +952,7 @@ enum dc_status dcn20_enable_stream_timing(
|
||||
params.vertical_total_max = stream->adjust.v_total_max;
|
||||
params.vertical_total_mid = stream->adjust.v_total_mid;
|
||||
params.vertical_total_mid_frame_num = stream->adjust.v_total_mid_frame_num;
|
||||
if (pipe_ctx->stream_res.tg->funcs->set_drr)
|
||||
pipe_ctx->stream_res.tg->funcs->set_drr(
|
||||
pipe_ctx->stream_res.tg, ¶ms);
|
||||
set_drr_and_clear_adjust_pending(pipe_ctx, stream, ¶ms);
|
||||
|
||||
// DRR should set trigger event to monitor surface update event
|
||||
if (stream->adjust.v_total_min != 0 && stream->adjust.v_total_max != 0)
|
||||
@@ -2822,9 +2820,7 @@ void dcn20_reset_back_end_for_pipe(
|
||||
pipe_ctx->stream_res.tg->funcs->set_odm_bypass(
|
||||
pipe_ctx->stream_res.tg, &pipe_ctx->stream->timing);
|
||||
|
||||
if (pipe_ctx->stream_res.tg->funcs->set_drr)
|
||||
pipe_ctx->stream_res.tg->funcs->set_drr(
|
||||
pipe_ctx->stream_res.tg, NULL);
|
||||
set_drr_and_clear_adjust_pending(pipe_ctx, pipe_ctx->stream, NULL);
|
||||
/* TODO - convert symclk_ref_cnts for otg to a bit map to solve
|
||||
* the case where the same symclk is shared across multiple otg
|
||||
* instances
|
||||
|
||||
@@ -528,9 +528,7 @@ static void dcn31_reset_back_end_for_pipe(
|
||||
if (dc_is_hdmi_tmds_signal(pipe_ctx->stream->signal))
|
||||
pipe_ctx->stream->link->phy_state.symclk_ref_cnts.otg = 0;
|
||||
|
||||
if (pipe_ctx->stream_res.tg->funcs->set_drr)
|
||||
pipe_ctx->stream_res.tg->funcs->set_drr(
|
||||
pipe_ctx->stream_res.tg, NULL);
|
||||
set_drr_and_clear_adjust_pending(pipe_ctx, pipe_ctx->stream, NULL);
|
||||
|
||||
link = pipe_ctx->stream->link;
|
||||
/* DPMS may already disable or */
|
||||
|
||||
@@ -1452,8 +1452,7 @@ void dcn35_set_drr(struct pipe_ctx **pipe_ctx,
|
||||
num_frames = 2 * (frame_rate % 60);
|
||||
}
|
||||
}
|
||||
if (tg->funcs->set_drr)
|
||||
tg->funcs->set_drr(tg, ¶ms);
|
||||
set_drr_and_clear_adjust_pending(pipe_ctx[i], pipe_ctx[i]->stream, ¶ms);
|
||||
if (adjust.v_total_max != 0 && adjust.v_total_min != 0)
|
||||
if (tg->funcs->set_static_screen_control)
|
||||
tg->funcs->set_static_screen_control(
|
||||
|
||||
@@ -844,6 +844,13 @@ enum dc_status dcn401_enable_stream_timing(
|
||||
odm_slice_width, last_odm_slice_width);
|
||||
}
|
||||
|
||||
/* set DTBCLK_P */
|
||||
if (dc->res_pool->dccg->funcs->set_dtbclk_p_src) {
|
||||
if (dc_is_dp_signal(stream->signal) || dc_is_virtual_signal(stream->signal)) {
|
||||
dc->res_pool->dccg->funcs->set_dtbclk_p_src(dc->res_pool->dccg, DPREFCLK, pipe_ctx->stream_res.tg->inst);
|
||||
}
|
||||
}
|
||||
|
||||
/* HW program guide assume display already disable
|
||||
* by unplug sequence. OTG assume stop.
|
||||
*/
|
||||
@@ -895,10 +902,7 @@ enum dc_status dcn401_enable_stream_timing(
|
||||
}
|
||||
|
||||
hws->funcs.wait_for_blank_complete(pipe_ctx->stream_res.opp);
|
||||
|
||||
if (pipe_ctx->stream_res.tg->funcs->set_drr)
|
||||
pipe_ctx->stream_res.tg->funcs->set_drr(
|
||||
pipe_ctx->stream_res.tg, ¶ms);
|
||||
set_drr_and_clear_adjust_pending(pipe_ctx, stream, ¶ms);
|
||||
|
||||
/* Event triggers and num frames initialized for DRR, but can be
|
||||
* later updated for PSR use. Note DRR trigger events are generated
|
||||
@@ -1007,8 +1011,6 @@ void dcn401_enable_stream(struct pipe_ctx *pipe_ctx)
|
||||
dccg->funcs->enable_symclk32_se(dccg, dp_hpo_inst, phyd32clk);
|
||||
}
|
||||
} else {
|
||||
/* need to set DTBCLK_P source to DPREFCLK for DP8B10B */
|
||||
dccg->funcs->set_dtbclk_p_src(dccg, DPREFCLK, tg->inst);
|
||||
dccg->funcs->enable_symclk_se(dccg, stream_enc->stream_enc_inst,
|
||||
link_enc->transmitter - TRANSMITTER_UNIPHY_A);
|
||||
}
|
||||
@@ -1773,3 +1775,128 @@ void dcn401_program_outstanding_updates(struct dc *dc,
|
||||
if (hubbub->funcs->program_compbuf_segments)
|
||||
hubbub->funcs->program_compbuf_segments(hubbub, context->bw_ctx.bw.dcn.arb_regs.compbuf_size, true);
|
||||
}
|
||||
|
||||
void dcn401_reset_back_end_for_pipe(
|
||||
struct dc *dc,
|
||||
struct pipe_ctx *pipe_ctx,
|
||||
struct dc_state *context)
|
||||
{
|
||||
int i;
|
||||
struct dc_link *link = pipe_ctx->stream->link;
|
||||
const struct link_hwss *link_hwss = get_link_hwss(link, &pipe_ctx->link_res);
|
||||
|
||||
DC_LOGGER_INIT(dc->ctx->logger);
|
||||
if (pipe_ctx->stream_res.stream_enc == NULL) {
|
||||
pipe_ctx->stream = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
/* DPMS may already disable or */
|
||||
/* dpms_off status is incorrect due to fastboot
|
||||
* feature. When system resume from S4 with second
|
||||
* screen only, the dpms_off would be true but
|
||||
* VBIOS lit up eDP, so check link status too.
|
||||
*/
|
||||
if (!pipe_ctx->stream->dpms_off || link->link_status.link_active)
|
||||
dc->link_srv->set_dpms_off(pipe_ctx);
|
||||
else if (pipe_ctx->stream_res.audio)
|
||||
dc->hwss.disable_audio_stream(pipe_ctx);
|
||||
|
||||
/* free acquired resources */
|
||||
if (pipe_ctx->stream_res.audio) {
|
||||
/*disable az_endpoint*/
|
||||
pipe_ctx->stream_res.audio->funcs->az_disable(pipe_ctx->stream_res.audio);
|
||||
|
||||
/*free audio*/
|
||||
if (dc->caps.dynamic_audio == true) {
|
||||
/*we have to dynamic arbitrate the audio endpoints*/
|
||||
/*we free the resource, need reset is_audio_acquired*/
|
||||
update_audio_usage(&dc->current_state->res_ctx, dc->res_pool,
|
||||
pipe_ctx->stream_res.audio, false);
|
||||
pipe_ctx->stream_res.audio = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* by upper caller loop, parent pipe: pipe0, will be reset last.
|
||||
* back end share by all pipes and will be disable only when disable
|
||||
* parent pipe.
|
||||
*/
|
||||
if (pipe_ctx->top_pipe == NULL) {
|
||||
|
||||
dc->hwss.set_abm_immediate_disable(pipe_ctx);
|
||||
|
||||
pipe_ctx->stream_res.tg->funcs->disable_crtc(pipe_ctx->stream_res.tg);
|
||||
|
||||
pipe_ctx->stream_res.tg->funcs->enable_optc_clock(pipe_ctx->stream_res.tg, false);
|
||||
if (pipe_ctx->stream_res.tg->funcs->set_odm_bypass)
|
||||
pipe_ctx->stream_res.tg->funcs->set_odm_bypass(
|
||||
pipe_ctx->stream_res.tg, &pipe_ctx->stream->timing);
|
||||
|
||||
set_drr_and_clear_adjust_pending(pipe_ctx, pipe_ctx->stream, NULL);
|
||||
|
||||
/* TODO - convert symclk_ref_cnts for otg to a bit map to solve
|
||||
* the case where the same symclk is shared across multiple otg
|
||||
* instances
|
||||
*/
|
||||
if (dc_is_hdmi_tmds_signal(pipe_ctx->stream->signal))
|
||||
link->phy_state.symclk_ref_cnts.otg = 0;
|
||||
if (link->phy_state.symclk_state == SYMCLK_ON_TX_OFF) {
|
||||
link_hwss->disable_link_output(link,
|
||||
&pipe_ctx->link_res, pipe_ctx->stream->signal);
|
||||
link->phy_state.symclk_state = SYMCLK_OFF_TX_OFF;
|
||||
}
|
||||
|
||||
/* reset DTBCLK_P */
|
||||
if (dc->res_pool->dccg->funcs->set_dtbclk_p_src)
|
||||
dc->res_pool->dccg->funcs->set_dtbclk_p_src(dc->res_pool->dccg, REFCLK, pipe_ctx->stream_res.tg->inst);
|
||||
}
|
||||
|
||||
for (i = 0; i < dc->res_pool->pipe_count; i++)
|
||||
if (&dc->current_state->res_ctx.pipe_ctx[i] == pipe_ctx)
|
||||
break;
|
||||
|
||||
if (i == dc->res_pool->pipe_count)
|
||||
return;
|
||||
|
||||
/*
|
||||
* In case of a dangling plane, setting this to NULL unconditionally
|
||||
* causes failures during reset hw ctx where, if stream is NULL,
|
||||
* it is expected that the pipe_ctx pointers to pipes and plane are NULL.
|
||||
*/
|
||||
pipe_ctx->stream = NULL;
|
||||
DC_LOG_DEBUG("Reset back end for pipe %d, tg:%d\n",
|
||||
pipe_ctx->pipe_idx, pipe_ctx->stream_res.tg->inst);
|
||||
}
|
||||
|
||||
void dcn401_reset_hw_ctx_wrap(
|
||||
struct dc *dc,
|
||||
struct dc_state *context)
|
||||
{
|
||||
int i;
|
||||
struct dce_hwseq *hws = dc->hwseq;
|
||||
|
||||
/* Reset Back End*/
|
||||
for (i = dc->res_pool->pipe_count - 1; i >= 0 ; i--) {
|
||||
struct pipe_ctx *pipe_ctx_old =
|
||||
&dc->current_state->res_ctx.pipe_ctx[i];
|
||||
struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
|
||||
|
||||
if (!pipe_ctx_old->stream)
|
||||
continue;
|
||||
|
||||
if (pipe_ctx_old->top_pipe || pipe_ctx_old->prev_odm_pipe)
|
||||
continue;
|
||||
|
||||
if (!pipe_ctx->stream ||
|
||||
pipe_need_reprogram(pipe_ctx_old, pipe_ctx)) {
|
||||
struct clock_source *old_clk = pipe_ctx_old->clock_source;
|
||||
|
||||
if (hws->funcs.reset_back_end_for_pipe)
|
||||
hws->funcs.reset_back_end_for_pipe(dc, pipe_ctx_old, dc->current_state);
|
||||
if (hws->funcs.enable_stream_gating)
|
||||
hws->funcs.enable_stream_gating(dc, pipe_ctx_old);
|
||||
if (old_clk)
|
||||
old_clk->funcs->cs_power_down(old_clk);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,4 +84,11 @@ void adjust_hotspot_between_slices_for_2x_magnify(uint32_t cursor_width, struct
|
||||
void dcn401_wait_for_det_buffer_update(struct dc *dc, struct dc_state *context, struct pipe_ctx *otg_master);
|
||||
void dcn401_interdependent_update_lock(struct dc *dc, struct dc_state *context, bool lock);
|
||||
void dcn401_program_outstanding_updates(struct dc *dc, struct dc_state *context);
|
||||
void dcn401_reset_back_end_for_pipe(
|
||||
struct dc *dc,
|
||||
struct pipe_ctx *pipe_ctx,
|
||||
struct dc_state *context);
|
||||
void dcn401_reset_hw_ctx_wrap(
|
||||
struct dc *dc,
|
||||
struct dc_state *context);
|
||||
#endif /* __DC_HWSS_DCN401_H__ */
|
||||
|
||||
@@ -111,7 +111,7 @@ static const struct hwseq_private_funcs dcn401_private_funcs = {
|
||||
.power_down = dce110_power_down,
|
||||
.enable_display_power_gating = dcn10_dummy_display_power_gating,
|
||||
.blank_pixel_data = dcn20_blank_pixel_data,
|
||||
.reset_hw_ctx_wrap = dcn20_reset_hw_ctx_wrap,
|
||||
.reset_hw_ctx_wrap = dcn401_reset_hw_ctx_wrap,
|
||||
.enable_stream_timing = dcn401_enable_stream_timing,
|
||||
.edp_backlight_control = dce110_edp_backlight_control,
|
||||
.setup_vupdate_interrupt = dcn20_setup_vupdate_interrupt,
|
||||
@@ -136,7 +136,7 @@ static const struct hwseq_private_funcs dcn401_private_funcs = {
|
||||
.update_mall_sel = dcn32_update_mall_sel,
|
||||
.calculate_dccg_k1_k2_values = NULL,
|
||||
.apply_single_controller_ctx_to_hw = dce110_apply_single_controller_ctx_to_hw,
|
||||
.reset_back_end_for_pipe = dcn20_reset_back_end_for_pipe,
|
||||
.reset_back_end_for_pipe = dcn401_reset_back_end_for_pipe,
|
||||
.populate_mcm_luts = NULL,
|
||||
};
|
||||
|
||||
|
||||
@@ -46,6 +46,7 @@ struct dce_hwseq;
|
||||
struct link_resource;
|
||||
struct dc_dmub_cmd;
|
||||
struct pg_block_update;
|
||||
struct drr_params;
|
||||
|
||||
struct subvp_pipe_control_lock_fast_params {
|
||||
struct dc *dc;
|
||||
@@ -509,6 +510,11 @@ void set_p_state_switch_method(
|
||||
struct dc_state *context,
|
||||
struct pipe_ctx *pipe_ctx);
|
||||
|
||||
void set_drr_and_clear_adjust_pending(
|
||||
struct pipe_ctx *pipe_ctx,
|
||||
struct dc_stream_state *stream,
|
||||
struct drr_params *params);
|
||||
|
||||
void hwss_execute_sequence(struct dc *dc,
|
||||
struct block_sequence block_sequence[],
|
||||
int num_steps);
|
||||
|
||||
@@ -1769,13 +1769,10 @@ bool perform_link_training_with_retries(
|
||||
is_link_bw_min = ((cur_link_settings.link_rate <= LINK_RATE_LOW) &&
|
||||
(cur_link_settings.lane_count <= LANE_COUNT_ONE));
|
||||
|
||||
if (is_link_bw_low) {
|
||||
if (is_link_bw_low)
|
||||
DC_LOG_WARNING(
|
||||
"%s: Link(%d) bandwidth too low after fallback req_bw(%d) > link_bw(%d)\n",
|
||||
__func__, link->link_index, req_bw, link_bw);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
msleep(delay_between_attempts);
|
||||
|
||||
@@ -674,6 +674,18 @@ bool edp_setup_psr(struct dc_link *link,
|
||||
if (!link)
|
||||
return false;
|
||||
|
||||
//Clear PSR cfg
|
||||
memset(&psr_configuration, 0, sizeof(psr_configuration));
|
||||
dm_helpers_dp_write_dpcd(
|
||||
link->ctx,
|
||||
link,
|
||||
DP_PSR_EN_CFG,
|
||||
&psr_configuration.raw,
|
||||
sizeof(psr_configuration.raw));
|
||||
|
||||
if (link->psr_settings.psr_version == DC_PSR_VERSION_UNSUPPORTED)
|
||||
return false;
|
||||
|
||||
dc = link->ctx->dc;
|
||||
dmcu = dc->res_pool->dmcu;
|
||||
psr = dc->res_pool->psr;
|
||||
@@ -684,9 +696,6 @@ bool edp_setup_psr(struct dc_link *link,
|
||||
if (!dc_get_edp_link_panel_inst(dc, link, &panel_inst))
|
||||
return false;
|
||||
|
||||
|
||||
memset(&psr_configuration, 0, sizeof(psr_configuration));
|
||||
|
||||
psr_configuration.bits.ENABLE = 1;
|
||||
psr_configuration.bits.CRC_VERIFICATION = 1;
|
||||
psr_configuration.bits.FRAME_CAPTURE_INDICATION =
|
||||
@@ -950,6 +959,16 @@ bool edp_setup_replay(struct dc_link *link, const struct dc_stream_state *stream
|
||||
if (!link)
|
||||
return false;
|
||||
|
||||
//Clear Replay config
|
||||
dm_helpers_dp_write_dpcd(link->ctx, link,
|
||||
DP_SINK_PR_ENABLE_AND_CONFIGURATION,
|
||||
(uint8_t *)&(replay_config.raw), sizeof(uint8_t));
|
||||
|
||||
if (!(link->replay_settings.config.replay_supported))
|
||||
return false;
|
||||
|
||||
link->replay_settings.config.replay_error_status.raw = 0;
|
||||
|
||||
dc = link->ctx->dc;
|
||||
|
||||
replay = dc->res_pool->replay;
|
||||
|
||||
@@ -1699,7 +1699,7 @@ static int dcn315_populate_dml_pipes_from_context(
|
||||
pipes[pipe_cnt].dout.dsc_input_bpc = 0;
|
||||
DC_FP_START();
|
||||
dcn31_zero_pipe_dcc_fraction(pipes, pipe_cnt);
|
||||
if (pixel_rate_crb && !pipe->top_pipe && !pipe->prev_odm_pipe) {
|
||||
if (pixel_rate_crb) {
|
||||
int bpp = source_format_to_bpp(pipes[pipe_cnt].pipe.src.source_format);
|
||||
/* Ceil to crb segment size */
|
||||
int approx_det_segs_required_for_pstate = dcn_get_approx_det_segs_required_for_pstate(
|
||||
@@ -1756,28 +1756,26 @@ static int dcn315_populate_dml_pipes_from_context(
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!pipe->top_pipe && !pipe->prev_odm_pipe) {
|
||||
bool split_required = pipe->stream->timing.pix_clk_100hz >= dcn_get_max_non_odm_pix_rate_100hz(&dc->dml.soc)
|
||||
|| (pipe->plane_state && pipe->plane_state->src_rect.width > 5120);
|
||||
bool split_required = pipe->stream->timing.pix_clk_100hz >= dcn_get_max_non_odm_pix_rate_100hz(&dc->dml.soc)
|
||||
|| (pipe->plane_state && pipe->plane_state->src_rect.width > 5120);
|
||||
|
||||
if (remaining_det_segs > MIN_RESERVED_DET_SEGS && crb_pipes != 0)
|
||||
pipes[pipe_cnt].pipe.src.det_size_override += (remaining_det_segs - MIN_RESERVED_DET_SEGS) / crb_pipes +
|
||||
(crb_idx < (remaining_det_segs - MIN_RESERVED_DET_SEGS) % crb_pipes ? 1 : 0);
|
||||
if (pipes[pipe_cnt].pipe.src.det_size_override > 2 * DCN3_15_MAX_DET_SEGS) {
|
||||
/* Clamp to 2 pipe split max det segments */
|
||||
remaining_det_segs += pipes[pipe_cnt].pipe.src.det_size_override - 2 * (DCN3_15_MAX_DET_SEGS);
|
||||
pipes[pipe_cnt].pipe.src.det_size_override = 2 * DCN3_15_MAX_DET_SEGS;
|
||||
}
|
||||
if (pipes[pipe_cnt].pipe.src.det_size_override > DCN3_15_MAX_DET_SEGS || split_required) {
|
||||
/* If we are splitting we must have an even number of segments */
|
||||
remaining_det_segs += pipes[pipe_cnt].pipe.src.det_size_override % 2;
|
||||
pipes[pipe_cnt].pipe.src.det_size_override -= pipes[pipe_cnt].pipe.src.det_size_override % 2;
|
||||
}
|
||||
/* Convert segments into size for DML use */
|
||||
pipes[pipe_cnt].pipe.src.det_size_override *= DCN3_15_CRB_SEGMENT_SIZE_KB;
|
||||
|
||||
crb_idx++;
|
||||
if (remaining_det_segs > MIN_RESERVED_DET_SEGS && crb_pipes != 0)
|
||||
pipes[pipe_cnt].pipe.src.det_size_override += (remaining_det_segs - MIN_RESERVED_DET_SEGS) / crb_pipes +
|
||||
(crb_idx < (remaining_det_segs - MIN_RESERVED_DET_SEGS) % crb_pipes ? 1 : 0);
|
||||
if (pipes[pipe_cnt].pipe.src.det_size_override > 2 * DCN3_15_MAX_DET_SEGS) {
|
||||
/* Clamp to 2 pipe split max det segments */
|
||||
remaining_det_segs += pipes[pipe_cnt].pipe.src.det_size_override - 2 * (DCN3_15_MAX_DET_SEGS);
|
||||
pipes[pipe_cnt].pipe.src.det_size_override = 2 * DCN3_15_MAX_DET_SEGS;
|
||||
}
|
||||
if (pipes[pipe_cnt].pipe.src.det_size_override > DCN3_15_MAX_DET_SEGS || split_required) {
|
||||
/* If we are splitting we must have an even number of segments */
|
||||
remaining_det_segs += pipes[pipe_cnt].pipe.src.det_size_override % 2;
|
||||
pipes[pipe_cnt].pipe.src.det_size_override -= pipes[pipe_cnt].pipe.src.det_size_override % 2;
|
||||
}
|
||||
/* Convert segments into size for DML use */
|
||||
pipes[pipe_cnt].pipe.src.det_size_override *= DCN3_15_CRB_SEGMENT_SIZE_KB;
|
||||
|
||||
crb_idx++;
|
||||
pipe_cnt++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1975,6 +1975,7 @@ int xe_gem_create_ioctl(struct drm_device *dev, void *data,
|
||||
struct xe_file *xef = to_xe_file(file);
|
||||
struct drm_xe_gem_create *args = data;
|
||||
struct xe_vm *vm = NULL;
|
||||
ktime_t end = 0;
|
||||
struct xe_bo *bo;
|
||||
unsigned int bo_flags;
|
||||
u32 handle;
|
||||
@@ -2047,6 +2048,10 @@ int xe_gem_create_ioctl(struct drm_device *dev, void *data,
|
||||
vm = xe_vm_lookup(xef, args->vm_id);
|
||||
if (XE_IOCTL_DBG(xe, !vm))
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
retry:
|
||||
if (vm) {
|
||||
err = xe_vm_lock(vm, true);
|
||||
if (err)
|
||||
goto out_vm;
|
||||
@@ -2060,6 +2065,8 @@ int xe_gem_create_ioctl(struct drm_device *dev, void *data,
|
||||
|
||||
if (IS_ERR(bo)) {
|
||||
err = PTR_ERR(bo);
|
||||
if (xe_vm_validate_should_retry(NULL, err, &end))
|
||||
goto retry;
|
||||
goto out_vm;
|
||||
}
|
||||
|
||||
|
||||
@@ -406,6 +406,28 @@ int xe_gt_tlb_invalidation_range(struct xe_gt *gt,
|
||||
return send_tlb_invalidation(>->uc.guc, fence, action, len);
|
||||
}
|
||||
|
||||
/**
|
||||
* xe_gt_tlb_invalidation_vm - Issue a TLB invalidation on this GT for a VM
|
||||
* @gt: graphics tile
|
||||
* @vm: VM to invalidate
|
||||
*
|
||||
* Invalidate entire VM's address space
|
||||
*/
|
||||
void xe_gt_tlb_invalidation_vm(struct xe_gt *gt, struct xe_vm *vm)
|
||||
{
|
||||
struct xe_gt_tlb_invalidation_fence fence;
|
||||
u64 range = 1ull << vm->xe->info.va_bits;
|
||||
int ret;
|
||||
|
||||
xe_gt_tlb_invalidation_fence_init(gt, &fence, true);
|
||||
|
||||
ret = xe_gt_tlb_invalidation_range(gt, &fence, 0, range, vm->usm.asid);
|
||||
if (ret < 0)
|
||||
return;
|
||||
|
||||
xe_gt_tlb_invalidation_fence_wait(&fence);
|
||||
}
|
||||
|
||||
/**
|
||||
* xe_gt_tlb_invalidation_vma - Issue a TLB invalidation on this GT for a VMA
|
||||
* @gt: graphics tile
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
struct xe_gt;
|
||||
struct xe_guc;
|
||||
struct xe_vm;
|
||||
struct xe_vma;
|
||||
|
||||
int xe_gt_tlb_invalidation_init_early(struct xe_gt *gt);
|
||||
@@ -21,6 +22,7 @@ int xe_gt_tlb_invalidation_ggtt(struct xe_gt *gt);
|
||||
int xe_gt_tlb_invalidation_vma(struct xe_gt *gt,
|
||||
struct xe_gt_tlb_invalidation_fence *fence,
|
||||
struct xe_vma *vma);
|
||||
void xe_gt_tlb_invalidation_vm(struct xe_gt *gt, struct xe_vm *vm);
|
||||
int xe_gt_tlb_invalidation_range(struct xe_gt *gt,
|
||||
struct xe_gt_tlb_invalidation_fence *fence,
|
||||
u64 start, u64 end, u32 asid);
|
||||
|
||||
@@ -217,6 +217,20 @@ void xe_pt_destroy(struct xe_pt *pt, u32 flags, struct llist_head *deferred)
|
||||
xe_pt_free(pt);
|
||||
}
|
||||
|
||||
/**
|
||||
* xe_pt_clear() - Clear a page-table.
|
||||
* @xe: xe device.
|
||||
* @pt: The page-table.
|
||||
*
|
||||
* Clears page-table by setting to zero.
|
||||
*/
|
||||
void xe_pt_clear(struct xe_device *xe, struct xe_pt *pt)
|
||||
{
|
||||
struct iosys_map *map = &pt->bo->vmap;
|
||||
|
||||
xe_map_memset(xe, map, 0, 0, SZ_4K);
|
||||
}
|
||||
|
||||
/**
|
||||
* DOC: Pagetable building
|
||||
*
|
||||
|
||||
@@ -13,6 +13,7 @@ struct dma_fence;
|
||||
struct xe_bo;
|
||||
struct xe_device;
|
||||
struct xe_exec_queue;
|
||||
struct xe_svm_range;
|
||||
struct xe_sync_entry;
|
||||
struct xe_tile;
|
||||
struct xe_vm;
|
||||
@@ -35,6 +36,8 @@ void xe_pt_populate_empty(struct xe_tile *tile, struct xe_vm *vm,
|
||||
|
||||
void xe_pt_destroy(struct xe_pt *pt, u32 flags, struct llist_head *deferred);
|
||||
|
||||
void xe_pt_clear(struct xe_device *xe, struct xe_pt *pt);
|
||||
|
||||
int xe_pt_update_ops_prepare(struct xe_tile *tile, struct xe_vma_ops *vops);
|
||||
struct dma_fence *xe_pt_update_ops_run(struct xe_tile *tile,
|
||||
struct xe_vma_ops *vops);
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <linux/dma-fence-array.h>
|
||||
#include <linux/nospec.h>
|
||||
|
||||
#include <drm/drm_drv.h>
|
||||
#include <drm/drm_exec.h>
|
||||
#include <drm/drm_print.h>
|
||||
#include <drm/ttm/ttm_execbuf_util.h>
|
||||
@@ -1581,9 +1582,40 @@ err_no_resv:
|
||||
|
||||
static void xe_vm_close(struct xe_vm *vm)
|
||||
{
|
||||
struct xe_device *xe = vm->xe;
|
||||
bool bound;
|
||||
int idx;
|
||||
|
||||
bound = drm_dev_enter(&xe->drm, &idx);
|
||||
|
||||
down_write(&vm->lock);
|
||||
|
||||
vm->size = 0;
|
||||
|
||||
if (!((vm->flags & XE_VM_FLAG_MIGRATION))) {
|
||||
struct xe_tile *tile;
|
||||
struct xe_gt *gt;
|
||||
u8 id;
|
||||
|
||||
/* Wait for pending binds */
|
||||
dma_resv_wait_timeout(xe_vm_resv(vm),
|
||||
DMA_RESV_USAGE_BOOKKEEP,
|
||||
false, MAX_SCHEDULE_TIMEOUT);
|
||||
|
||||
if (bound) {
|
||||
for_each_tile(tile, xe, id)
|
||||
if (vm->pt_root[id])
|
||||
xe_pt_clear(xe, vm->pt_root[id]);
|
||||
|
||||
for_each_gt(gt, xe, id)
|
||||
xe_gt_tlb_invalidation_vm(gt, vm);
|
||||
}
|
||||
}
|
||||
|
||||
up_write(&vm->lock);
|
||||
|
||||
if (bound)
|
||||
drm_dev_exit(idx);
|
||||
}
|
||||
|
||||
void xe_vm_close_and_put(struct xe_vm *vm)
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
#define DELL_SMM_LEGACY_EXECUTE 0x1
|
||||
|
||||
#define DELL_SMM_NO_TEMP 10
|
||||
#define DELL_SMM_NO_FANS 3
|
||||
#define DELL_SMM_NO_FANS 4
|
||||
|
||||
struct smm_regs {
|
||||
unsigned int eax;
|
||||
@@ -1074,11 +1074,14 @@ static const struct hwmon_channel_info * const dell_smm_info[] = {
|
||||
HWMON_F_INPUT | HWMON_F_LABEL | HWMON_F_MIN | HWMON_F_MAX |
|
||||
HWMON_F_TARGET,
|
||||
HWMON_F_INPUT | HWMON_F_LABEL | HWMON_F_MIN | HWMON_F_MAX |
|
||||
HWMON_F_TARGET,
|
||||
HWMON_F_INPUT | HWMON_F_LABEL | HWMON_F_MIN | HWMON_F_MAX |
|
||||
HWMON_F_TARGET
|
||||
),
|
||||
HWMON_CHANNEL_INFO(pwm,
|
||||
HWMON_PWM_INPUT | HWMON_PWM_ENABLE,
|
||||
HWMON_PWM_INPUT,
|
||||
HWMON_PWM_INPUT,
|
||||
HWMON_PWM_INPUT
|
||||
),
|
||||
NULL
|
||||
|
||||
@@ -84,7 +84,7 @@ struct etb_drvdata {
|
||||
struct clk *atclk;
|
||||
struct coresight_device *csdev;
|
||||
struct miscdevice miscdev;
|
||||
spinlock_t spinlock;
|
||||
raw_spinlock_t spinlock;
|
||||
local_t reading;
|
||||
pid_t pid;
|
||||
u8 *buf;
|
||||
@@ -145,7 +145,7 @@ static int etb_enable_sysfs(struct coresight_device *csdev)
|
||||
unsigned long flags;
|
||||
struct etb_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent);
|
||||
|
||||
spin_lock_irqsave(&drvdata->spinlock, flags);
|
||||
raw_spin_lock_irqsave(&drvdata->spinlock, flags);
|
||||
|
||||
/* Don't messup with perf sessions. */
|
||||
if (coresight_get_mode(csdev) == CS_MODE_PERF) {
|
||||
@@ -163,7 +163,7 @@ static int etb_enable_sysfs(struct coresight_device *csdev)
|
||||
|
||||
csdev->refcnt++;
|
||||
out:
|
||||
spin_unlock_irqrestore(&drvdata->spinlock, flags);
|
||||
raw_spin_unlock_irqrestore(&drvdata->spinlock, flags);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ static int etb_enable_perf(struct coresight_device *csdev, void *data)
|
||||
struct perf_output_handle *handle = data;
|
||||
struct cs_buffers *buf = etm_perf_sink_config(handle);
|
||||
|
||||
spin_lock_irqsave(&drvdata->spinlock, flags);
|
||||
raw_spin_lock_irqsave(&drvdata->spinlock, flags);
|
||||
|
||||
/* No need to continue if the component is already in used by sysFS. */
|
||||
if (coresight_get_mode(drvdata->csdev) == CS_MODE_SYSFS) {
|
||||
@@ -219,7 +219,7 @@ static int etb_enable_perf(struct coresight_device *csdev, void *data)
|
||||
}
|
||||
|
||||
out:
|
||||
spin_unlock_irqrestore(&drvdata->spinlock, flags);
|
||||
raw_spin_unlock_irqrestore(&drvdata->spinlock, flags);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -352,11 +352,11 @@ static int etb_disable(struct coresight_device *csdev)
|
||||
struct etb_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent);
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&drvdata->spinlock, flags);
|
||||
raw_spin_lock_irqsave(&drvdata->spinlock, flags);
|
||||
|
||||
csdev->refcnt--;
|
||||
if (csdev->refcnt) {
|
||||
spin_unlock_irqrestore(&drvdata->spinlock, flags);
|
||||
raw_spin_unlock_irqrestore(&drvdata->spinlock, flags);
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
@@ -366,7 +366,7 @@ static int etb_disable(struct coresight_device *csdev)
|
||||
/* Dissociate from monitored process. */
|
||||
drvdata->pid = -1;
|
||||
coresight_set_mode(csdev, CS_MODE_DISABLED);
|
||||
spin_unlock_irqrestore(&drvdata->spinlock, flags);
|
||||
raw_spin_unlock_irqrestore(&drvdata->spinlock, flags);
|
||||
|
||||
dev_dbg(&csdev->dev, "ETB disabled\n");
|
||||
return 0;
|
||||
@@ -443,7 +443,7 @@ static unsigned long etb_update_buffer(struct coresight_device *csdev,
|
||||
|
||||
capacity = drvdata->buffer_depth * ETB_FRAME_SIZE_WORDS;
|
||||
|
||||
spin_lock_irqsave(&drvdata->spinlock, flags);
|
||||
raw_spin_lock_irqsave(&drvdata->spinlock, flags);
|
||||
|
||||
/* Don't do anything if another tracer is using this sink */
|
||||
if (csdev->refcnt != 1)
|
||||
@@ -566,7 +566,7 @@ static unsigned long etb_update_buffer(struct coresight_device *csdev,
|
||||
__etb_enable_hw(drvdata);
|
||||
CS_LOCK(drvdata->base);
|
||||
out:
|
||||
spin_unlock_irqrestore(&drvdata->spinlock, flags);
|
||||
raw_spin_unlock_irqrestore(&drvdata->spinlock, flags);
|
||||
|
||||
return to_read;
|
||||
}
|
||||
@@ -587,13 +587,13 @@ static void etb_dump(struct etb_drvdata *drvdata)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&drvdata->spinlock, flags);
|
||||
raw_spin_lock_irqsave(&drvdata->spinlock, flags);
|
||||
if (coresight_get_mode(drvdata->csdev) == CS_MODE_SYSFS) {
|
||||
__etb_disable_hw(drvdata);
|
||||
etb_dump_hw(drvdata);
|
||||
__etb_enable_hw(drvdata);
|
||||
}
|
||||
spin_unlock_irqrestore(&drvdata->spinlock, flags);
|
||||
raw_spin_unlock_irqrestore(&drvdata->spinlock, flags);
|
||||
|
||||
dev_dbg(&drvdata->csdev->dev, "ETB dumped\n");
|
||||
}
|
||||
@@ -746,7 +746,7 @@ static int etb_probe(struct amba_device *adev, const struct amba_id *id)
|
||||
drvdata->base = base;
|
||||
desc.access = CSDEV_ACCESS_IOMEM(base);
|
||||
|
||||
spin_lock_init(&drvdata->spinlock);
|
||||
raw_spin_lock_init(&drvdata->spinlock);
|
||||
|
||||
drvdata->buffer_depth = etb_get_buffer_depth(drvdata);
|
||||
|
||||
|
||||
@@ -60,6 +60,7 @@ config INTEL_TH_STH
|
||||
|
||||
config INTEL_TH_MSU
|
||||
tristate "Intel(R) Trace Hub Memory Storage Unit"
|
||||
depends on MMU
|
||||
help
|
||||
Memory Storage Unit (MSU) trace output device enables
|
||||
storing STP traces to system memory. It supports single
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <linux/io.h>
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
#include <linux/pfn_t.h>
|
||||
|
||||
#ifdef CONFIG_X86
|
||||
#include <asm/set_memory.h>
|
||||
@@ -967,7 +968,6 @@ static void msc_buffer_contig_free(struct msc *msc)
|
||||
for (off = 0; off < msc->nr_pages << PAGE_SHIFT; off += PAGE_SIZE) {
|
||||
struct page *page = virt_to_page(msc->base + off);
|
||||
|
||||
page->mapping = NULL;
|
||||
__free_page(page);
|
||||
}
|
||||
|
||||
@@ -1149,9 +1149,6 @@ static void __msc_buffer_win_free(struct msc *msc, struct msc_window *win)
|
||||
int i;
|
||||
|
||||
for_each_sg(win->sgt->sgl, sg, win->nr_segs, i) {
|
||||
struct page *page = msc_sg_page(sg);
|
||||
|
||||
page->mapping = NULL;
|
||||
dma_free_coherent(msc_dev(win->msc)->parent->parent, PAGE_SIZE,
|
||||
sg_virt(sg), sg_dma_address(sg));
|
||||
}
|
||||
@@ -1592,22 +1589,10 @@ static void msc_mmap_close(struct vm_area_struct *vma)
|
||||
{
|
||||
struct msc_iter *iter = vma->vm_file->private_data;
|
||||
struct msc *msc = iter->msc;
|
||||
unsigned long pg;
|
||||
|
||||
if (!atomic_dec_and_mutex_lock(&msc->mmap_count, &msc->buf_mutex))
|
||||
return;
|
||||
|
||||
/* drop page _refcounts */
|
||||
for (pg = 0; pg < msc->nr_pages; pg++) {
|
||||
struct page *page = msc_buffer_get_page(msc, pg);
|
||||
|
||||
if (WARN_ON_ONCE(!page))
|
||||
continue;
|
||||
|
||||
if (page->mapping)
|
||||
page->mapping = NULL;
|
||||
}
|
||||
|
||||
/* last mapping -- drop user_count */
|
||||
atomic_dec(&msc->user_count);
|
||||
mutex_unlock(&msc->buf_mutex);
|
||||
@@ -1617,16 +1602,14 @@ static vm_fault_t msc_mmap_fault(struct vm_fault *vmf)
|
||||
{
|
||||
struct msc_iter *iter = vmf->vma->vm_file->private_data;
|
||||
struct msc *msc = iter->msc;
|
||||
struct page *page;
|
||||
|
||||
vmf->page = msc_buffer_get_page(msc, vmf->pgoff);
|
||||
if (!vmf->page)
|
||||
page = msc_buffer_get_page(msc, vmf->pgoff);
|
||||
if (!page)
|
||||
return VM_FAULT_SIGBUS;
|
||||
|
||||
get_page(vmf->page);
|
||||
vmf->page->mapping = vmf->vma->vm_file->f_mapping;
|
||||
vmf->page->index = vmf->pgoff;
|
||||
|
||||
return 0;
|
||||
get_page(page);
|
||||
return vmf_insert_mixed(vmf->vma, vmf->address, page_to_pfn_t(page));
|
||||
}
|
||||
|
||||
static const struct vm_operations_struct msc_mmap_ops = {
|
||||
@@ -1667,7 +1650,7 @@ out:
|
||||
atomic_dec(&msc->user_count);
|
||||
|
||||
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
|
||||
vm_flags_set(vma, VM_DONTEXPAND | VM_DONTCOPY);
|
||||
vm_flags_set(vma, VM_DONTEXPAND | VM_DONTCOPY | VM_MIXEDMAP);
|
||||
vma->vm_ops = &msc_mmap_ops;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -207,6 +207,7 @@ static const struct software_node dgpu_node = {
|
||||
static int i2c_dw_pci_probe(struct pci_dev *pdev,
|
||||
const struct pci_device_id *id)
|
||||
{
|
||||
struct device *device = &pdev->dev;
|
||||
struct dw_i2c_dev *dev;
|
||||
struct i2c_adapter *adap;
|
||||
int r;
|
||||
@@ -214,25 +215,22 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev,
|
||||
struct dw_scl_sda_cfg *cfg;
|
||||
|
||||
if (id->driver_data >= ARRAY_SIZE(dw_pci_controllers))
|
||||
return dev_err_probe(&pdev->dev, -EINVAL,
|
||||
"Invalid driver data %ld\n",
|
||||
return dev_err_probe(device, -EINVAL, "Invalid driver data %ld\n",
|
||||
id->driver_data);
|
||||
|
||||
controller = &dw_pci_controllers[id->driver_data];
|
||||
|
||||
r = pcim_enable_device(pdev);
|
||||
if (r)
|
||||
return dev_err_probe(&pdev->dev, r,
|
||||
"Failed to enable I2C PCI device\n");
|
||||
return dev_err_probe(device, r, "Failed to enable I2C PCI device\n");
|
||||
|
||||
pci_set_master(pdev);
|
||||
|
||||
r = pcim_iomap_regions(pdev, 1 << 0, pci_name(pdev));
|
||||
if (r)
|
||||
return dev_err_probe(&pdev->dev, r,
|
||||
"I/O memory remapping failed\n");
|
||||
return dev_err_probe(device, r, "I/O memory remapping failed\n");
|
||||
|
||||
dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL);
|
||||
dev = devm_kzalloc(device, sizeof(*dev), GFP_KERNEL);
|
||||
if (!dev)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -242,7 +240,7 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev,
|
||||
|
||||
dev->get_clk_rate_khz = controller->get_clk_rate_khz;
|
||||
dev->base = pcim_iomap_table(pdev)[0];
|
||||
dev->dev = &pdev->dev;
|
||||
dev->dev = device;
|
||||
dev->irq = pci_irq_vector(pdev, 0);
|
||||
dev->flags |= controller->flags;
|
||||
|
||||
@@ -280,15 +278,17 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev,
|
||||
|
||||
if ((dev->flags & MODEL_MASK) == MODEL_AMD_NAVI_GPU) {
|
||||
dev->slave = i2c_new_ccgx_ucsi(&dev->adapter, dev->irq, &dgpu_node);
|
||||
if (IS_ERR(dev->slave))
|
||||
return dev_err_probe(dev->dev, PTR_ERR(dev->slave),
|
||||
if (IS_ERR(dev->slave)) {
|
||||
i2c_del_adapter(&dev->adapter);
|
||||
return dev_err_probe(device, PTR_ERR(dev->slave),
|
||||
"register UCSI failed\n");
|
||||
}
|
||||
}
|
||||
|
||||
pm_runtime_set_autosuspend_delay(&pdev->dev, 1000);
|
||||
pm_runtime_use_autosuspend(&pdev->dev);
|
||||
pm_runtime_put_autosuspend(&pdev->dev);
|
||||
pm_runtime_allow(&pdev->dev);
|
||||
pm_runtime_set_autosuspend_delay(device, 1000);
|
||||
pm_runtime_use_autosuspend(device);
|
||||
pm_runtime_put_autosuspend(device);
|
||||
pm_runtime_allow(device);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -296,11 +296,12 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev,
|
||||
static void i2c_dw_pci_remove(struct pci_dev *pdev)
|
||||
{
|
||||
struct dw_i2c_dev *dev = pci_get_drvdata(pdev);
|
||||
struct device *device = &pdev->dev;
|
||||
|
||||
i2c_dw_disable(dev);
|
||||
|
||||
pm_runtime_forbid(&pdev->dev);
|
||||
pm_runtime_get_noresume(&pdev->dev);
|
||||
pm_runtime_forbid(device);
|
||||
pm_runtime_get_noresume(device);
|
||||
|
||||
i2c_del_adapter(&dev->adapter);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user