mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-16 18:08:20 +00:00
Merge branch 'master' into mm-hotfixes-stable
This commit is contained in:
commit
0c92218f4e
@ -59,15 +59,6 @@ Description:
|
||||
brightness. Reading this file when no hw brightness change
|
||||
event has happened will return an ENODATA error.
|
||||
|
||||
What: /sys/class/leds/<led>/color
|
||||
Date: June 2023
|
||||
KernelVersion: 6.5
|
||||
Description:
|
||||
Color of the LED.
|
||||
|
||||
This is a read-only file. Reading this file returns the color
|
||||
of the LED as a string (e.g: "red", "green", "multicolor").
|
||||
|
||||
What: /sys/class/leds/<led>/trigger
|
||||
Date: March 2006
|
||||
KernelVersion: 2.6.17
|
||||
|
@ -9,7 +9,7 @@ title: NXP S32G2 pin controller
|
||||
|
||||
maintainers:
|
||||
- Ghennadi Procopciuc <Ghennadi.Procopciuc@oss.nxp.com>
|
||||
- Chester Lin <clin@suse.com>
|
||||
- Chester Lin <chester62515@gmail.com>
|
||||
|
||||
description: |
|
||||
S32G2 pinmux is implemented in SIUL2 (System Integration Unit Lite2),
|
||||
|
@ -36,7 +36,11 @@ properties:
|
||||
|
||||
vdd-supply:
|
||||
description:
|
||||
VDD power supply to the hub
|
||||
3V3 power supply to the hub
|
||||
|
||||
vdd2-supply:
|
||||
description:
|
||||
1V2 power supply to the hub
|
||||
|
||||
peer-hub:
|
||||
$ref: /schemas/types.yaml#/definitions/phandle
|
||||
@ -62,6 +66,7 @@ allOf:
|
||||
properties:
|
||||
reset-gpios: false
|
||||
vdd-supply: false
|
||||
vdd2-supply: false
|
||||
peer-hub: false
|
||||
i2c-bus: false
|
||||
else:
|
||||
|
@ -521,8 +521,8 @@ examples:
|
||||
|
||||
interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 488 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 489 IRQ_TYPE_LEVEL_HIGH>;
|
||||
<GIC_SPI 488 IRQ_TYPE_EDGE_BOTH>,
|
||||
<GIC_SPI 489 IRQ_TYPE_EDGE_BOTH>;
|
||||
interrupt-names = "hs_phy_irq", "ss_phy_irq",
|
||||
"dm_hs_phy_irq", "dp_hs_phy_irq";
|
||||
|
||||
|
@ -41,7 +41,7 @@ examples:
|
||||
- |
|
||||
usb {
|
||||
phys = <&usb2_phy1>, <&usb3_phy1>;
|
||||
phy-names = "usb";
|
||||
phy-names = "usb2", "usb3";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
|
11
MAINTAINERS
11
MAINTAINERS
@ -5064,7 +5064,6 @@ CLANG CONTROL FLOW INTEGRITY SUPPORT
|
||||
M: Sami Tolvanen <samitolvanen@google.com>
|
||||
M: Kees Cook <keescook@chromium.org>
|
||||
R: Nathan Chancellor <nathan@kernel.org>
|
||||
R: Nick Desaulniers <ndesaulniers@google.com>
|
||||
L: llvm@lists.linux.dev
|
||||
S: Supported
|
||||
B: https://github.com/ClangBuiltLinux/linux/issues
|
||||
@ -5079,8 +5078,9 @@ F: .clang-format
|
||||
|
||||
CLANG/LLVM BUILD SUPPORT
|
||||
M: Nathan Chancellor <nathan@kernel.org>
|
||||
M: Nick Desaulniers <ndesaulniers@google.com>
|
||||
R: Tom Rix <trix@redhat.com>
|
||||
R: Nick Desaulniers <ndesaulniers@google.com>
|
||||
R: Bill Wendling <morbo@google.com>
|
||||
R: Justin Stitt <justinstitt@google.com>
|
||||
L: llvm@lists.linux.dev
|
||||
S: Supported
|
||||
W: https://clangbuiltlinux.github.io/
|
||||
@ -5230,7 +5230,6 @@ F: drivers/platform/x86/compal-laptop.c
|
||||
|
||||
COMPILER ATTRIBUTES
|
||||
M: Miguel Ojeda <ojeda@kernel.org>
|
||||
R: Nick Desaulniers <ndesaulniers@google.com>
|
||||
S: Maintained
|
||||
F: include/linux/compiler_attributes.h
|
||||
|
||||
@ -11458,7 +11457,6 @@ F: fs/autofs/
|
||||
KERNEL BUILD + files below scripts/ (unless maintained elsewhere)
|
||||
M: Masahiro Yamada <masahiroy@kernel.org>
|
||||
R: Nathan Chancellor <nathan@kernel.org>
|
||||
R: Nick Desaulniers <ndesaulniers@google.com>
|
||||
R: Nicolas Schier <nicolas@fjasle.eu>
|
||||
L: linux-kbuild@vger.kernel.org
|
||||
S: Maintained
|
||||
@ -17881,6 +17879,8 @@ L: iommu@lists.linux.dev
|
||||
L: linux-arm-msm@vger.kernel.org
|
||||
S: Maintained
|
||||
F: drivers/iommu/arm/arm-smmu/qcom_iommu.c
|
||||
F: drivers/iommu/arm/arm-smmu/arm-smmu-qcom*
|
||||
F: drivers/iommu/msm_iommu*
|
||||
|
||||
QUALCOMM IPC ROUTER (QRTR) DRIVER
|
||||
M: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
|
||||
@ -21988,6 +21988,7 @@ F: drivers/watchdog/tqmx86_wdt.c
|
||||
TRACING
|
||||
M: Steven Rostedt <rostedt@goodmis.org>
|
||||
M: Masami Hiramatsu <mhiramat@kernel.org>
|
||||
R: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
|
||||
L: linux-kernel@vger.kernel.org
|
||||
L: linux-trace-kernel@vger.kernel.org
|
||||
S: Maintained
|
||||
|
2
Makefile
2
Makefile
@ -2,7 +2,7 @@
|
||||
VERSION = 6
|
||||
PATCHLEVEL = 7
|
||||
SUBLEVEL = 0
|
||||
EXTRAVERSION = -rc2
|
||||
EXTRAVERSION = -rc4
|
||||
NAME = Hurr durr I'ma ninja sloth
|
||||
|
||||
# *DOCUMENTATION*
|
||||
|
@ -484,7 +484,8 @@ static int __init xen_guest_init(void)
|
||||
* for secondary CPUs as they are brought up.
|
||||
* For uniformity we use VCPUOP_register_vcpu_info even on cpu0.
|
||||
*/
|
||||
xen_vcpu_info = alloc_percpu(struct vcpu_info);
|
||||
xen_vcpu_info = __alloc_percpu(sizeof(struct vcpu_info),
|
||||
1 << fls(sizeof(struct vcpu_info) - 1));
|
||||
if (xen_vcpu_info == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
|
@ -158,7 +158,7 @@ endif
|
||||
|
||||
all: $(notdir $(KBUILD_IMAGE))
|
||||
|
||||
|
||||
vmlinuz.efi: Image
|
||||
Image vmlinuz.efi: vmlinux
|
||||
$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
|
||||
|
||||
|
@ -21,9 +21,22 @@ static inline bool arch_parse_debug_rodata(char *arg)
|
||||
extern bool rodata_enabled;
|
||||
extern bool rodata_full;
|
||||
|
||||
if (arg && !strcmp(arg, "full")) {
|
||||
if (!arg)
|
||||
return false;
|
||||
|
||||
if (!strcmp(arg, "full")) {
|
||||
rodata_enabled = rodata_full = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!strcmp(arg, "off")) {
|
||||
rodata_enabled = rodata_full = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!strcmp(arg, "on")) {
|
||||
rodata_enabled = true;
|
||||
rodata_full = true;
|
||||
rodata_full = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1839,6 +1839,10 @@ static int __init __kpti_install_ng_mappings(void *__unused)
|
||||
|
||||
static void __init kpti_install_ng_mappings(void)
|
||||
{
|
||||
/* Check whether KPTI is going to be used */
|
||||
if (!cpus_have_cap(ARM64_UNMAP_KERNEL_AT_EL0))
|
||||
return;
|
||||
|
||||
/*
|
||||
* We don't need to rewrite the page-tables if either we've done
|
||||
* it already or we have KASLR enabled and therefore have not
|
||||
|
@ -29,8 +29,8 @@ bool can_set_direct_map(void)
|
||||
*
|
||||
* KFENCE pool requires page-granular mapping if initialized late.
|
||||
*/
|
||||
return (rodata_enabled && rodata_full) || debug_pagealloc_enabled() ||
|
||||
arm64_kfence_can_set_direct_map();
|
||||
return rodata_full || debug_pagealloc_enabled() ||
|
||||
arm64_kfence_can_set_direct_map();
|
||||
}
|
||||
|
||||
static int change_page_range(pte_t *ptep, unsigned long addr, void *data)
|
||||
@ -105,8 +105,7 @@ static int change_memory_common(unsigned long addr, int numpages,
|
||||
* If we are manipulating read-only permissions, apply the same
|
||||
* change to the linear mapping of the pages that back this VM area.
|
||||
*/
|
||||
if (rodata_enabled &&
|
||||
rodata_full && (pgprot_val(set_mask) == PTE_RDONLY ||
|
||||
if (rodata_full && (pgprot_val(set_mask) == PTE_RDONLY ||
|
||||
pgprot_val(clear_mask) == PTE_RDONLY)) {
|
||||
for (i = 0; i < area->nr_pages; i++) {
|
||||
__change_memory_common((u64)page_address(area->pages[i]),
|
||||
|
@ -115,9 +115,12 @@ config ARCH_HAS_ILOG2_U64
|
||||
default n
|
||||
|
||||
config GENERIC_BUG
|
||||
bool
|
||||
default y
|
||||
def_bool y
|
||||
depends on BUG
|
||||
select GENERIC_BUG_RELATIVE_POINTERS if 64BIT
|
||||
|
||||
config GENERIC_BUG_RELATIVE_POINTERS
|
||||
bool
|
||||
|
||||
config GENERIC_HWEIGHT
|
||||
bool
|
||||
|
@ -34,7 +34,8 @@ void apply_alternatives(struct alt_instr *start, struct alt_instr *end,
|
||||
|
||||
/* Alternative SMP implementation. */
|
||||
#define ALTERNATIVE(cond, replacement) "!0:" \
|
||||
".section .altinstructions, \"aw\" !" \
|
||||
".section .altinstructions, \"a\" !" \
|
||||
".align 4 !" \
|
||||
".word (0b-4-.) !" \
|
||||
".hword 1, " __stringify(cond) " !" \
|
||||
".word " __stringify(replacement) " !" \
|
||||
@ -44,7 +45,8 @@ void apply_alternatives(struct alt_instr *start, struct alt_instr *end,
|
||||
|
||||
/* to replace one single instructions by a new instruction */
|
||||
#define ALTERNATIVE(from, to, cond, replacement)\
|
||||
.section .altinstructions, "aw" ! \
|
||||
.section .altinstructions, "a" ! \
|
||||
.align 4 ! \
|
||||
.word (from - .) ! \
|
||||
.hword (to - from)/4, cond ! \
|
||||
.word replacement ! \
|
||||
@ -52,7 +54,8 @@ void apply_alternatives(struct alt_instr *start, struct alt_instr *end,
|
||||
|
||||
/* to replace multiple instructions by new code */
|
||||
#define ALTERNATIVE_CODE(from, num_instructions, cond, new_instr_ptr)\
|
||||
.section .altinstructions, "aw" ! \
|
||||
.section .altinstructions, "a" ! \
|
||||
.align 4 ! \
|
||||
.word (from - .) ! \
|
||||
.hword -num_instructions, cond ! \
|
||||
.word (new_instr_ptr - .) ! \
|
||||
|
@ -574,6 +574,7 @@
|
||||
*/
|
||||
#define ASM_EXCEPTIONTABLE_ENTRY(fault_addr, except_addr) \
|
||||
.section __ex_table,"aw" ! \
|
||||
.align 4 ! \
|
||||
.word (fault_addr - .), (except_addr - .) ! \
|
||||
.previous
|
||||
|
||||
|
@ -17,24 +17,27 @@
|
||||
#define PARISC_BUG_BREAK_ASM "break 0x1f, 0x1fff"
|
||||
#define PARISC_BUG_BREAK_INSN 0x03ffe01f /* PARISC_BUG_BREAK_ASM */
|
||||
|
||||
#if defined(CONFIG_64BIT)
|
||||
#define ASM_WORD_INSN ".dword\t"
|
||||
#ifdef CONFIG_GENERIC_BUG_RELATIVE_POINTERS
|
||||
# define __BUG_REL(val) ".word " __stringify(val) " - ."
|
||||
#else
|
||||
#define ASM_WORD_INSN ".word\t"
|
||||
# define __BUG_REL(val) ".word " __stringify(val)
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef CONFIG_DEBUG_BUGVERBOSE
|
||||
#define BUG() \
|
||||
do { \
|
||||
asm volatile("\n" \
|
||||
"1:\t" PARISC_BUG_BREAK_ASM "\n" \
|
||||
"\t.pushsection __bug_table,\"aw\"\n" \
|
||||
"2:\t" ASM_WORD_INSN "1b, %c0\n" \
|
||||
"\t.short %c1, %c2\n" \
|
||||
"\t.org 2b+%c3\n" \
|
||||
"\t.pushsection __bug_table,\"a\"\n" \
|
||||
"\t.align 4\n" \
|
||||
"2:\t" __BUG_REL(1b) "\n" \
|
||||
"\t" __BUG_REL(%c0) "\n" \
|
||||
"\t.short %1, %2\n" \
|
||||
"\t.blockz %3-2*4-2*2\n" \
|
||||
"\t.popsection" \
|
||||
: : "i" (__FILE__), "i" (__LINE__), \
|
||||
"i" (0), "i" (sizeof(struct bug_entry)) ); \
|
||||
"i" (0), "i" (sizeof(struct bug_entry)) ); \
|
||||
unreachable(); \
|
||||
} while(0)
|
||||
|
||||
@ -51,10 +54,12 @@
|
||||
do { \
|
||||
asm volatile("\n" \
|
||||
"1:\t" PARISC_BUG_BREAK_ASM "\n" \
|
||||
"\t.pushsection __bug_table,\"aw\"\n" \
|
||||
"2:\t" ASM_WORD_INSN "1b, %c0\n" \
|
||||
"\t.short %c1, %c2\n" \
|
||||
"\t.org 2b+%c3\n" \
|
||||
"\t.pushsection __bug_table,\"a\"\n" \
|
||||
"\t.align 4\n" \
|
||||
"2:\t" __BUG_REL(1b) "\n" \
|
||||
"\t" __BUG_REL(%c0) "\n" \
|
||||
"\t.short %1, %2\n" \
|
||||
"\t.blockz %3-2*4-2*2\n" \
|
||||
"\t.popsection" \
|
||||
: : "i" (__FILE__), "i" (__LINE__), \
|
||||
"i" (BUGFLAG_WARNING|(flags)), \
|
||||
@ -65,10 +70,11 @@
|
||||
do { \
|
||||
asm volatile("\n" \
|
||||
"1:\t" PARISC_BUG_BREAK_ASM "\n" \
|
||||
"\t.pushsection __bug_table,\"aw\"\n" \
|
||||
"2:\t" ASM_WORD_INSN "1b\n" \
|
||||
"\t.short %c0\n" \
|
||||
"\t.org 2b+%c1\n" \
|
||||
"\t.pushsection __bug_table,\"a\"\n" \
|
||||
"\t.align %2\n" \
|
||||
"2:\t" __BUG_REL(1b) "\n" \
|
||||
"\t.short %0\n" \
|
||||
"\t.blockz %1-4-2\n" \
|
||||
"\t.popsection" \
|
||||
: : "i" (BUGFLAG_WARNING|(flags)), \
|
||||
"i" (sizeof(struct bug_entry)) ); \
|
||||
|
@ -15,10 +15,12 @@ static __always_inline bool arch_static_branch(struct static_key *key, bool bran
|
||||
asm_volatile_goto("1:\n\t"
|
||||
"nop\n\t"
|
||||
".pushsection __jump_table, \"aw\"\n\t"
|
||||
".align %1\n\t"
|
||||
".word 1b - ., %l[l_yes] - .\n\t"
|
||||
__stringify(ASM_ULONG_INSN) " %c0 - .\n\t"
|
||||
".popsection\n\t"
|
||||
: : "i" (&((char *)key)[branch]) : : l_yes);
|
||||
: : "i" (&((char *)key)[branch]), "i" (sizeof(long))
|
||||
: : l_yes);
|
||||
|
||||
return false;
|
||||
l_yes:
|
||||
@ -30,10 +32,12 @@ static __always_inline bool arch_static_branch_jump(struct static_key *key, bool
|
||||
asm_volatile_goto("1:\n\t"
|
||||
"b,n %l[l_yes]\n\t"
|
||||
".pushsection __jump_table, \"aw\"\n\t"
|
||||
".align %1\n\t"
|
||||
".word 1b - ., %l[l_yes] - .\n\t"
|
||||
__stringify(ASM_ULONG_INSN) " %c0 - .\n\t"
|
||||
".popsection\n\t"
|
||||
: : "i" (&((char *)key)[branch]) : : l_yes);
|
||||
: : "i" (&((char *)key)[branch]), "i" (sizeof(long))
|
||||
: : l_yes);
|
||||
|
||||
return false;
|
||||
l_yes:
|
||||
|
@ -55,7 +55,7 @@
|
||||
})
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
# define __lock_aligned __section(".data..lock_aligned")
|
||||
# define __lock_aligned __section(".data..lock_aligned") __aligned(16)
|
||||
#endif
|
||||
|
||||
#endif /* __PARISC_LDCW_H */
|
||||
|
@ -41,6 +41,7 @@ struct exception_table_entry {
|
||||
|
||||
#define ASM_EXCEPTIONTABLE_ENTRY( fault_addr, except_addr )\
|
||||
".section __ex_table,\"aw\"\n" \
|
||||
".align 4\n" \
|
||||
".word (" #fault_addr " - .), (" #except_addr " - .)\n\t" \
|
||||
".previous\n"
|
||||
|
||||
|
@ -75,7 +75,6 @@
|
||||
|
||||
/* We now return you to your regularly scheduled HPUX. */
|
||||
|
||||
#define ENOSYM 215 /* symbol does not exist in executable */
|
||||
#define ENOTSOCK 216 /* Socket operation on non-socket */
|
||||
#define EDESTADDRREQ 217 /* Destination address required */
|
||||
#define EMSGSIZE 218 /* Message too long */
|
||||
@ -101,7 +100,6 @@
|
||||
#define ETIMEDOUT 238 /* Connection timed out */
|
||||
#define ECONNREFUSED 239 /* Connection refused */
|
||||
#define EREFUSED ECONNREFUSED /* for HP's NFS apparently */
|
||||
#define EREMOTERELEASE 240 /* Remote peer released connection */
|
||||
#define EHOSTDOWN 241 /* Host is down */
|
||||
#define EHOSTUNREACH 242 /* No route to host */
|
||||
|
||||
|
@ -130,6 +130,7 @@ SECTIONS
|
||||
RO_DATA(8)
|
||||
|
||||
/* unwind info */
|
||||
. = ALIGN(4);
|
||||
.PARISC.unwind : {
|
||||
__start___unwind = .;
|
||||
*(.PARISC.unwind)
|
||||
|
@ -23,6 +23,15 @@
|
||||
#include <asm/feature-fixups.h>
|
||||
|
||||
#ifdef CONFIG_VSX
|
||||
#define __REST_1FPVSR(n,c,base) \
|
||||
BEGIN_FTR_SECTION \
|
||||
b 2f; \
|
||||
END_FTR_SECTION_IFSET(CPU_FTR_VSX); \
|
||||
REST_FPR(n,base); \
|
||||
b 3f; \
|
||||
2: REST_VSR(n,c,base); \
|
||||
3:
|
||||
|
||||
#define __REST_32FPVSRS(n,c,base) \
|
||||
BEGIN_FTR_SECTION \
|
||||
b 2f; \
|
||||
@ -41,9 +50,11 @@ END_FTR_SECTION_IFSET(CPU_FTR_VSX); \
|
||||
2: SAVE_32VSRS(n,c,base); \
|
||||
3:
|
||||
#else
|
||||
#define __REST_1FPVSR(n,b,base) REST_FPR(n, base)
|
||||
#define __REST_32FPVSRS(n,b,base) REST_32FPRS(n, base)
|
||||
#define __SAVE_32FPVSRS(n,b,base) SAVE_32FPRS(n, base)
|
||||
#endif
|
||||
#define REST_1FPVSR(n,c,base) __REST_1FPVSR(n,__REG_##c,__REG_##base)
|
||||
#define REST_32FPVSRS(n,c,base) __REST_32FPVSRS(n,__REG_##c,__REG_##base)
|
||||
#define SAVE_32FPVSRS(n,c,base) __SAVE_32FPVSRS(n,__REG_##c,__REG_##base)
|
||||
|
||||
@ -67,6 +78,7 @@ _GLOBAL(store_fp_state)
|
||||
SAVE_32FPVSRS(0, R4, R3)
|
||||
mffs fr0
|
||||
stfd fr0,FPSTATE_FPSCR(r3)
|
||||
REST_1FPVSR(0, R4, R3)
|
||||
blr
|
||||
EXPORT_SYMBOL(store_fp_state)
|
||||
|
||||
@ -138,4 +150,5 @@ _GLOBAL(save_fpu)
|
||||
2: SAVE_32FPVSRS(0, R4, R6)
|
||||
mffs fr0
|
||||
stfd fr0,FPSTATE_FPSCR(r6)
|
||||
REST_1FPVSR(0, R4, R6)
|
||||
blr
|
||||
|
@ -1198,11 +1198,11 @@ void kvmppc_save_user_regs(void)
|
||||
|
||||
usermsr = current->thread.regs->msr;
|
||||
|
||||
/* Caller has enabled FP/VEC/VSX/TM in MSR */
|
||||
if (usermsr & MSR_FP)
|
||||
save_fpu(current);
|
||||
|
||||
__giveup_fpu(current);
|
||||
if (usermsr & MSR_VEC)
|
||||
save_altivec(current);
|
||||
__giveup_altivec(current);
|
||||
|
||||
#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
|
||||
if (usermsr & MSR_TM) {
|
||||
|
@ -33,6 +33,7 @@ _GLOBAL(store_vr_state)
|
||||
mfvscr v0
|
||||
li r4, VRSTATE_VSCR
|
||||
stvx v0, r4, r3
|
||||
lvx v0, 0, r3
|
||||
blr
|
||||
EXPORT_SYMBOL(store_vr_state)
|
||||
|
||||
@ -109,6 +110,7 @@ _GLOBAL(save_altivec)
|
||||
mfvscr v0
|
||||
li r4,VRSTATE_VSCR
|
||||
stvx v0,r4,r7
|
||||
lvx v0,0,r7
|
||||
blr
|
||||
|
||||
#ifdef CONFIG_VSX
|
||||
|
@ -228,7 +228,6 @@ typedef struct thread_struct thread_struct;
|
||||
execve_tail(); \
|
||||
} while (0)
|
||||
|
||||
/* Forward declaration, a strange C thing */
|
||||
struct task_struct;
|
||||
struct mm_struct;
|
||||
struct seq_file;
|
||||
|
@ -666,6 +666,7 @@ static int __init ipl_init(void)
|
||||
&ipl_ccw_attr_group_lpar);
|
||||
break;
|
||||
case IPL_TYPE_ECKD:
|
||||
case IPL_TYPE_ECKD_DUMP:
|
||||
rc = sysfs_create_group(&ipl_kset->kobj, &ipl_eckd_attr_group);
|
||||
break;
|
||||
case IPL_TYPE_FCP:
|
||||
|
@ -279,12 +279,6 @@ static int paicrypt_event_init(struct perf_event *event)
|
||||
if (IS_ERR(cpump))
|
||||
return PTR_ERR(cpump);
|
||||
|
||||
/* Event initialization sets last_tag to 0. When later on the events
|
||||
* are deleted and re-added, do not reset the event count value to zero.
|
||||
* Events are added, deleted and re-added when 2 or more events
|
||||
* are active at the same time.
|
||||
*/
|
||||
event->hw.last_tag = 0;
|
||||
event->destroy = paicrypt_event_destroy;
|
||||
|
||||
if (a->sample_period) {
|
||||
@ -318,6 +312,11 @@ static void paicrypt_start(struct perf_event *event, int flags)
|
||||
{
|
||||
u64 sum;
|
||||
|
||||
/* Event initialization sets last_tag to 0. When later on the events
|
||||
* are deleted and re-added, do not reset the event count value to zero.
|
||||
* Events are added, deleted and re-added when 2 or more events
|
||||
* are active at the same time.
|
||||
*/
|
||||
if (!event->hw.last_tag) {
|
||||
event->hw.last_tag = 1;
|
||||
sum = paicrypt_getall(event); /* Get current value */
|
||||
|
@ -260,7 +260,6 @@ static int paiext_event_init(struct perf_event *event)
|
||||
rc = paiext_alloc(a, event);
|
||||
if (rc)
|
||||
return rc;
|
||||
event->hw.last_tag = 0;
|
||||
event->destroy = paiext_event_destroy;
|
||||
|
||||
if (a->sample_period) {
|
||||
|
@ -4660,7 +4660,7 @@ static void intel_pmu_check_hybrid_pmus(struct x86_hybrid_pmu *pmu)
|
||||
if (pmu->intel_cap.pebs_output_pt_available)
|
||||
pmu->pmu.capabilities |= PERF_PMU_CAP_AUX_OUTPUT;
|
||||
else
|
||||
pmu->pmu.capabilities |= ~PERF_PMU_CAP_AUX_OUTPUT;
|
||||
pmu->pmu.capabilities &= ~PERF_PMU_CAP_AUX_OUTPUT;
|
||||
|
||||
intel_pmu_check_event_constraints(pmu->event_constraints,
|
||||
pmu->num_counters,
|
||||
|
@ -104,8 +104,6 @@ struct cont_desc {
|
||||
size_t size;
|
||||
};
|
||||
|
||||
static u32 ucode_new_rev;
|
||||
|
||||
/*
|
||||
* Microcode patch container file is prepended to the initrd in cpio
|
||||
* format. See Documentation/arch/x86/microcode.rst
|
||||
@ -442,12 +440,11 @@ static int __apply_microcode_amd(struct microcode_amd *mc)
|
||||
*
|
||||
* Returns true if container found (sets @desc), false otherwise.
|
||||
*/
|
||||
static bool early_apply_microcode(u32 cpuid_1_eax, void *ucode, size_t size)
|
||||
static bool early_apply_microcode(u32 cpuid_1_eax, u32 old_rev, void *ucode, size_t size)
|
||||
{
|
||||
struct cont_desc desc = { 0 };
|
||||
struct microcode_amd *mc;
|
||||
bool ret = false;
|
||||
u32 rev, dummy;
|
||||
|
||||
desc.cpuid_1_eax = cpuid_1_eax;
|
||||
|
||||
@ -457,22 +454,15 @@ static bool early_apply_microcode(u32 cpuid_1_eax, void *ucode, size_t size)
|
||||
if (!mc)
|
||||
return ret;
|
||||
|
||||
native_rdmsr(MSR_AMD64_PATCH_LEVEL, rev, dummy);
|
||||
|
||||
/*
|
||||
* Allow application of the same revision to pick up SMT-specific
|
||||
* changes even if the revision of the other SMT thread is already
|
||||
* up-to-date.
|
||||
*/
|
||||
if (rev > mc->hdr.patch_id)
|
||||
if (old_rev > mc->hdr.patch_id)
|
||||
return ret;
|
||||
|
||||
if (!__apply_microcode_amd(mc)) {
|
||||
ucode_new_rev = mc->hdr.patch_id;
|
||||
ret = true;
|
||||
}
|
||||
|
||||
return ret;
|
||||
return !__apply_microcode_amd(mc);
|
||||
}
|
||||
|
||||
static bool get_builtin_microcode(struct cpio_data *cp, unsigned int family)
|
||||
@ -506,9 +496,12 @@ static void __init find_blobs_in_containers(unsigned int cpuid_1_eax, struct cpi
|
||||
*ret = cp;
|
||||
}
|
||||
|
||||
void __init load_ucode_amd_bsp(unsigned int cpuid_1_eax)
|
||||
void __init load_ucode_amd_bsp(struct early_load_data *ed, unsigned int cpuid_1_eax)
|
||||
{
|
||||
struct cpio_data cp = { };
|
||||
u32 dummy;
|
||||
|
||||
native_rdmsr(MSR_AMD64_PATCH_LEVEL, ed->old_rev, dummy);
|
||||
|
||||
/* Needed in load_microcode_amd() */
|
||||
ucode_cpu_info[0].cpu_sig.sig = cpuid_1_eax;
|
||||
@ -517,7 +510,8 @@ void __init load_ucode_amd_bsp(unsigned int cpuid_1_eax)
|
||||
if (!(cp.data && cp.size))
|
||||
return;
|
||||
|
||||
early_apply_microcode(cpuid_1_eax, cp.data, cp.size);
|
||||
if (early_apply_microcode(cpuid_1_eax, ed->old_rev, cp.data, cp.size))
|
||||
native_rdmsr(MSR_AMD64_PATCH_LEVEL, ed->new_rev, dummy);
|
||||
}
|
||||
|
||||
static enum ucode_state load_microcode_amd(u8 family, const u8 *data, size_t size);
|
||||
@ -625,10 +619,8 @@ void reload_ucode_amd(unsigned int cpu)
|
||||
rdmsr(MSR_AMD64_PATCH_LEVEL, rev, dummy);
|
||||
|
||||
if (rev < mc->hdr.patch_id) {
|
||||
if (!__apply_microcode_amd(mc)) {
|
||||
ucode_new_rev = mc->hdr.patch_id;
|
||||
pr_info("reload patch_level=0x%08x\n", ucode_new_rev);
|
||||
}
|
||||
if (!__apply_microcode_amd(mc))
|
||||
pr_info_once("reload revision: 0x%08x\n", mc->hdr.patch_id);
|
||||
}
|
||||
}
|
||||
|
||||
@ -649,8 +641,6 @@ static int collect_cpu_info_amd(int cpu, struct cpu_signature *csig)
|
||||
if (p && (p->patch_id == csig->rev))
|
||||
uci->mc = p->data;
|
||||
|
||||
pr_info("CPU%d: patch_level=0x%08x\n", cpu, csig->rev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -691,8 +681,6 @@ static enum ucode_state apply_microcode_amd(int cpu)
|
||||
rev = mc_amd->hdr.patch_id;
|
||||
ret = UCODE_UPDATED;
|
||||
|
||||
pr_info("CPU%d: new patch_level=0x%08x\n", cpu, rev);
|
||||
|
||||
out:
|
||||
uci->cpu_sig.rev = rev;
|
||||
c->microcode = rev;
|
||||
@ -935,11 +923,6 @@ struct microcode_ops * __init init_amd_microcode(void)
|
||||
pr_warn("AMD CPU family 0x%x not supported\n", c->x86);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (ucode_new_rev)
|
||||
pr_info_once("microcode updated early to new patch_level=0x%08x\n",
|
||||
ucode_new_rev);
|
||||
|
||||
return µcode_amd_ops;
|
||||
}
|
||||
|
||||
|
@ -41,8 +41,6 @@
|
||||
|
||||
#include "internal.h"
|
||||
|
||||
#define DRIVER_VERSION "2.2"
|
||||
|
||||
static struct microcode_ops *microcode_ops;
|
||||
bool dis_ucode_ldr = true;
|
||||
|
||||
@ -77,6 +75,8 @@ static u32 final_levels[] = {
|
||||
0, /* T-101 terminator */
|
||||
};
|
||||
|
||||
struct early_load_data early_data;
|
||||
|
||||
/*
|
||||
* Check the current patch level on this CPU.
|
||||
*
|
||||
@ -155,9 +155,9 @@ void __init load_ucode_bsp(void)
|
||||
return;
|
||||
|
||||
if (intel)
|
||||
load_ucode_intel_bsp();
|
||||
load_ucode_intel_bsp(&early_data);
|
||||
else
|
||||
load_ucode_amd_bsp(cpuid_1_eax);
|
||||
load_ucode_amd_bsp(&early_data, cpuid_1_eax);
|
||||
}
|
||||
|
||||
void load_ucode_ap(void)
|
||||
@ -828,6 +828,11 @@ static int __init microcode_init(void)
|
||||
if (!microcode_ops)
|
||||
return -ENODEV;
|
||||
|
||||
pr_info_once("Current revision: 0x%08x\n", (early_data.new_rev ?: early_data.old_rev));
|
||||
|
||||
if (early_data.new_rev)
|
||||
pr_info_once("Updated early from: 0x%08x\n", early_data.old_rev);
|
||||
|
||||
microcode_pdev = platform_device_register_simple("microcode", -1, NULL, 0);
|
||||
if (IS_ERR(microcode_pdev))
|
||||
return PTR_ERR(microcode_pdev);
|
||||
@ -846,8 +851,6 @@ static int __init microcode_init(void)
|
||||
cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "x86/microcode:online",
|
||||
mc_cpu_online, mc_cpu_down_prep);
|
||||
|
||||
pr_info("Microcode Update Driver: v%s.", DRIVER_VERSION);
|
||||
|
||||
return 0;
|
||||
|
||||
out_pdev:
|
||||
|
@ -339,16 +339,9 @@ static enum ucode_state __apply_microcode(struct ucode_cpu_info *uci,
|
||||
static enum ucode_state apply_microcode_early(struct ucode_cpu_info *uci)
|
||||
{
|
||||
struct microcode_intel *mc = uci->mc;
|
||||
enum ucode_state ret;
|
||||
u32 cur_rev, date;
|
||||
u32 cur_rev;
|
||||
|
||||
ret = __apply_microcode(uci, mc, &cur_rev);
|
||||
if (ret == UCODE_UPDATED) {
|
||||
date = mc->hdr.date;
|
||||
pr_info_once("updated early: 0x%x -> 0x%x, date = %04x-%02x-%02x\n",
|
||||
cur_rev, mc->hdr.rev, date & 0xffff, date >> 24, (date >> 16) & 0xff);
|
||||
}
|
||||
return ret;
|
||||
return __apply_microcode(uci, mc, &cur_rev);
|
||||
}
|
||||
|
||||
static __init bool load_builtin_intel_microcode(struct cpio_data *cp)
|
||||
@ -413,13 +406,17 @@ static int __init save_builtin_microcode(void)
|
||||
early_initcall(save_builtin_microcode);
|
||||
|
||||
/* Load microcode on BSP from initrd or builtin blobs */
|
||||
void __init load_ucode_intel_bsp(void)
|
||||
void __init load_ucode_intel_bsp(struct early_load_data *ed)
|
||||
{
|
||||
struct ucode_cpu_info uci;
|
||||
|
||||
ed->old_rev = intel_get_microcode_revision();
|
||||
|
||||
uci.mc = get_microcode_blob(&uci, false);
|
||||
if (uci.mc && apply_microcode_early(&uci) == UCODE_UPDATED)
|
||||
ucode_patch_va = UCODE_BSP_LOADED;
|
||||
|
||||
ed->new_rev = uci.cpu_sig.rev;
|
||||
}
|
||||
|
||||
void load_ucode_intel_ap(void)
|
||||
|
@ -37,6 +37,12 @@ struct microcode_ops {
|
||||
use_nmi : 1;
|
||||
};
|
||||
|
||||
struct early_load_data {
|
||||
u32 old_rev;
|
||||
u32 new_rev;
|
||||
};
|
||||
|
||||
extern struct early_load_data early_data;
|
||||
extern struct ucode_cpu_info ucode_cpu_info[];
|
||||
struct cpio_data find_microcode_in_initrd(const char *path);
|
||||
|
||||
@ -92,14 +98,14 @@ extern bool dis_ucode_ldr;
|
||||
extern bool force_minrev;
|
||||
|
||||
#ifdef CONFIG_CPU_SUP_AMD
|
||||
void load_ucode_amd_bsp(unsigned int family);
|
||||
void load_ucode_amd_bsp(struct early_load_data *ed, unsigned int family);
|
||||
void load_ucode_amd_ap(unsigned int family);
|
||||
int save_microcode_in_initrd_amd(unsigned int family);
|
||||
void reload_ucode_amd(unsigned int cpu);
|
||||
struct microcode_ops *init_amd_microcode(void);
|
||||
void exit_amd_microcode(void);
|
||||
#else /* CONFIG_CPU_SUP_AMD */
|
||||
static inline void load_ucode_amd_bsp(unsigned int family) { }
|
||||
static inline void load_ucode_amd_bsp(struct early_load_data *ed, unsigned int family) { }
|
||||
static inline void load_ucode_amd_ap(unsigned int family) { }
|
||||
static inline int save_microcode_in_initrd_amd(unsigned int family) { return -EINVAL; }
|
||||
static inline void reload_ucode_amd(unsigned int cpu) { }
|
||||
@ -108,12 +114,12 @@ static inline void exit_amd_microcode(void) { }
|
||||
#endif /* !CONFIG_CPU_SUP_AMD */
|
||||
|
||||
#ifdef CONFIG_CPU_SUP_INTEL
|
||||
void load_ucode_intel_bsp(void);
|
||||
void load_ucode_intel_bsp(struct early_load_data *ed);
|
||||
void load_ucode_intel_ap(void);
|
||||
void reload_ucode_intel(void);
|
||||
struct microcode_ops *init_intel_microcode(void);
|
||||
#else /* CONFIG_CPU_SUP_INTEL */
|
||||
static inline void load_ucode_intel_bsp(void) { }
|
||||
static inline void load_ucode_intel_bsp(struct early_load_data *ed) { }
|
||||
static inline void load_ucode_intel_ap(void) { }
|
||||
static inline void reload_ucode_intel(void) { }
|
||||
static inline struct microcode_ops *init_intel_microcode(void) { return NULL; }
|
||||
|
@ -33,9 +33,12 @@ EXPORT_SYMBOL_GPL(hypercall_page);
|
||||
* and xen_vcpu_setup for details. By default it points to share_info->vcpu_info
|
||||
* but during boot it is switched to point to xen_vcpu_info.
|
||||
* The pointer is used in xen_evtchn_do_upcall to acknowledge pending events.
|
||||
* Make sure that xen_vcpu_info doesn't cross a page boundary by making it
|
||||
* cache-line aligned (the struct is guaranteed to have a size of 64 bytes,
|
||||
* which matches the cache line size of 64-bit x86 processors).
|
||||
*/
|
||||
DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu);
|
||||
DEFINE_PER_CPU(struct vcpu_info, xen_vcpu_info);
|
||||
DEFINE_PER_CPU_ALIGNED(struct vcpu_info, xen_vcpu_info);
|
||||
|
||||
/* Linux <-> Xen vCPU id mapping */
|
||||
DEFINE_PER_CPU(uint32_t, xen_vcpu_id);
|
||||
@ -160,6 +163,7 @@ void xen_vcpu_setup(int cpu)
|
||||
int err;
|
||||
struct vcpu_info *vcpup;
|
||||
|
||||
BUILD_BUG_ON(sizeof(*vcpup) > SMP_CACHE_BYTES);
|
||||
BUG_ON(HYPERVISOR_shared_info == &xen_dummy_shared_info);
|
||||
|
||||
/*
|
||||
|
@ -21,7 +21,7 @@ extern void *xen_initial_gdt;
|
||||
struct trap_info;
|
||||
void xen_copy_trap_info(struct trap_info *traps);
|
||||
|
||||
DECLARE_PER_CPU(struct vcpu_info, xen_vcpu_info);
|
||||
DECLARE_PER_CPU_ALIGNED(struct vcpu_info, xen_vcpu_info);
|
||||
DECLARE_PER_CPU(unsigned long, xen_cr3);
|
||||
DECLARE_PER_CPU(unsigned long, xen_current_cr3);
|
||||
|
||||
|
@ -501,9 +501,17 @@ static inline void bio_check_ro(struct bio *bio)
|
||||
if (op_is_write(bio_op(bio)) && bdev_read_only(bio->bi_bdev)) {
|
||||
if (op_is_flush(bio->bi_opf) && !bio_sectors(bio))
|
||||
return;
|
||||
pr_warn_ratelimited("Trying to write to read-only block-device %pg\n",
|
||||
bio->bi_bdev);
|
||||
/* Older lvm-tools actually trigger this */
|
||||
|
||||
if (bio->bi_bdev->bd_ro_warned)
|
||||
return;
|
||||
|
||||
bio->bi_bdev->bd_ro_warned = true;
|
||||
/*
|
||||
* Use ioctl to set underlying disk of raid/dm to read-only
|
||||
* will trigger this.
|
||||
*/
|
||||
pr_warn("Trying to write to read-only block-device %pg\n",
|
||||
bio->bi_bdev);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1512,14 +1512,26 @@ void blk_mq_delay_kick_requeue_list(struct request_queue *q,
|
||||
}
|
||||
EXPORT_SYMBOL(blk_mq_delay_kick_requeue_list);
|
||||
|
||||
static bool blk_is_flush_data_rq(struct request *rq)
|
||||
{
|
||||
return (rq->rq_flags & RQF_FLUSH_SEQ) && !is_flush_rq(rq);
|
||||
}
|
||||
|
||||
static bool blk_mq_rq_inflight(struct request *rq, void *priv)
|
||||
{
|
||||
/*
|
||||
* If we find a request that isn't idle we know the queue is busy
|
||||
* as it's checked in the iter.
|
||||
* Return false to stop the iteration.
|
||||
*
|
||||
* In case of queue quiesce, if one flush data request is completed,
|
||||
* don't count it as inflight given the flush sequence is suspended,
|
||||
* and the original flush data request is invisible to driver, just
|
||||
* like other pending requests because of quiesce
|
||||
*/
|
||||
if (blk_mq_request_started(rq)) {
|
||||
if (blk_mq_request_started(rq) && !(blk_queue_quiesced(rq->q) &&
|
||||
blk_is_flush_data_rq(rq) &&
|
||||
blk_mq_request_completed(rq))) {
|
||||
bool *busy = priv;
|
||||
|
||||
*busy = true;
|
||||
|
@ -615,6 +615,7 @@ static ssize_t queue_wb_lat_store(struct request_queue *q, const char *page,
|
||||
QUEUE_RW_ENTRY(queue_wb_lat, "wbt_lat_usec");
|
||||
#endif
|
||||
|
||||
/* Common attributes for bio-based and request-based queues. */
|
||||
static struct attribute *queue_attrs[] = {
|
||||
&queue_ra_entry.attr,
|
||||
&queue_max_hw_sectors_entry.attr,
|
||||
@ -659,6 +660,7 @@ static struct attribute *queue_attrs[] = {
|
||||
NULL,
|
||||
};
|
||||
|
||||
/* Request-based queue attributes that are not relevant for bio-based queues. */
|
||||
static struct attribute *blk_mq_queue_attrs[] = {
|
||||
&queue_requests_entry.attr,
|
||||
&elv_iosched_entry.attr,
|
||||
|
@ -253,8 +253,7 @@ static const struct backlight_ops acpi_backlight_ops = {
|
||||
static int video_get_max_state(struct thermal_cooling_device *cooling_dev,
|
||||
unsigned long *state)
|
||||
{
|
||||
struct acpi_device *device = cooling_dev->devdata;
|
||||
struct acpi_video_device *video = acpi_driver_data(device);
|
||||
struct acpi_video_device *video = cooling_dev->devdata;
|
||||
|
||||
*state = video->brightness->count - ACPI_VIDEO_FIRST_LEVEL - 1;
|
||||
return 0;
|
||||
@ -263,8 +262,7 @@ static int video_get_max_state(struct thermal_cooling_device *cooling_dev,
|
||||
static int video_get_cur_state(struct thermal_cooling_device *cooling_dev,
|
||||
unsigned long *state)
|
||||
{
|
||||
struct acpi_device *device = cooling_dev->devdata;
|
||||
struct acpi_video_device *video = acpi_driver_data(device);
|
||||
struct acpi_video_device *video = cooling_dev->devdata;
|
||||
unsigned long long level;
|
||||
int offset;
|
||||
|
||||
@ -283,8 +281,7 @@ static int video_get_cur_state(struct thermal_cooling_device *cooling_dev,
|
||||
static int
|
||||
video_set_cur_state(struct thermal_cooling_device *cooling_dev, unsigned long state)
|
||||
{
|
||||
struct acpi_device *device = cooling_dev->devdata;
|
||||
struct acpi_video_device *video = acpi_driver_data(device);
|
||||
struct acpi_video_device *video = cooling_dev->devdata;
|
||||
int level;
|
||||
|
||||
if (state >= video->brightness->count - ACPI_VIDEO_FIRST_LEVEL)
|
||||
@ -1125,7 +1122,6 @@ static int acpi_video_bus_get_one_device(struct acpi_device *device, void *arg)
|
||||
|
||||
strcpy(acpi_device_name(device), ACPI_VIDEO_DEVICE_NAME);
|
||||
strcpy(acpi_device_class(device), ACPI_VIDEO_CLASS);
|
||||
device->driver_data = data;
|
||||
|
||||
data->device_id = device_id;
|
||||
data->video = video;
|
||||
@ -1747,8 +1743,8 @@ static void acpi_video_dev_register_backlight(struct acpi_video_device *device)
|
||||
device->backlight->props.brightness =
|
||||
acpi_video_get_brightness(device->backlight);
|
||||
|
||||
device->cooling_dev = thermal_cooling_device_register("LCD",
|
||||
device->dev, &video_cooling_ops);
|
||||
device->cooling_dev = thermal_cooling_device_register("LCD", device,
|
||||
&video_cooling_ops);
|
||||
if (IS_ERR(device->cooling_dev)) {
|
||||
/*
|
||||
* Set cooling_dev to NULL so we don't crash trying to free it.
|
||||
@ -2031,7 +2027,7 @@ static int acpi_video_bus_add(struct acpi_device *device)
|
||||
* HP ZBook Fury 16 G10 requires ACPI video's child devices have _PS0
|
||||
* evaluated to have functional panel brightness control.
|
||||
*/
|
||||
acpi_device_fix_up_power_extended(device);
|
||||
acpi_device_fix_up_power_children(device);
|
||||
|
||||
pr_info("%s [%s] (multi-head: %s rom: %s post: %s)\n",
|
||||
ACPI_VIDEO_DEVICE_NAME, acpi_device_bid(device),
|
||||
|
@ -397,6 +397,19 @@ void acpi_device_fix_up_power_extended(struct acpi_device *adev)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(acpi_device_fix_up_power_extended);
|
||||
|
||||
/**
|
||||
* acpi_device_fix_up_power_children - Force a device's children into D0.
|
||||
* @adev: Parent device object whose children's power state is to be fixed up.
|
||||
*
|
||||
* Call acpi_device_fix_up_power() for @adev's children so long as they
|
||||
* are reported as present and enabled.
|
||||
*/
|
||||
void acpi_device_fix_up_power_children(struct acpi_device *adev)
|
||||
{
|
||||
acpi_dev_for_each_child(adev, fix_up_power_if_applicable, NULL);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(acpi_device_fix_up_power_children);
|
||||
|
||||
int acpi_device_update_power(struct acpi_device *device, int *state_p)
|
||||
{
|
||||
int state;
|
||||
|
@ -592,7 +592,7 @@ static int acpi_idle_play_dead(struct cpuidle_device *dev, int index)
|
||||
while (1) {
|
||||
|
||||
if (cx->entry_method == ACPI_CSTATE_HALT)
|
||||
safe_halt();
|
||||
raw_safe_halt();
|
||||
else if (cx->entry_method == ACPI_CSTATE_SYSTEMIO) {
|
||||
io_idle(cx->address);
|
||||
} else
|
||||
|
@ -447,6 +447,13 @@ static const struct dmi_system_id irq1_level_low_skip_override[] = {
|
||||
DMI_MATCH(DMI_BOARD_NAME, "B1402CBA"),
|
||||
},
|
||||
},
|
||||
{
|
||||
/* Asus ExpertBook B1402CVA */
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
|
||||
DMI_MATCH(DMI_BOARD_NAME, "B1402CVA"),
|
||||
},
|
||||
},
|
||||
{
|
||||
/* Asus ExpertBook B1502CBA */
|
||||
.matches = {
|
||||
|
@ -1568,17 +1568,22 @@ static const struct iommu_ops *acpi_iommu_configure_id(struct device *dev,
|
||||
int err;
|
||||
const struct iommu_ops *ops;
|
||||
|
||||
/* Serialise to make dev->iommu stable under our potential fwspec */
|
||||
mutex_lock(&iommu_probe_device_lock);
|
||||
/*
|
||||
* If we already translated the fwspec there is nothing left to do,
|
||||
* return the iommu_ops.
|
||||
*/
|
||||
ops = acpi_iommu_fwspec_ops(dev);
|
||||
if (ops)
|
||||
if (ops) {
|
||||
mutex_unlock(&iommu_probe_device_lock);
|
||||
return ops;
|
||||
}
|
||||
|
||||
err = iort_iommu_configure_id(dev, id_in);
|
||||
if (err && err != -EPROBE_DEFER)
|
||||
err = viot_iommu_configure(dev);
|
||||
mutex_unlock(&iommu_probe_device_lock);
|
||||
|
||||
/*
|
||||
* If we have reason to believe the IOMMU driver missed the initial
|
||||
|
@ -1055,9 +1055,14 @@ int ata_scsi_dev_config(struct scsi_device *sdev, struct ata_device *dev)
|
||||
* Ask the sd driver to issue START STOP UNIT on runtime suspend
|
||||
* and resume and shutdown only. For system level suspend/resume,
|
||||
* devices power state is handled directly by libata EH.
|
||||
* Given that disks are always spun up on system resume, also
|
||||
* make sure that the sd driver forces runtime suspended disks
|
||||
* to be resumed to correctly reflect the power state of the
|
||||
* device.
|
||||
*/
|
||||
sdev->manage_runtime_start_stop = true;
|
||||
sdev->manage_shutdown = true;
|
||||
sdev->manage_runtime_start_stop = 1;
|
||||
sdev->manage_shutdown = 1;
|
||||
sdev->force_runtime_start_on_system_start = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -307,11 +307,11 @@ static int pstate_init_perf(struct amd_cpudata *cpudata)
|
||||
highest_perf = AMD_CPPC_HIGHEST_PERF(cap1);
|
||||
|
||||
WRITE_ONCE(cpudata->highest_perf, highest_perf);
|
||||
|
||||
WRITE_ONCE(cpudata->max_limit_perf, highest_perf);
|
||||
WRITE_ONCE(cpudata->nominal_perf, AMD_CPPC_NOMINAL_PERF(cap1));
|
||||
WRITE_ONCE(cpudata->lowest_nonlinear_perf, AMD_CPPC_LOWNONLIN_PERF(cap1));
|
||||
WRITE_ONCE(cpudata->lowest_perf, AMD_CPPC_LOWEST_PERF(cap1));
|
||||
|
||||
WRITE_ONCE(cpudata->min_limit_perf, AMD_CPPC_LOWEST_PERF(cap1));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -329,11 +329,12 @@ static int cppc_init_perf(struct amd_cpudata *cpudata)
|
||||
highest_perf = cppc_perf.highest_perf;
|
||||
|
||||
WRITE_ONCE(cpudata->highest_perf, highest_perf);
|
||||
|
||||
WRITE_ONCE(cpudata->max_limit_perf, highest_perf);
|
||||
WRITE_ONCE(cpudata->nominal_perf, cppc_perf.nominal_perf);
|
||||
WRITE_ONCE(cpudata->lowest_nonlinear_perf,
|
||||
cppc_perf.lowest_nonlinear_perf);
|
||||
WRITE_ONCE(cpudata->lowest_perf, cppc_perf.lowest_perf);
|
||||
WRITE_ONCE(cpudata->min_limit_perf, cppc_perf.lowest_perf);
|
||||
|
||||
if (cppc_state == AMD_PSTATE_ACTIVE)
|
||||
return 0;
|
||||
@ -432,6 +433,10 @@ static void amd_pstate_update(struct amd_cpudata *cpudata, u32 min_perf,
|
||||
u64 prev = READ_ONCE(cpudata->cppc_req_cached);
|
||||
u64 value = prev;
|
||||
|
||||
min_perf = clamp_t(unsigned long, min_perf, cpudata->min_limit_perf,
|
||||
cpudata->max_limit_perf);
|
||||
max_perf = clamp_t(unsigned long, max_perf, cpudata->min_limit_perf,
|
||||
cpudata->max_limit_perf);
|
||||
des_perf = clamp_t(unsigned long, des_perf, min_perf, max_perf);
|
||||
|
||||
if ((cppc_state == AMD_PSTATE_GUIDED) && (gov_flags & CPUFREQ_GOV_DYNAMIC_SWITCHING)) {
|
||||
@ -470,6 +475,22 @@ static int amd_pstate_verify(struct cpufreq_policy_data *policy)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int amd_pstate_update_min_max_limit(struct cpufreq_policy *policy)
|
||||
{
|
||||
u32 max_limit_perf, min_limit_perf;
|
||||
struct amd_cpudata *cpudata = policy->driver_data;
|
||||
|
||||
max_limit_perf = div_u64(policy->max * cpudata->highest_perf, cpudata->max_freq);
|
||||
min_limit_perf = div_u64(policy->min * cpudata->highest_perf, cpudata->max_freq);
|
||||
|
||||
WRITE_ONCE(cpudata->max_limit_perf, max_limit_perf);
|
||||
WRITE_ONCE(cpudata->min_limit_perf, min_limit_perf);
|
||||
WRITE_ONCE(cpudata->max_limit_freq, policy->max);
|
||||
WRITE_ONCE(cpudata->min_limit_freq, policy->min);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int amd_pstate_update_freq(struct cpufreq_policy *policy,
|
||||
unsigned int target_freq, bool fast_switch)
|
||||
{
|
||||
@ -480,6 +501,9 @@ static int amd_pstate_update_freq(struct cpufreq_policy *policy,
|
||||
if (!cpudata->max_freq)
|
||||
return -ENODEV;
|
||||
|
||||
if (policy->min != cpudata->min_limit_freq || policy->max != cpudata->max_limit_freq)
|
||||
amd_pstate_update_min_max_limit(policy);
|
||||
|
||||
cap_perf = READ_ONCE(cpudata->highest_perf);
|
||||
min_perf = READ_ONCE(cpudata->lowest_perf);
|
||||
max_perf = cap_perf;
|
||||
@ -518,7 +542,9 @@ static int amd_pstate_target(struct cpufreq_policy *policy,
|
||||
static unsigned int amd_pstate_fast_switch(struct cpufreq_policy *policy,
|
||||
unsigned int target_freq)
|
||||
{
|
||||
return amd_pstate_update_freq(policy, target_freq, true);
|
||||
if (!amd_pstate_update_freq(policy, target_freq, true))
|
||||
return target_freq;
|
||||
return policy->cur;
|
||||
}
|
||||
|
||||
static void amd_pstate_adjust_perf(unsigned int cpu,
|
||||
@ -532,6 +558,10 @@ static void amd_pstate_adjust_perf(unsigned int cpu,
|
||||
struct amd_cpudata *cpudata = policy->driver_data;
|
||||
unsigned int target_freq;
|
||||
|
||||
if (policy->min != cpudata->min_limit_freq || policy->max != cpudata->max_limit_freq)
|
||||
amd_pstate_update_min_max_limit(policy);
|
||||
|
||||
|
||||
cap_perf = READ_ONCE(cpudata->highest_perf);
|
||||
lowest_nonlinear_perf = READ_ONCE(cpudata->lowest_nonlinear_perf);
|
||||
max_freq = READ_ONCE(cpudata->max_freq);
|
||||
@ -745,6 +775,8 @@ static int amd_pstate_cpu_init(struct cpufreq_policy *policy)
|
||||
/* Initial processor data capability frequencies */
|
||||
cpudata->max_freq = max_freq;
|
||||
cpudata->min_freq = min_freq;
|
||||
cpudata->max_limit_freq = max_freq;
|
||||
cpudata->min_limit_freq = min_freq;
|
||||
cpudata->nominal_freq = nominal_freq;
|
||||
cpudata->lowest_nonlinear_freq = lowest_nonlinear_freq;
|
||||
|
||||
@ -850,11 +882,16 @@ static ssize_t show_energy_performance_available_preferences(
|
||||
{
|
||||
int i = 0;
|
||||
int offset = 0;
|
||||
struct amd_cpudata *cpudata = policy->driver_data;
|
||||
|
||||
if (cpudata->policy == CPUFREQ_POLICY_PERFORMANCE)
|
||||
return sysfs_emit_at(buf, offset, "%s\n",
|
||||
energy_perf_strings[EPP_INDEX_PERFORMANCE]);
|
||||
|
||||
while (energy_perf_strings[i] != NULL)
|
||||
offset += sysfs_emit_at(buf, offset, "%s ", energy_perf_strings[i++]);
|
||||
|
||||
sysfs_emit_at(buf, offset, "\n");
|
||||
offset += sysfs_emit_at(buf, offset, "\n");
|
||||
|
||||
return offset;
|
||||
}
|
||||
@ -1183,16 +1220,25 @@ static int amd_pstate_epp_cpu_exit(struct cpufreq_policy *policy)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void amd_pstate_epp_init(unsigned int cpu)
|
||||
static void amd_pstate_epp_update_limit(struct cpufreq_policy *policy)
|
||||
{
|
||||
struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);
|
||||
struct amd_cpudata *cpudata = policy->driver_data;
|
||||
u32 max_perf, min_perf;
|
||||
u32 max_perf, min_perf, min_limit_perf, max_limit_perf;
|
||||
u64 value;
|
||||
s16 epp;
|
||||
|
||||
max_perf = READ_ONCE(cpudata->highest_perf);
|
||||
min_perf = READ_ONCE(cpudata->lowest_perf);
|
||||
max_limit_perf = div_u64(policy->max * cpudata->highest_perf, cpudata->max_freq);
|
||||
min_limit_perf = div_u64(policy->min * cpudata->highest_perf, cpudata->max_freq);
|
||||
|
||||
max_perf = clamp_t(unsigned long, max_perf, cpudata->min_limit_perf,
|
||||
cpudata->max_limit_perf);
|
||||
min_perf = clamp_t(unsigned long, min_perf, cpudata->min_limit_perf,
|
||||
cpudata->max_limit_perf);
|
||||
|
||||
WRITE_ONCE(cpudata->max_limit_perf, max_limit_perf);
|
||||
WRITE_ONCE(cpudata->min_limit_perf, min_limit_perf);
|
||||
|
||||
value = READ_ONCE(cpudata->cppc_req_cached);
|
||||
|
||||
@ -1210,9 +1256,6 @@ static void amd_pstate_epp_init(unsigned int cpu)
|
||||
value &= ~AMD_CPPC_DES_PERF(~0L);
|
||||
value |= AMD_CPPC_DES_PERF(0);
|
||||
|
||||
if (cpudata->epp_policy == cpudata->policy)
|
||||
goto skip_epp;
|
||||
|
||||
cpudata->epp_policy = cpudata->policy;
|
||||
|
||||
/* Get BIOS pre-defined epp value */
|
||||
@ -1222,7 +1265,7 @@ static void amd_pstate_epp_init(unsigned int cpu)
|
||||
* This return value can only be negative for shared_memory
|
||||
* systems where EPP register read/write not supported.
|
||||
*/
|
||||
goto skip_epp;
|
||||
return;
|
||||
}
|
||||
|
||||
if (cpudata->policy == CPUFREQ_POLICY_PERFORMANCE)
|
||||
@ -1236,8 +1279,6 @@ static void amd_pstate_epp_init(unsigned int cpu)
|
||||
|
||||
WRITE_ONCE(cpudata->cppc_req_cached, value);
|
||||
amd_pstate_set_epp(cpudata, epp);
|
||||
skip_epp:
|
||||
cpufreq_cpu_put(policy);
|
||||
}
|
||||
|
||||
static int amd_pstate_epp_set_policy(struct cpufreq_policy *policy)
|
||||
@ -1252,7 +1293,7 @@ static int amd_pstate_epp_set_policy(struct cpufreq_policy *policy)
|
||||
|
||||
cpudata->policy = policy->policy;
|
||||
|
||||
amd_pstate_epp_init(policy->cpu);
|
||||
amd_pstate_epp_update_limit(policy);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -327,7 +327,7 @@ static int imx6ul_opp_check_speed_grading(struct device *dev)
|
||||
imx6x_disable_freq_in_opp(dev, 696000000);
|
||||
|
||||
if (of_machine_is_compatible("fsl,imx6ull")) {
|
||||
if (val != OCOTP_CFG3_6ULL_SPEED_792MHZ)
|
||||
if (val < OCOTP_CFG3_6ULL_SPEED_792MHZ)
|
||||
imx6x_disable_freq_in_opp(dev, 792000000);
|
||||
|
||||
if (val != OCOTP_CFG3_6ULL_SPEED_900MHZ)
|
||||
|
@ -23,8 +23,10 @@
|
||||
#include <linux/nvmem-consumer.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/pm.h>
|
||||
#include <linux/pm_domain.h>
|
||||
#include <linux/pm_opp.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/soc/qcom/smem.h>
|
||||
|
||||
@ -55,6 +57,7 @@ struct qcom_cpufreq_match_data {
|
||||
|
||||
struct qcom_cpufreq_drv_cpu {
|
||||
int opp_token;
|
||||
struct device **virt_devs;
|
||||
};
|
||||
|
||||
struct qcom_cpufreq_drv {
|
||||
@ -424,6 +427,30 @@ static const struct qcom_cpufreq_match_data match_data_ipq8074 = {
|
||||
.get_version = qcom_cpufreq_ipq8074_name_version,
|
||||
};
|
||||
|
||||
static void qcom_cpufreq_suspend_virt_devs(struct qcom_cpufreq_drv *drv, unsigned int cpu)
|
||||
{
|
||||
const char * const *name = drv->data->genpd_names;
|
||||
int i;
|
||||
|
||||
if (!drv->cpus[cpu].virt_devs)
|
||||
return;
|
||||
|
||||
for (i = 0; *name; i++, name++)
|
||||
device_set_awake_path(drv->cpus[cpu].virt_devs[i]);
|
||||
}
|
||||
|
||||
static void qcom_cpufreq_put_virt_devs(struct qcom_cpufreq_drv *drv, unsigned int cpu)
|
||||
{
|
||||
const char * const *name = drv->data->genpd_names;
|
||||
int i;
|
||||
|
||||
if (!drv->cpus[cpu].virt_devs)
|
||||
return;
|
||||
|
||||
for (i = 0; *name; i++, name++)
|
||||
pm_runtime_put(drv->cpus[cpu].virt_devs[i]);
|
||||
}
|
||||
|
||||
static int qcom_cpufreq_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct qcom_cpufreq_drv *drv;
|
||||
@ -478,6 +505,7 @@ static int qcom_cpufreq_probe(struct platform_device *pdev)
|
||||
of_node_put(np);
|
||||
|
||||
for_each_possible_cpu(cpu) {
|
||||
struct device **virt_devs = NULL;
|
||||
struct dev_pm_opp_config config = {
|
||||
.supported_hw = NULL,
|
||||
};
|
||||
@ -498,7 +526,7 @@ static int qcom_cpufreq_probe(struct platform_device *pdev)
|
||||
|
||||
if (drv->data->genpd_names) {
|
||||
config.genpd_names = drv->data->genpd_names;
|
||||
config.virt_devs = NULL;
|
||||
config.virt_devs = &virt_devs;
|
||||
}
|
||||
|
||||
if (config.supported_hw || config.genpd_names) {
|
||||
@ -509,6 +537,27 @@ static int qcom_cpufreq_probe(struct platform_device *pdev)
|
||||
goto free_opp;
|
||||
}
|
||||
}
|
||||
|
||||
if (virt_devs) {
|
||||
const char * const *name = config.genpd_names;
|
||||
int i, j;
|
||||
|
||||
for (i = 0; *name; i++, name++) {
|
||||
ret = pm_runtime_resume_and_get(virt_devs[i]);
|
||||
if (ret) {
|
||||
dev_err(cpu_dev, "failed to resume %s: %d\n",
|
||||
*name, ret);
|
||||
|
||||
/* Rollback previous PM runtime calls */
|
||||
name = config.genpd_names;
|
||||
for (j = 0; *name && j < i; j++, name++)
|
||||
pm_runtime_put(virt_devs[j]);
|
||||
|
||||
goto free_opp;
|
||||
}
|
||||
}
|
||||
drv->cpus[cpu].virt_devs = virt_devs;
|
||||
}
|
||||
}
|
||||
|
||||
cpufreq_dt_pdev = platform_device_register_simple("cpufreq-dt", -1,
|
||||
@ -522,8 +571,10 @@ static int qcom_cpufreq_probe(struct platform_device *pdev)
|
||||
dev_err(cpu_dev, "Failed to register platform device\n");
|
||||
|
||||
free_opp:
|
||||
for_each_possible_cpu(cpu)
|
||||
for_each_possible_cpu(cpu) {
|
||||
qcom_cpufreq_put_virt_devs(drv, cpu);
|
||||
dev_pm_opp_clear_config(drv->cpus[cpu].opp_token);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -534,15 +585,31 @@ static void qcom_cpufreq_remove(struct platform_device *pdev)
|
||||
|
||||
platform_device_unregister(cpufreq_dt_pdev);
|
||||
|
||||
for_each_possible_cpu(cpu)
|
||||
for_each_possible_cpu(cpu) {
|
||||
qcom_cpufreq_put_virt_devs(drv, cpu);
|
||||
dev_pm_opp_clear_config(drv->cpus[cpu].opp_token);
|
||||
}
|
||||
}
|
||||
|
||||
static int qcom_cpufreq_suspend(struct device *dev)
|
||||
{
|
||||
struct qcom_cpufreq_drv *drv = dev_get_drvdata(dev);
|
||||
unsigned int cpu;
|
||||
|
||||
for_each_possible_cpu(cpu)
|
||||
qcom_cpufreq_suspend_virt_devs(drv, cpu);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static DEFINE_SIMPLE_DEV_PM_OPS(qcom_cpufreq_pm_ops, qcom_cpufreq_suspend, NULL);
|
||||
|
||||
static struct platform_driver qcom_cpufreq_driver = {
|
||||
.probe = qcom_cpufreq_probe,
|
||||
.remove_new = qcom_cpufreq_remove,
|
||||
.driver = {
|
||||
.name = "qcom-cpufreq-nvmem",
|
||||
.pm = pm_sleep_ptr(&qcom_cpufreq_pm_ops),
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -301,7 +301,7 @@ void dma_resv_add_fence(struct dma_resv *obj, struct dma_fence *fence,
|
||||
|
||||
dma_resv_list_entry(fobj, i, obj, &old, &old_usage);
|
||||
if ((old->context == fence->context && old_usage >= usage &&
|
||||
dma_fence_is_later(fence, old)) ||
|
||||
dma_fence_is_later_or_same(fence, old)) ||
|
||||
dma_fence_is_signaled(old)) {
|
||||
dma_resv_list_set(fobj, i, fence, usage);
|
||||
dma_fence_put(old);
|
||||
|
@ -717,14 +717,11 @@ static void create_units(struct fw_device *device)
|
||||
fw_unit_attributes,
|
||||
&unit->attribute_group);
|
||||
|
||||
if (device_register(&unit->device) < 0)
|
||||
goto skip_unit;
|
||||
|
||||
fw_device_get(device);
|
||||
continue;
|
||||
|
||||
skip_unit:
|
||||
kfree(unit);
|
||||
if (device_register(&unit->device) < 0) {
|
||||
put_device(&unit->device);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1519,9 +1519,9 @@ static int sbp2_scsi_slave_configure(struct scsi_device *sdev)
|
||||
sdev->use_10_for_rw = 1;
|
||||
|
||||
if (sbp2_param_exclusive_login) {
|
||||
sdev->manage_system_start_stop = true;
|
||||
sdev->manage_runtime_start_stop = true;
|
||||
sdev->manage_shutdown = true;
|
||||
sdev->manage_system_start_stop = 1;
|
||||
sdev->manage_runtime_start_stop = 1;
|
||||
sdev->manage_shutdown = 1;
|
||||
}
|
||||
|
||||
if (sdev->type == TYPE_ROM)
|
||||
|
@ -101,7 +101,7 @@ retry:
|
||||
* overlap on physical address level.
|
||||
*/
|
||||
list_for_each_entry(entry, &accepting_list, list) {
|
||||
if (entry->end < range.start)
|
||||
if (entry->end <= range.start)
|
||||
continue;
|
||||
if (entry->start >= range.end)
|
||||
continue;
|
||||
|
@ -547,7 +547,7 @@ int amdgpu_amdkfd_get_xgmi_bandwidth_mbytes(struct amdgpu_device *dst,
|
||||
struct amdgpu_device *adev = dst, *peer_adev;
|
||||
int num_links;
|
||||
|
||||
if (adev->asic_type != CHIP_ALDEBARAN)
|
||||
if (amdgpu_ip_version(adev, GC_HWIP, 0) < IP_VERSION(9, 4, 2))
|
||||
return 0;
|
||||
|
||||
if (src)
|
||||
|
@ -638,6 +638,9 @@ static ssize_t amdgpu_debugfs_regs_didt_read(struct file *f, char __user *buf,
|
||||
if (size & 0x3 || *pos & 0x3)
|
||||
return -EINVAL;
|
||||
|
||||
if (!adev->didt_rreg)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
r = pm_runtime_get_sync(adev_to_drm(adev)->dev);
|
||||
if (r < 0) {
|
||||
pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
|
||||
@ -694,6 +697,9 @@ static ssize_t amdgpu_debugfs_regs_didt_write(struct file *f, const char __user
|
||||
if (size & 0x3 || *pos & 0x3)
|
||||
return -EINVAL;
|
||||
|
||||
if (!adev->didt_wreg)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
r = pm_runtime_get_sync(adev_to_drm(adev)->dev);
|
||||
if (r < 0) {
|
||||
pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
|
||||
|
@ -4538,6 +4538,10 @@ int amdgpu_device_suspend(struct drm_device *dev, bool fbcon)
|
||||
if (amdgpu_sriov_vf(adev))
|
||||
amdgpu_virt_release_full_gpu(adev, false);
|
||||
|
||||
r = amdgpu_dpm_notify_rlc_state(adev, false);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -340,14 +340,11 @@ int amdgpu_display_crtc_set_config(struct drm_mode_set *set,
|
||||
adev->have_disp_power_ref = true;
|
||||
return ret;
|
||||
}
|
||||
/* if we have no active crtcs, then drop the power ref
|
||||
* we got before
|
||||
/* if we have no active crtcs, then go to
|
||||
* drop the power ref we got before
|
||||
*/
|
||||
if (!active && adev->have_disp_power_ref) {
|
||||
pm_runtime_put_autosuspend(dev->dev);
|
||||
if (!active && adev->have_disp_power_ref)
|
||||
adev->have_disp_power_ref = false;
|
||||
}
|
||||
|
||||
out:
|
||||
/* drop the power reference we got coming in here */
|
||||
pm_runtime_put_autosuspend(dev->dev);
|
||||
|
@ -2263,6 +2263,8 @@ retry_init:
|
||||
pm_runtime_mark_last_busy(ddev->dev);
|
||||
pm_runtime_put_autosuspend(ddev->dev);
|
||||
|
||||
pci_wake_from_d3(pdev, TRUE);
|
||||
|
||||
/*
|
||||
* For runpm implemented via BACO, PMFW will handle the
|
||||
* timing for BACO in and out:
|
||||
|
@ -181,6 +181,9 @@ uint64_t amdgpu_gmc_agp_addr(struct ttm_buffer_object *bo)
|
||||
{
|
||||
struct amdgpu_device *adev = amdgpu_ttm_adev(bo->bdev);
|
||||
|
||||
if (!bo->ttm)
|
||||
return AMDGPU_BO_INVALID_OFFSET;
|
||||
|
||||
if (bo->ttm->num_pages != 1 || bo->ttm->caching == ttm_cached)
|
||||
return AMDGPU_BO_INVALID_OFFSET;
|
||||
|
||||
|
@ -1527,10 +1527,14 @@ u64 amdgpu_bo_gpu_offset(struct amdgpu_bo *bo)
|
||||
u64 amdgpu_bo_gpu_offset_no_check(struct amdgpu_bo *bo)
|
||||
{
|
||||
struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev);
|
||||
uint64_t offset;
|
||||
uint64_t offset = AMDGPU_BO_INVALID_OFFSET;
|
||||
|
||||
offset = (bo->tbo.resource->start << PAGE_SHIFT) +
|
||||
amdgpu_ttm_domain_start(adev, bo->tbo.resource->mem_type);
|
||||
if (bo->tbo.resource->mem_type == TTM_PL_TT)
|
||||
offset = amdgpu_gmc_agp_addr(&bo->tbo);
|
||||
|
||||
if (offset == AMDGPU_BO_INVALID_OFFSET)
|
||||
offset = (bo->tbo.resource->start << PAGE_SHIFT) +
|
||||
amdgpu_ttm_domain_start(adev, bo->tbo.resource->mem_type);
|
||||
|
||||
return amdgpu_gmc_sign_extend(offset);
|
||||
}
|
||||
|
@ -214,6 +214,12 @@ static bool __get_eeprom_i2c_addr(struct amdgpu_device *adev,
|
||||
control->i2c_address = EEPROM_I2C_MADDR_0;
|
||||
return true;
|
||||
case IP_VERSION(13, 0, 0):
|
||||
if (strnstr(atom_ctx->vbios_pn, "D707",
|
||||
sizeof(atom_ctx->vbios_pn)))
|
||||
control->i2c_address = EEPROM_I2C_MADDR_0;
|
||||
else
|
||||
control->i2c_address = EEPROM_I2C_MADDR_4;
|
||||
return true;
|
||||
case IP_VERSION(13, 0, 6):
|
||||
case IP_VERSION(13, 0, 10):
|
||||
control->i2c_address = EEPROM_I2C_MADDR_4;
|
||||
|
@ -959,10 +959,8 @@ int amdgpu_ttm_alloc_gart(struct ttm_buffer_object *bo)
|
||||
return 0;
|
||||
|
||||
addr = amdgpu_gmc_agp_addr(bo);
|
||||
if (addr != AMDGPU_BO_INVALID_OFFSET) {
|
||||
bo->resource->start = addr >> PAGE_SHIFT;
|
||||
if (addr != AMDGPU_BO_INVALID_OFFSET)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* allocate GART space */
|
||||
placement.num_placement = 1;
|
||||
|
@ -89,6 +89,10 @@ MODULE_FIRMWARE("amdgpu/gc_11_5_0_me.bin");
|
||||
MODULE_FIRMWARE("amdgpu/gc_11_5_0_mec.bin");
|
||||
MODULE_FIRMWARE("amdgpu/gc_11_5_0_rlc.bin");
|
||||
|
||||
static const struct soc15_reg_golden golden_settings_gc_11_0[] = {
|
||||
SOC15_REG_GOLDEN_VALUE(GC, 0, regTCP_CNTL, 0x20000000, 0x20000000)
|
||||
};
|
||||
|
||||
static const struct soc15_reg_golden golden_settings_gc_11_0_1[] =
|
||||
{
|
||||
SOC15_REG_GOLDEN_VALUE(GC, 0, regCGTT_GS_NGG_CLK_CTRL, 0x9fff8fff, 0x00000010),
|
||||
@ -304,6 +308,10 @@ static void gfx_v11_0_init_golden_registers(struct amdgpu_device *adev)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
soc15_program_register_sequence(adev,
|
||||
golden_settings_gc_11_0,
|
||||
(const u32)ARRAY_SIZE(golden_settings_gc_11_0));
|
||||
|
||||
}
|
||||
|
||||
static void gfx_v11_0_write_data_to_reg(struct amdgpu_ring *ring, int eng_sel,
|
||||
@ -419,7 +427,7 @@ static int gfx_v11_0_ring_test_ib(struct amdgpu_ring *ring, long timeout)
|
||||
adev->wb.wb[index] = cpu_to_le32(0xCAFEDEAD);
|
||||
cpu_ptr = &adev->wb.wb[index];
|
||||
|
||||
r = amdgpu_ib_get(adev, NULL, 16, AMDGPU_IB_POOL_DIRECT, &ib);
|
||||
r = amdgpu_ib_get(adev, NULL, 20, AMDGPU_IB_POOL_DIRECT, &ib);
|
||||
if (r) {
|
||||
DRM_ERROR("amdgpu: failed to get ib (%ld).\n", r);
|
||||
goto err1;
|
||||
|
@ -883,8 +883,8 @@ static int gfx_v8_0_ring_test_ib(struct amdgpu_ring *ring, long timeout)
|
||||
gpu_addr = adev->wb.gpu_addr + (index * 4);
|
||||
adev->wb.wb[index] = cpu_to_le32(0xCAFEDEAD);
|
||||
memset(&ib, 0, sizeof(ib));
|
||||
r = amdgpu_ib_get(adev, NULL, 16,
|
||||
AMDGPU_IB_POOL_DIRECT, &ib);
|
||||
|
||||
r = amdgpu_ib_get(adev, NULL, 20, AMDGPU_IB_POOL_DIRECT, &ib);
|
||||
if (r)
|
||||
goto err1;
|
||||
|
||||
|
@ -1039,8 +1039,8 @@ static int gfx_v9_0_ring_test_ib(struct amdgpu_ring *ring, long timeout)
|
||||
gpu_addr = adev->wb.gpu_addr + (index * 4);
|
||||
adev->wb.wb[index] = cpu_to_le32(0xCAFEDEAD);
|
||||
memset(&ib, 0, sizeof(ib));
|
||||
r = amdgpu_ib_get(adev, NULL, 16,
|
||||
AMDGPU_IB_POOL_DIRECT, &ib);
|
||||
|
||||
r = amdgpu_ib_get(adev, NULL, 20, AMDGPU_IB_POOL_DIRECT, &ib);
|
||||
if (r)
|
||||
goto err1;
|
||||
|
||||
|
@ -297,8 +297,8 @@ static int gfx_v9_4_3_ring_test_ib(struct amdgpu_ring *ring, long timeout)
|
||||
gpu_addr = adev->wb.gpu_addr + (index * 4);
|
||||
adev->wb.wb[index] = cpu_to_le32(0xCAFEDEAD);
|
||||
memset(&ib, 0, sizeof(ib));
|
||||
r = amdgpu_ib_get(adev, NULL, 16,
|
||||
AMDGPU_IB_POOL_DIRECT, &ib);
|
||||
|
||||
r = amdgpu_ib_get(adev, NULL, 20, AMDGPU_IB_POOL_DIRECT, &ib);
|
||||
if (r)
|
||||
goto err1;
|
||||
|
||||
|
@ -259,17 +259,17 @@ const struct nbio_hdp_flush_reg nbio_v7_11_hdp_flush_reg = {
|
||||
|
||||
static void nbio_v7_11_init_registers(struct amdgpu_device *adev)
|
||||
{
|
||||
/* uint32_t def, data;
|
||||
uint32_t def, data;
|
||||
|
||||
def = data = RREG32_SOC15(NBIO, 0, regBIF_BIF256_CI256_RC3X4_USB4_PCIE_MST_CTRL_3);
|
||||
data = REG_SET_FIELD(data, BIF_BIF256_CI256_RC3X4_USB4_PCIE_MST_CTRL_3,
|
||||
CI_SWUS_MAX_READ_REQUEST_SIZE_MODE, 1);
|
||||
data = REG_SET_FIELD(data, BIF_BIF256_CI256_RC3X4_USB4_PCIE_MST_CTRL_3,
|
||||
CI_SWUS_MAX_READ_REQUEST_SIZE_PRIV, 1);
|
||||
def = data = RREG32_SOC15(NBIO, 0, regBIF_BIF256_CI256_RC3X4_USB4_PCIE_MST_CTRL_3);
|
||||
data = REG_SET_FIELD(data, BIF_BIF256_CI256_RC3X4_USB4_PCIE_MST_CTRL_3,
|
||||
CI_SWUS_MAX_READ_REQUEST_SIZE_MODE, 1);
|
||||
data = REG_SET_FIELD(data, BIF_BIF256_CI256_RC3X4_USB4_PCIE_MST_CTRL_3,
|
||||
CI_SWUS_MAX_READ_REQUEST_SIZE_PRIV, 1);
|
||||
|
||||
if (def != data)
|
||||
WREG32_SOC15(NBIO, 0, regBIF_BIF256_CI256_RC3X4_USB4_PCIE_MST_CTRL_3, data);
|
||||
|
||||
if (def != data)
|
||||
WREG32_SOC15(NBIO, 0, regBIF_BIF256_CI256_RC3X4_USB4_PCIE_MST_CTRL_3, data);
|
||||
*/
|
||||
}
|
||||
|
||||
static void nbio_v7_11_update_medium_grain_clock_gating(struct amdgpu_device *adev,
|
||||
|
@ -611,11 +611,6 @@ static void nbio_v7_9_handle_ras_controller_intr_no_bifring(struct amdgpu_device
|
||||
|
||||
dev_info(adev->dev, "RAS controller interrupt triggered "
|
||||
"by NBIF error\n");
|
||||
|
||||
/* ras_controller_int is dedicated for nbif ras error,
|
||||
* not the global interrupt for sync flood
|
||||
*/
|
||||
amdgpu_ras_reset_gpu(adev);
|
||||
}
|
||||
|
||||
amdgpu_ras_error_data_fini(&err_data);
|
||||
|
@ -1161,6 +1161,11 @@ static int soc15_common_early_init(void *handle)
|
||||
AMD_PG_SUPPORT_VCN_DPG |
|
||||
AMD_PG_SUPPORT_JPEG;
|
||||
adev->external_rev_id = adev->rev_id + 0x46;
|
||||
/* GC 9.4.3 uses MMIO register region hole at a different offset */
|
||||
if (!amdgpu_sriov_vf(adev)) {
|
||||
adev->rmmio_remap.reg_offset = 0x1A000;
|
||||
adev->rmmio_remap.bus_addr = adev->rmmio_base + 0x1A000;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
/* FIXME: not supported yet */
|
||||
|
@ -1128,7 +1128,7 @@ static inline struct kfd_node *kfd_node_by_irq_ids(struct amdgpu_device *adev,
|
||||
struct kfd_dev *dev = adev->kfd.dev;
|
||||
uint32_t i;
|
||||
|
||||
if (adev->ip_versions[GC_HWIP][0] != IP_VERSION(9, 4, 3))
|
||||
if (KFD_GC_VERSION(dev) != IP_VERSION(9, 4, 3))
|
||||
return dev->nodes[0];
|
||||
|
||||
for (i = 0; i < dev->num_nodes; i++)
|
||||
|
@ -169,16 +169,43 @@ int pqm_init(struct process_queue_manager *pqm, struct kfd_process *p)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void pqm_clean_queue_resource(struct process_queue_manager *pqm,
|
||||
struct process_queue_node *pqn)
|
||||
{
|
||||
struct kfd_node *dev;
|
||||
struct kfd_process_device *pdd;
|
||||
|
||||
dev = pqn->q->device;
|
||||
|
||||
pdd = kfd_get_process_device_data(dev, pqm->process);
|
||||
if (!pdd) {
|
||||
pr_err("Process device data doesn't exist\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (pqn->q->gws) {
|
||||
if (KFD_GC_VERSION(pqn->q->device) != IP_VERSION(9, 4, 3) &&
|
||||
!dev->kfd->shared_resources.enable_mes)
|
||||
amdgpu_amdkfd_remove_gws_from_process(
|
||||
pqm->process->kgd_process_info, pqn->q->gws);
|
||||
pdd->qpd.num_gws = 0;
|
||||
}
|
||||
|
||||
if (dev->kfd->shared_resources.enable_mes) {
|
||||
amdgpu_amdkfd_free_gtt_mem(dev->adev, pqn->q->gang_ctx_bo);
|
||||
if (pqn->q->wptr_bo)
|
||||
amdgpu_amdkfd_free_gtt_mem(dev->adev, pqn->q->wptr_bo);
|
||||
}
|
||||
}
|
||||
|
||||
void pqm_uninit(struct process_queue_manager *pqm)
|
||||
{
|
||||
struct process_queue_node *pqn, *next;
|
||||
|
||||
list_for_each_entry_safe(pqn, next, &pqm->queues, process_queue_list) {
|
||||
if (pqn->q && pqn->q->gws &&
|
||||
KFD_GC_VERSION(pqn->q->device) != IP_VERSION(9, 4, 3) &&
|
||||
!pqn->q->device->kfd->shared_resources.enable_mes)
|
||||
amdgpu_amdkfd_remove_gws_from_process(pqm->process->kgd_process_info,
|
||||
pqn->q->gws);
|
||||
if (pqn->q)
|
||||
pqm_clean_queue_resource(pqm, pqn);
|
||||
|
||||
kfd_procfs_del_queue(pqn->q);
|
||||
uninit_queue(pqn->q);
|
||||
list_del(&pqn->process_queue_list);
|
||||
@ -461,22 +488,7 @@ int pqm_destroy_queue(struct process_queue_manager *pqm, unsigned int qid)
|
||||
goto err_destroy_queue;
|
||||
}
|
||||
|
||||
if (pqn->q->gws) {
|
||||
if (KFD_GC_VERSION(pqn->q->device) != IP_VERSION(9, 4, 3) &&
|
||||
!dev->kfd->shared_resources.enable_mes)
|
||||
amdgpu_amdkfd_remove_gws_from_process(
|
||||
pqm->process->kgd_process_info,
|
||||
pqn->q->gws);
|
||||
pdd->qpd.num_gws = 0;
|
||||
}
|
||||
|
||||
if (dev->kfd->shared_resources.enable_mes) {
|
||||
amdgpu_amdkfd_free_gtt_mem(dev->adev,
|
||||
pqn->q->gang_ctx_bo);
|
||||
if (pqn->q->wptr_bo)
|
||||
amdgpu_amdkfd_free_gtt_mem(dev->adev, pqn->q->wptr_bo);
|
||||
|
||||
}
|
||||
pqm_clean_queue_resource(pqm, pqn);
|
||||
uninit_queue(pqn->q);
|
||||
}
|
||||
|
||||
|
@ -6267,7 +6267,7 @@ int amdgpu_dm_connector_atomic_set_property(struct drm_connector *connector,
|
||||
dm_new_state->underscan_enable = val;
|
||||
ret = 0;
|
||||
} else if (property == adev->mode_info.abm_level_property) {
|
||||
dm_new_state->abm_level = val;
|
||||
dm_new_state->abm_level = val ?: ABM_LEVEL_IMMEDIATE_DISABLE;
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
@ -6312,7 +6312,8 @@ int amdgpu_dm_connector_atomic_get_property(struct drm_connector *connector,
|
||||
*val = dm_state->underscan_enable;
|
||||
ret = 0;
|
||||
} else if (property == adev->mode_info.abm_level_property) {
|
||||
*val = dm_state->abm_level;
|
||||
*val = (dm_state->abm_level != ABM_LEVEL_IMMEDIATE_DISABLE) ?
|
||||
dm_state->abm_level : 0;
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
@ -6385,7 +6386,8 @@ void amdgpu_dm_connector_funcs_reset(struct drm_connector *connector)
|
||||
state->pbn = 0;
|
||||
|
||||
if (connector->connector_type == DRM_MODE_CONNECTOR_eDP)
|
||||
state->abm_level = amdgpu_dm_abm_level;
|
||||
state->abm_level = amdgpu_dm_abm_level ?:
|
||||
ABM_LEVEL_IMMEDIATE_DISABLE;
|
||||
|
||||
__drm_atomic_helper_connector_reset(connector, &state->base);
|
||||
}
|
||||
|
@ -334,7 +334,7 @@ static struct wm_table lpddr5_wm_table = {
|
||||
{
|
||||
.wm_inst = WM_A,
|
||||
.wm_type = WM_TYPE_PSTATE_CHG,
|
||||
.pstate_latency_us = 11.65333,
|
||||
.pstate_latency_us = 129.0,
|
||||
.sr_exit_time_us = 11.5,
|
||||
.sr_enter_plus_exit_time_us = 14.5,
|
||||
.valid = true,
|
||||
@ -342,7 +342,7 @@ static struct wm_table lpddr5_wm_table = {
|
||||
{
|
||||
.wm_inst = WM_B,
|
||||
.wm_type = WM_TYPE_PSTATE_CHG,
|
||||
.pstate_latency_us = 11.65333,
|
||||
.pstate_latency_us = 129.0,
|
||||
.sr_exit_time_us = 11.5,
|
||||
.sr_enter_plus_exit_time_us = 14.5,
|
||||
.valid = true,
|
||||
@ -350,7 +350,7 @@ static struct wm_table lpddr5_wm_table = {
|
||||
{
|
||||
.wm_inst = WM_C,
|
||||
.wm_type = WM_TYPE_PSTATE_CHG,
|
||||
.pstate_latency_us = 11.65333,
|
||||
.pstate_latency_us = 129.0,
|
||||
.sr_exit_time_us = 11.5,
|
||||
.sr_enter_plus_exit_time_us = 14.5,
|
||||
.valid = true,
|
||||
@ -358,7 +358,7 @@ static struct wm_table lpddr5_wm_table = {
|
||||
{
|
||||
.wm_inst = WM_D,
|
||||
.wm_type = WM_TYPE_PSTATE_CHG,
|
||||
.pstate_latency_us = 11.65333,
|
||||
.pstate_latency_us = 129.0,
|
||||
.sr_exit_time_us = 11.5,
|
||||
.sr_enter_plus_exit_time_us = 14.5,
|
||||
.valid = true,
|
||||
|
@ -232,6 +232,10 @@ void dcn35_update_clocks(struct clk_mgr *clk_mgr_base,
|
||||
if (dc->work_arounds.skip_clock_update)
|
||||
return;
|
||||
|
||||
/* DTBCLK is fixed, so set a default if unspecified. */
|
||||
if (new_clocks->dtbclk_en && !new_clocks->ref_dtbclk_khz)
|
||||
new_clocks->ref_dtbclk_khz = 600000;
|
||||
|
||||
/*
|
||||
* if it is safe to lower, but we are already in the lower state, we don't have to do anything
|
||||
* also if safe to lower is false, we just go in the higher state
|
||||
@ -265,8 +269,10 @@ void dcn35_update_clocks(struct clk_mgr *clk_mgr_base,
|
||||
|
||||
if (!clk_mgr_base->clks.dtbclk_en && new_clocks->dtbclk_en) {
|
||||
dcn35_smu_set_dtbclk(clk_mgr, true);
|
||||
dcn35_update_clocks_update_dtb_dto(clk_mgr, context, clk_mgr_base->clks.ref_dtbclk_khz);
|
||||
clk_mgr_base->clks.dtbclk_en = new_clocks->dtbclk_en;
|
||||
|
||||
dcn35_update_clocks_update_dtb_dto(clk_mgr, context, new_clocks->ref_dtbclk_khz);
|
||||
clk_mgr_base->clks.ref_dtbclk_khz = new_clocks->ref_dtbclk_khz;
|
||||
}
|
||||
|
||||
/* check that we're not already in D0 */
|
||||
@ -314,17 +320,12 @@ void dcn35_update_clocks(struct clk_mgr *clk_mgr_base,
|
||||
update_dispclk = true;
|
||||
}
|
||||
|
||||
if (!new_clocks->dtbclk_en) {
|
||||
new_clocks->ref_dtbclk_khz = 600000;
|
||||
}
|
||||
|
||||
/* clock limits are received with MHz precision, divide by 1000 to prevent setting clocks at every call */
|
||||
if (!dc->debug.disable_dtb_ref_clk_switch &&
|
||||
should_set_clock(safe_to_lower, new_clocks->ref_dtbclk_khz / 1000, clk_mgr_base->clks.ref_dtbclk_khz / 1000)) {
|
||||
/* DCCG requires KHz precision for DTBCLK */
|
||||
dcn35_smu_set_dtbclk(clk_mgr, true);
|
||||
|
||||
dcn35_update_clocks_update_dtb_dto(clk_mgr, context, clk_mgr_base->clks.ref_dtbclk_khz);
|
||||
should_set_clock(safe_to_lower, new_clocks->ref_dtbclk_khz / 1000,
|
||||
clk_mgr_base->clks.ref_dtbclk_khz / 1000)) {
|
||||
dcn35_update_clocks_update_dtb_dto(clk_mgr, context, new_clocks->ref_dtbclk_khz);
|
||||
clk_mgr_base->clks.ref_dtbclk_khz = new_clocks->ref_dtbclk_khz;
|
||||
}
|
||||
|
||||
if (dpp_clock_lowered) {
|
||||
@ -443,32 +444,32 @@ static struct wm_table ddr5_wm_table = {
|
||||
.wm_inst = WM_A,
|
||||
.wm_type = WM_TYPE_PSTATE_CHG,
|
||||
.pstate_latency_us = 11.72,
|
||||
.sr_exit_time_us = 9,
|
||||
.sr_enter_plus_exit_time_us = 11,
|
||||
.sr_exit_time_us = 14.0,
|
||||
.sr_enter_plus_exit_time_us = 16.0,
|
||||
.valid = true,
|
||||
},
|
||||
{
|
||||
.wm_inst = WM_B,
|
||||
.wm_type = WM_TYPE_PSTATE_CHG,
|
||||
.pstate_latency_us = 11.72,
|
||||
.sr_exit_time_us = 9,
|
||||
.sr_enter_plus_exit_time_us = 11,
|
||||
.sr_exit_time_us = 14.0,
|
||||
.sr_enter_plus_exit_time_us = 16.0,
|
||||
.valid = true,
|
||||
},
|
||||
{
|
||||
.wm_inst = WM_C,
|
||||
.wm_type = WM_TYPE_PSTATE_CHG,
|
||||
.pstate_latency_us = 11.72,
|
||||
.sr_exit_time_us = 9,
|
||||
.sr_enter_plus_exit_time_us = 11,
|
||||
.sr_exit_time_us = 14.0,
|
||||
.sr_enter_plus_exit_time_us = 16.0,
|
||||
.valid = true,
|
||||
},
|
||||
{
|
||||
.wm_inst = WM_D,
|
||||
.wm_type = WM_TYPE_PSTATE_CHG,
|
||||
.pstate_latency_us = 11.72,
|
||||
.sr_exit_time_us = 9,
|
||||
.sr_enter_plus_exit_time_us = 11,
|
||||
.sr_exit_time_us = 14.0,
|
||||
.sr_enter_plus_exit_time_us = 16.0,
|
||||
.valid = true,
|
||||
},
|
||||
}
|
||||
@ -480,32 +481,32 @@ static struct wm_table lpddr5_wm_table = {
|
||||
.wm_inst = WM_A,
|
||||
.wm_type = WM_TYPE_PSTATE_CHG,
|
||||
.pstate_latency_us = 11.65333,
|
||||
.sr_exit_time_us = 11.5,
|
||||
.sr_enter_plus_exit_time_us = 14.5,
|
||||
.sr_exit_time_us = 14.0,
|
||||
.sr_enter_plus_exit_time_us = 16.0,
|
||||
.valid = true,
|
||||
},
|
||||
{
|
||||
.wm_inst = WM_B,
|
||||
.wm_type = WM_TYPE_PSTATE_CHG,
|
||||
.pstate_latency_us = 11.65333,
|
||||
.sr_exit_time_us = 11.5,
|
||||
.sr_enter_plus_exit_time_us = 14.5,
|
||||
.sr_exit_time_us = 14.0,
|
||||
.sr_enter_plus_exit_time_us = 16.0,
|
||||
.valid = true,
|
||||
},
|
||||
{
|
||||
.wm_inst = WM_C,
|
||||
.wm_type = WM_TYPE_PSTATE_CHG,
|
||||
.pstate_latency_us = 11.65333,
|
||||
.sr_exit_time_us = 11.5,
|
||||
.sr_enter_plus_exit_time_us = 14.5,
|
||||
.sr_exit_time_us = 14.0,
|
||||
.sr_enter_plus_exit_time_us = 16.0,
|
||||
.valid = true,
|
||||
},
|
||||
{
|
||||
.wm_inst = WM_D,
|
||||
.wm_type = WM_TYPE_PSTATE_CHG,
|
||||
.pstate_latency_us = 11.65333,
|
||||
.sr_exit_time_us = 11.5,
|
||||
.sr_enter_plus_exit_time_us = 14.5,
|
||||
.sr_exit_time_us = 14.0,
|
||||
.sr_enter_plus_exit_time_us = 16.0,
|
||||
.valid = true,
|
||||
},
|
||||
}
|
||||
@ -515,11 +516,6 @@ static DpmClocks_t_dcn35 dummy_clocks;
|
||||
|
||||
static struct dcn35_watermarks dummy_wms = { 0 };
|
||||
|
||||
static struct dcn35_ss_info_table ss_info_table = {
|
||||
.ss_divider = 1000,
|
||||
.ss_percentage = {0, 0, 375, 375, 375}
|
||||
};
|
||||
|
||||
static void dcn35_build_watermark_ranges(struct clk_bw_params *bw_params, struct dcn35_watermarks *table)
|
||||
{
|
||||
int i, num_valid_sets;
|
||||
@ -653,27 +649,47 @@ static unsigned int convert_wck_ratio(uint8_t wck_ratio)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static inline uint32_t calc_dram_speed_mts(const MemPstateTable_t *entry)
|
||||
{
|
||||
return entry->UClk * convert_wck_ratio(entry->WckRatio) * 2;
|
||||
}
|
||||
|
||||
static void dcn35_clk_mgr_helper_populate_bw_params(struct clk_mgr_internal *clk_mgr,
|
||||
struct integrated_info *bios_info,
|
||||
DpmClocks_t_dcn35 *clock_table)
|
||||
{
|
||||
struct clk_bw_params *bw_params = clk_mgr->base.bw_params;
|
||||
struct clk_limit_table_entry def_max = bw_params->clk_table.entries[bw_params->clk_table.num_entries - 1];
|
||||
uint32_t max_pstate = 0, max_uclk = 0, max_fclk = 0;
|
||||
uint32_t min_pstate = 0, max_dispclk = 0, max_dppclk = 0;
|
||||
uint32_t max_fclk = 0, min_pstate = 0, max_dispclk = 0, max_dppclk = 0;
|
||||
uint32_t max_pstate = 0, max_dram_speed_mts = 0, min_dram_speed_mts = 0;
|
||||
int i;
|
||||
|
||||
/* Determine min/max p-state values. */
|
||||
for (i = 0; i < clock_table->NumMemPstatesEnabled; i++) {
|
||||
if (is_valid_clock_value(clock_table->MemPstateTable[i].UClk) &&
|
||||
clock_table->MemPstateTable[i].UClk > max_uclk) {
|
||||
max_uclk = clock_table->MemPstateTable[i].UClk;
|
||||
uint32_t dram_speed_mts = calc_dram_speed_mts(&clock_table->MemPstateTable[i]);
|
||||
|
||||
if (is_valid_clock_value(dram_speed_mts) && dram_speed_mts > max_dram_speed_mts) {
|
||||
max_dram_speed_mts = dram_speed_mts;
|
||||
max_pstate = i;
|
||||
}
|
||||
}
|
||||
|
||||
/* We expect the table to contain at least one valid Uclk entry. */
|
||||
ASSERT(is_valid_clock_value(max_uclk));
|
||||
min_dram_speed_mts = max_dram_speed_mts;
|
||||
min_pstate = max_pstate;
|
||||
|
||||
for (i = 0; i < clock_table->NumMemPstatesEnabled; i++) {
|
||||
uint32_t dram_speed_mts = calc_dram_speed_mts(&clock_table->MemPstateTable[i]);
|
||||
|
||||
if (is_valid_clock_value(dram_speed_mts) && dram_speed_mts < min_dram_speed_mts) {
|
||||
min_dram_speed_mts = dram_speed_mts;
|
||||
min_pstate = i;
|
||||
}
|
||||
}
|
||||
|
||||
/* We expect the table to contain at least one valid P-state entry. */
|
||||
ASSERT(clock_table->NumMemPstatesEnabled &&
|
||||
is_valid_clock_value(max_dram_speed_mts) &&
|
||||
is_valid_clock_value(min_dram_speed_mts));
|
||||
|
||||
/* dispclk and dppclk can be max at any voltage, same number of levels for both */
|
||||
if (clock_table->NumDispClkLevelsEnabled <= NUM_DISPCLK_DPM_LEVELS &&
|
||||
@ -683,47 +699,46 @@ static void dcn35_clk_mgr_helper_populate_bw_params(struct clk_mgr_internal *clk
|
||||
max_dppclk = find_max_clk_value(clock_table->DppClocks,
|
||||
clock_table->NumDispClkLevelsEnabled);
|
||||
} else {
|
||||
/* Invalid number of entries in the table from PMFW. */
|
||||
ASSERT(0);
|
||||
}
|
||||
if (clock_table->NumFclkLevelsEnabled <= NUM_FCLK_DPM_LEVELS)
|
||||
max_fclk = find_max_clk_value(clock_table->FclkClocks_Freq,
|
||||
clock_table->NumFclkLevelsEnabled);
|
||||
|
||||
for (i = 0; i < clock_table->NumMemPstatesEnabled; i++) {
|
||||
uint32_t min_uclk = clock_table->MemPstateTable[0].UClk;
|
||||
/* Base the clock table on dcfclk, need at least one entry regardless of pmfw table */
|
||||
ASSERT(clock_table->NumDcfClkLevelsEnabled > 0);
|
||||
|
||||
max_fclk = find_max_clk_value(clock_table->FclkClocks_Freq, clock_table->NumFclkLevelsEnabled);
|
||||
|
||||
for (i = 0; i < clock_table->NumDcfClkLevelsEnabled; i++) {
|
||||
int j;
|
||||
|
||||
for (j = 1; j < clock_table->NumMemPstatesEnabled; j++) {
|
||||
if (is_valid_clock_value(clock_table->MemPstateTable[j].UClk) &&
|
||||
clock_table->MemPstateTable[j].UClk < min_uclk &&
|
||||
clock_table->MemPstateTable[j].Voltage <= clock_table->SocVoltage[i]) {
|
||||
min_uclk = clock_table->MemPstateTable[j].UClk;
|
||||
min_pstate = j;
|
||||
}
|
||||
}
|
||||
|
||||
/* First search defaults for the clocks we don't read using closest lower or equal default dcfclk */
|
||||
for (j = bw_params->clk_table.num_entries - 1; j > 0; j--)
|
||||
if (bw_params->clk_table.entries[j].dcfclk_mhz <= clock_table->DcfClocks[i])
|
||||
break;
|
||||
break;
|
||||
|
||||
bw_params->clk_table.entries[i].phyclk_mhz = bw_params->clk_table.entries[j].phyclk_mhz;
|
||||
bw_params->clk_table.entries[i].phyclk_d18_mhz = bw_params->clk_table.entries[j].phyclk_d18_mhz;
|
||||
bw_params->clk_table.entries[i].dtbclk_mhz = bw_params->clk_table.entries[j].dtbclk_mhz;
|
||||
bw_params->clk_table.entries[i].fclk_mhz = max_fclk;
|
||||
|
||||
/* Now update clocks we do read */
|
||||
bw_params->clk_table.entries[i].memclk_mhz = clock_table->MemPstateTable[min_pstate].MemClk;
|
||||
bw_params->clk_table.entries[i].voltage = clock_table->MemPstateTable[min_pstate].Voltage;
|
||||
bw_params->clk_table.entries[i].dcfclk_mhz = clock_table->DcfClocks[i];
|
||||
bw_params->clk_table.entries[i].socclk_mhz = clock_table->SocClocks[i];
|
||||
bw_params->clk_table.entries[i].dispclk_mhz = max_dispclk;
|
||||
bw_params->clk_table.entries[i].dppclk_mhz = max_dppclk;
|
||||
bw_params->clk_table.entries[i].wck_ratio = convert_wck_ratio(
|
||||
clock_table->MemPstateTable[min_pstate].WckRatio);
|
||||
}
|
||||
bw_params->clk_table.entries[i].wck_ratio =
|
||||
convert_wck_ratio(clock_table->MemPstateTable[min_pstate].WckRatio);
|
||||
|
||||
/* Dcfclk and Fclk are tied, but at a different ratio */
|
||||
bw_params->clk_table.entries[i].fclk_mhz = min(max_fclk, 2 * clock_table->DcfClocks[i]);
|
||||
}
|
||||
|
||||
/* Make sure to include at least one entry at highest pstate */
|
||||
if (max_pstate != min_pstate || i == 0) {
|
||||
if (i > MAX_NUM_DPM_LVL - 1)
|
||||
i = MAX_NUM_DPM_LVL - 1;
|
||||
|
||||
bw_params->clk_table.entries[i].fclk_mhz = max_fclk;
|
||||
bw_params->clk_table.entries[i].memclk_mhz = clock_table->MemPstateTable[max_pstate].MemClk;
|
||||
bw_params->clk_table.entries[i].voltage = clock_table->MemPstateTable[max_pstate].Voltage;
|
||||
@ -739,6 +754,7 @@ static void dcn35_clk_mgr_helper_populate_bw_params(struct clk_mgr_internal *clk
|
||||
}
|
||||
bw_params->clk_table.num_entries = i--;
|
||||
|
||||
/* Make sure all highest clocks are included*/
|
||||
bw_params->clk_table.entries[i].socclk_mhz =
|
||||
find_max_clk_value(clock_table->SocClocks, NUM_SOCCLK_DPM_LEVELS);
|
||||
bw_params->clk_table.entries[i].dispclk_mhz =
|
||||
@ -757,6 +773,11 @@ static void dcn35_clk_mgr_helper_populate_bw_params(struct clk_mgr_internal *clk
|
||||
bw_params->clk_table.num_entries_per_clk.num_fclk_levels = clock_table->NumFclkLevelsEnabled;
|
||||
bw_params->clk_table.num_entries_per_clk.num_memclk_levels = clock_table->NumMemPstatesEnabled;
|
||||
bw_params->clk_table.num_entries_per_clk.num_socclk_levels = clock_table->NumSocClkLevelsEnabled;
|
||||
|
||||
/*
|
||||
* Set any 0 clocks to max default setting. Not an issue for
|
||||
* power since we aren't doing switching in such case anyway
|
||||
*/
|
||||
for (i = 0; i < bw_params->clk_table.num_entries; i++) {
|
||||
if (!bw_params->clk_table.entries[i].fclk_mhz) {
|
||||
bw_params->clk_table.entries[i].fclk_mhz = def_max.fclk_mhz;
|
||||
@ -965,21 +986,6 @@ struct clk_mgr_funcs dcn35_fpga_funcs = {
|
||||
.get_dtb_ref_clk_frequency = dcn31_get_dtb_ref_freq_khz,
|
||||
};
|
||||
|
||||
static void dcn35_read_ss_info_from_lut(struct clk_mgr_internal *clk_mgr)
|
||||
{
|
||||
uint32_t clock_source;
|
||||
struct dc_context *ctx = clk_mgr->base.ctx;
|
||||
|
||||
REG_GET(CLK1_CLK2_BYPASS_CNTL, CLK2_BYPASS_SEL, &clock_source);
|
||||
|
||||
clk_mgr->dprefclk_ss_percentage = ss_info_table.ss_percentage[clock_source];
|
||||
|
||||
if (clk_mgr->dprefclk_ss_percentage != 0) {
|
||||
clk_mgr->ss_on_dprefclk = true;
|
||||
clk_mgr->dprefclk_ss_divider = ss_info_table.ss_divider;
|
||||
}
|
||||
}
|
||||
|
||||
void dcn35_clk_mgr_construct(
|
||||
struct dc_context *ctx,
|
||||
struct clk_mgr_dcn35 *clk_mgr,
|
||||
@ -1043,17 +1049,11 @@ void dcn35_clk_mgr_construct(
|
||||
dcn35_dump_clk_registers(&clk_mgr->base.base.boot_snapshot, &clk_mgr->base.base, &log_info);
|
||||
|
||||
clk_mgr->base.base.dprefclk_khz = dcn35_smu_get_dprefclk(&clk_mgr->base);
|
||||
clk_mgr->base.base.clks.ref_dtbclk_khz = dcn35_smu_get_dtbclk(&clk_mgr->base);
|
||||
clk_mgr->base.base.clks.ref_dtbclk_khz = 600000;
|
||||
|
||||
if (!clk_mgr->base.base.clks.ref_dtbclk_khz)
|
||||
dcn35_smu_set_dtbclk(&clk_mgr->base, true);
|
||||
|
||||
clk_mgr->base.base.clks.dtbclk_en = true;
|
||||
dce_clock_read_ss_info(&clk_mgr->base);
|
||||
/*when clk src is from FCH, it could have ss, same clock src as DPREF clk*/
|
||||
|
||||
dcn35_read_ss_info_from_lut(&clk_mgr->base);
|
||||
|
||||
clk_mgr->base.base.bw_params = &dcn35_bw_params;
|
||||
|
||||
if (clk_mgr->base.base.ctx->dc->debug.pstate_enabled) {
|
||||
@ -1129,7 +1129,6 @@ void dcn35_clk_mgr_construct(
|
||||
ctx->dc->debug.disable_dpp_power_gate = false;
|
||||
ctx->dc->debug.disable_hubp_power_gate = false;
|
||||
ctx->dc->debug.disable_dsc_power_gate = false;
|
||||
ctx->dc->debug.disable_hpo_power_gate = false;
|
||||
} else {
|
||||
/*let's reset the config control flag*/
|
||||
ctx->dc->config.disable_ips = DMUB_IPS_DISABLE_ALL; /*pmfw not support it, disable it all*/
|
||||
|
@ -874,6 +874,7 @@ struct dc_debug_options {
|
||||
unsigned int seamless_boot_odm_combine;
|
||||
unsigned int force_odm_combine_4to1; //bit vector based on otg inst
|
||||
int minimum_z8_residency_time;
|
||||
int minimum_z10_residency_time;
|
||||
bool disable_z9_mpc;
|
||||
unsigned int force_fclk_khz;
|
||||
bool enable_tri_buf;
|
||||
@ -1608,7 +1609,6 @@ struct dc_link {
|
||||
enum edp_revision edp_revision;
|
||||
union dpcd_sink_ext_caps dpcd_sink_ext_caps;
|
||||
|
||||
struct backlight_settings backlight_settings;
|
||||
struct psr_settings psr_settings;
|
||||
|
||||
struct replay_settings replay_settings;
|
||||
|
@ -991,10 +991,6 @@ struct link_mst_stream_allocation_table {
|
||||
struct link_mst_stream_allocation stream_allocations[MAX_CONTROLLER_NUM];
|
||||
};
|
||||
|
||||
struct backlight_settings {
|
||||
uint32_t backlight_millinits;
|
||||
};
|
||||
|
||||
/* PSR feature flags */
|
||||
struct psr_settings {
|
||||
bool psr_feature_enabled; // PSR is supported by sink
|
||||
|
@ -871,7 +871,7 @@ static const struct dc_plane_cap plane_cap = {
|
||||
static const struct dc_debug_options debug_defaults_drv = {
|
||||
.disable_z10 = false,
|
||||
.enable_z9_disable_interface = true,
|
||||
.minimum_z8_residency_time = 2000,
|
||||
.minimum_z8_residency_time = 2100,
|
||||
.psr_skip_crtc_disable = true,
|
||||
.replay_skip_crtc_disabled = true,
|
||||
.disable_dmcu = true,
|
||||
|
@ -261,6 +261,7 @@ void pg_cntl35_hpo_pg_control(struct pg_cntl *pg_cntl, bool power_on)
|
||||
uint32_t power_gate = power_on ? 0 : 1;
|
||||
uint32_t pwr_status = power_on ? 0 : 2;
|
||||
uint32_t org_ip_request_cntl;
|
||||
uint32_t power_forceon;
|
||||
bool block_enabled;
|
||||
|
||||
if (pg_cntl->ctx->dc->debug.ignore_pg ||
|
||||
@ -277,6 +278,10 @@ void pg_cntl35_hpo_pg_control(struct pg_cntl *pg_cntl, bool power_on)
|
||||
return;
|
||||
}
|
||||
|
||||
REG_GET(DOMAIN25_PG_CONFIG, DOMAIN_POWER_FORCEON, &power_forceon);
|
||||
if (power_forceon)
|
||||
return;
|
||||
|
||||
REG_GET(DC_IP_REQUEST_CNTL, IP_REQUEST_EN, &org_ip_request_cntl);
|
||||
if (org_ip_request_cntl == 0)
|
||||
REG_SET(DC_IP_REQUEST_CNTL, 0, IP_REQUEST_EN, 1);
|
||||
@ -304,6 +309,7 @@ void pg_cntl35_io_clk_pg_control(struct pg_cntl *pg_cntl, bool power_on)
|
||||
uint32_t power_gate = power_on ? 0 : 1;
|
||||
uint32_t pwr_status = power_on ? 0 : 2;
|
||||
uint32_t org_ip_request_cntl;
|
||||
uint32_t power_forceon;
|
||||
bool block_enabled;
|
||||
|
||||
if (pg_cntl->ctx->dc->debug.ignore_pg ||
|
||||
@ -319,6 +325,10 @@ void pg_cntl35_io_clk_pg_control(struct pg_cntl *pg_cntl, bool power_on)
|
||||
return;
|
||||
}
|
||||
|
||||
REG_GET(DOMAIN22_PG_CONFIG, DOMAIN_POWER_FORCEON, &power_forceon);
|
||||
if (power_forceon)
|
||||
return;
|
||||
|
||||
REG_GET(DC_IP_REQUEST_CNTL, IP_REQUEST_EN, &org_ip_request_cntl);
|
||||
if (org_ip_request_cntl == 0)
|
||||
REG_SET(DC_IP_REQUEST_CNTL, 0, IP_REQUEST_EN, 1);
|
||||
|
@ -1712,6 +1712,13 @@ static bool dcn35_validate_bandwidth(struct dc *dc,
|
||||
|
||||
out = dml2_validate(dc, context, fast_validate);
|
||||
|
||||
if (fast_validate)
|
||||
return out;
|
||||
|
||||
DC_FP_START();
|
||||
dcn35_decide_zstate_support(dc, context);
|
||||
DC_FP_END();
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
@ -1857,7 +1864,7 @@ static bool dcn35_resource_construct(
|
||||
|
||||
/* Use pipe context based otg sync logic */
|
||||
dc->config.use_pipe_ctx_sync_logic = true;
|
||||
dc->config.use_default_clock_table = false;
|
||||
|
||||
/* read VBIOS LTTPR caps */
|
||||
{
|
||||
if (ctx->dc_bios->funcs->get_lttpr_caps) {
|
||||
|
@ -36,7 +36,7 @@
|
||||
* Define the maximum amount of states supported by the ASIC. Every ASIC has a
|
||||
* specific number of states; this macro defines the maximum number of states.
|
||||
*/
|
||||
#define DC__VOLTAGE_STATES 20
|
||||
#define DC__VOLTAGE_STATES 40
|
||||
#define DC__NUM_DPP__4 1
|
||||
#define DC__NUM_DPP__0_PRESENT 1
|
||||
#define DC__NUM_DPP__1_PRESENT 1
|
||||
|
@ -950,10 +950,8 @@ static enum dcn_zstate_support_state decide_zstate_support(struct dc *dc, struc
|
||||
{
|
||||
int plane_count;
|
||||
int i;
|
||||
unsigned int min_dst_y_next_start_us;
|
||||
|
||||
plane_count = 0;
|
||||
min_dst_y_next_start_us = 0;
|
||||
for (i = 0; i < dc->res_pool->pipe_count; i++) {
|
||||
if (context->res_ctx.pipe_ctx[i].plane_state)
|
||||
plane_count++;
|
||||
@ -975,26 +973,15 @@ static enum dcn_zstate_support_state decide_zstate_support(struct dc *dc, struc
|
||||
else if (context->stream_count == 1 && context->streams[0]->signal == SIGNAL_TYPE_EDP) {
|
||||
struct dc_link *link = context->streams[0]->sink->link;
|
||||
struct dc_stream_status *stream_status = &context->stream_status[0];
|
||||
struct dc_stream_state *current_stream = context->streams[0];
|
||||
int minmum_z8_residency = dc->debug.minimum_z8_residency_time > 0 ? dc->debug.minimum_z8_residency_time : 1000;
|
||||
bool allow_z8 = context->bw_ctx.dml.vba.StutterPeriod > (double)minmum_z8_residency;
|
||||
bool is_pwrseq0 = link->link_index == 0;
|
||||
bool isFreesyncVideo;
|
||||
|
||||
isFreesyncVideo = current_stream->adjust.v_total_min == current_stream->adjust.v_total_max;
|
||||
isFreesyncVideo = isFreesyncVideo && current_stream->timing.v_total < current_stream->adjust.v_total_min;
|
||||
for (i = 0; i < dc->res_pool->pipe_count; i++) {
|
||||
if (context->res_ctx.pipe_ctx[i].stream == current_stream && isFreesyncVideo) {
|
||||
min_dst_y_next_start_us = context->res_ctx.pipe_ctx[i].dlg_regs.min_dst_y_next_start_us;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Don't support multi-plane configurations */
|
||||
if (stream_status->plane_count > 1)
|
||||
return DCN_ZSTATE_SUPPORT_DISALLOW;
|
||||
|
||||
if (is_pwrseq0 && (context->bw_ctx.dml.vba.StutterPeriod > 5000.0 || min_dst_y_next_start_us > 5000))
|
||||
if (is_pwrseq0 && context->bw_ctx.dml.vba.StutterPeriod > 5000.0)
|
||||
return DCN_ZSTATE_SUPPORT_ALLOW;
|
||||
else if (is_pwrseq0 && link->psr_settings.psr_version == DC_PSR_VERSION_1 && !link->panel_config.psr.disable_psr)
|
||||
return allow_z8 ? DCN_ZSTATE_SUPPORT_ALLOW_Z8_Z10_ONLY : DCN_ZSTATE_SUPPORT_ALLOW_Z10_ONLY;
|
||||
|
@ -1192,13 +1192,16 @@ static bool update_pipe_slice_table_with_split_flags(
|
||||
*/
|
||||
struct pipe_ctx *pipe;
|
||||
bool odm;
|
||||
int i;
|
||||
int dc_pipe_idx, dml_pipe_idx = 0;
|
||||
bool updated = false;
|
||||
|
||||
for (i = 0; i < dc->res_pool->pipe_count; i++) {
|
||||
pipe = &context->res_ctx.pipe_ctx[i];
|
||||
for (dc_pipe_idx = 0;
|
||||
dc_pipe_idx < dc->res_pool->pipe_count; dc_pipe_idx++) {
|
||||
pipe = &context->res_ctx.pipe_ctx[dc_pipe_idx];
|
||||
if (resource_is_pipe_type(pipe, FREE_PIPE))
|
||||
continue;
|
||||
|
||||
if (merge[i]) {
|
||||
if (merge[dc_pipe_idx]) {
|
||||
if (resource_is_pipe_type(pipe, OPP_HEAD))
|
||||
/* merging OPP head means reducing ODM slice
|
||||
* count by 1
|
||||
@ -1213,17 +1216,18 @@ static bool update_pipe_slice_table_with_split_flags(
|
||||
updated = true;
|
||||
}
|
||||
|
||||
if (split[i]) {
|
||||
odm = vba->ODMCombineEnabled[vba->pipe_plane[i]] !=
|
||||
if (split[dc_pipe_idx]) {
|
||||
odm = vba->ODMCombineEnabled[vba->pipe_plane[dml_pipe_idx]] !=
|
||||
dm_odm_combine_mode_disabled;
|
||||
if (odm && resource_is_pipe_type(pipe, OPP_HEAD))
|
||||
update_slice_table_for_stream(
|
||||
table, pipe->stream, split[i] - 1);
|
||||
table, pipe->stream, split[dc_pipe_idx] - 1);
|
||||
else if (!odm && resource_is_pipe_type(pipe, DPP_PIPE))
|
||||
update_slice_table_for_plane(table, pipe,
|
||||
pipe->plane_state, split[i] - 1);
|
||||
pipe->plane_state, split[dc_pipe_idx] - 1);
|
||||
updated = true;
|
||||
}
|
||||
dml_pipe_idx++;
|
||||
}
|
||||
return updated;
|
||||
}
|
||||
@ -2231,6 +2235,7 @@ void dcn32_calculate_wm_and_dlg_fpu(struct dc *dc, struct dc_state *context,
|
||||
int i, pipe_idx, vlevel_temp = 0;
|
||||
double dcfclk = dcn3_2_soc.clock_limits[0].dcfclk_mhz;
|
||||
double dcfclk_from_validation = context->bw_ctx.dml.vba.DCFCLKState[vlevel][context->bw_ctx.dml.vba.maxMpcComb];
|
||||
double dram_speed_from_validation = context->bw_ctx.dml.vba.DRAMSpeed;
|
||||
double dcfclk_from_fw_based_mclk_switching = dcfclk_from_validation;
|
||||
bool pstate_en = context->bw_ctx.dml.vba.DRAMClockChangeSupport[vlevel][context->bw_ctx.dml.vba.maxMpcComb] !=
|
||||
dm_dram_clock_change_unsupported;
|
||||
@ -2418,7 +2423,7 @@ void dcn32_calculate_wm_and_dlg_fpu(struct dc *dc, struct dc_state *context,
|
||||
}
|
||||
|
||||
if (dc->clk_mgr->bw_params->wm_table.nv_entries[WM_C].valid) {
|
||||
min_dram_speed_mts = context->bw_ctx.dml.vba.DRAMSpeed;
|
||||
min_dram_speed_mts = dram_speed_from_validation;
|
||||
min_dram_speed_mts_margin = 160;
|
||||
|
||||
context->bw_ctx.dml.soc.dram_clock_change_latency_us =
|
||||
|
@ -164,10 +164,10 @@ struct _vcs_dpi_soc_bounding_box_st dcn3_5_soc = {
|
||||
},
|
||||
},
|
||||
.num_states = 5,
|
||||
.sr_exit_time_us = 9.0,
|
||||
.sr_enter_plus_exit_time_us = 11.0,
|
||||
.sr_exit_z8_time_us = 50.0, /*changed from 442.0*/
|
||||
.sr_enter_plus_exit_z8_time_us = 50.0,/*changed from 560.0*/
|
||||
.sr_exit_time_us = 14.0,
|
||||
.sr_enter_plus_exit_time_us = 16.0,
|
||||
.sr_exit_z8_time_us = 525.0,
|
||||
.sr_enter_plus_exit_z8_time_us = 715.0,
|
||||
.fclk_change_latency_us = 20.0,
|
||||
.usr_retraining_latency_us = 2,
|
||||
.writeback_latency_us = 12.0,
|
||||
@ -329,6 +329,48 @@ void dcn35_update_bw_bounding_box_fpu(struct dc *dc,
|
||||
/*temp till dml2 fully work without dml1*/
|
||||
dml_init_instance(&dc->dml, &dcn3_5_soc, &dcn3_5_ip,
|
||||
DML_PROJECT_DCN31);
|
||||
|
||||
/*copy to dml2, before dml2_create*/
|
||||
if (clk_table->num_entries > 2) {
|
||||
|
||||
for (i = 0; i < clk_table->num_entries; i++) {
|
||||
dc->dml2_options.bbox_overrides.clks_table.num_states =
|
||||
clk_table->num_entries;
|
||||
dc->dml2_options.bbox_overrides.clks_table.clk_entries[i].dcfclk_mhz =
|
||||
clock_limits[i].dcfclk_mhz;
|
||||
dc->dml2_options.bbox_overrides.clks_table.clk_entries[i].fclk_mhz =
|
||||
clock_limits[i].fabricclk_mhz;
|
||||
dc->dml2_options.bbox_overrides.clks_table.clk_entries[i].dispclk_mhz =
|
||||
clock_limits[i].dispclk_mhz;
|
||||
dc->dml2_options.bbox_overrides.clks_table.clk_entries[i].dppclk_mhz =
|
||||
clock_limits[i].dppclk_mhz;
|
||||
dc->dml2_options.bbox_overrides.clks_table.clk_entries[i].socclk_mhz =
|
||||
clock_limits[i].socclk_mhz;
|
||||
dc->dml2_options.bbox_overrides.clks_table.clk_entries[i].memclk_mhz =
|
||||
clk_table->entries[i].memclk_mhz * clk_table->entries[i].wck_ratio;
|
||||
dc->dml2_options.bbox_overrides.clks_table.num_entries_per_clk.num_dcfclk_levels =
|
||||
clk_table->num_entries;
|
||||
dc->dml2_options.bbox_overrides.clks_table.num_entries_per_clk.num_fclk_levels =
|
||||
clk_table->num_entries;
|
||||
dc->dml2_options.bbox_overrides.clks_table.num_entries_per_clk.num_dispclk_levels =
|
||||
clk_table->num_entries;
|
||||
dc->dml2_options.bbox_overrides.clks_table.num_entries_per_clk.num_dppclk_levels =
|
||||
clk_table->num_entries;
|
||||
dc->dml2_options.bbox_overrides.clks_table.num_entries_per_clk.num_socclk_levels =
|
||||
clk_table->num_entries;
|
||||
dc->dml2_options.bbox_overrides.clks_table.num_entries_per_clk.num_memclk_levels =
|
||||
clk_table->num_entries;
|
||||
}
|
||||
}
|
||||
|
||||
/* Update latency values */
|
||||
dc->dml2_options.bbox_overrides.dram_clock_change_latency_us = dcn3_5_soc.dram_clock_change_latency_us;
|
||||
|
||||
dc->dml2_options.bbox_overrides.sr_exit_latency_us = dcn3_5_soc.sr_exit_time_us;
|
||||
dc->dml2_options.bbox_overrides.sr_enter_plus_exit_latency_us = dcn3_5_soc.sr_enter_plus_exit_time_us;
|
||||
|
||||
dc->dml2_options.bbox_overrides.sr_exit_z8_time_us = dcn3_5_soc.sr_exit_z8_time_us;
|
||||
dc->dml2_options.bbox_overrides.sr_enter_plus_exit_z8_time_us = dcn3_5_soc.sr_enter_plus_exit_z8_time_us;
|
||||
}
|
||||
|
||||
static bool is_dual_plane(enum surface_pixel_format format)
|
||||
@ -507,3 +549,37 @@ int dcn35_populate_dml_pipes_from_context_fpu(struct dc *dc,
|
||||
|
||||
return pipe_cnt;
|
||||
}
|
||||
|
||||
void dcn35_decide_zstate_support(struct dc *dc, struct dc_state *context)
|
||||
{
|
||||
enum dcn_zstate_support_state support = DCN_ZSTATE_SUPPORT_DISALLOW;
|
||||
unsigned int i, plane_count = 0;
|
||||
|
||||
for (i = 0; i < dc->res_pool->pipe_count; i++) {
|
||||
if (context->res_ctx.pipe_ctx[i].plane_state)
|
||||
plane_count++;
|
||||
}
|
||||
|
||||
if (plane_count == 0) {
|
||||
support = DCN_ZSTATE_SUPPORT_ALLOW;
|
||||
} else if (plane_count == 1 && context->stream_count == 1 && context->streams[0]->signal == SIGNAL_TYPE_EDP) {
|
||||
struct dc_link *link = context->streams[0]->sink->link;
|
||||
bool is_pwrseq0 = link && link->link_index == 0;
|
||||
bool is_psr1 = link && link->psr_settings.psr_version == DC_PSR_VERSION_1 && !link->panel_config.psr.disable_psr;
|
||||
int minmum_z8_residency =
|
||||
dc->debug.minimum_z8_residency_time > 0 ? dc->debug.minimum_z8_residency_time : 1000;
|
||||
bool allow_z8 = context->bw_ctx.dml.vba.StutterPeriod > (double)minmum_z8_residency;
|
||||
int minmum_z10_residency =
|
||||
dc->debug.minimum_z10_residency_time > 0 ? dc->debug.minimum_z10_residency_time : 5000;
|
||||
bool allow_z10 = context->bw_ctx.dml.vba.StutterPeriod > (double)minmum_z10_residency;
|
||||
|
||||
if (is_pwrseq0 && allow_z10)
|
||||
support = DCN_ZSTATE_SUPPORT_ALLOW;
|
||||
else if (is_pwrseq0 && is_psr1)
|
||||
support = allow_z8 ? DCN_ZSTATE_SUPPORT_ALLOW_Z8_Z10_ONLY : DCN_ZSTATE_SUPPORT_ALLOW_Z10_ONLY;
|
||||
else if (allow_z8)
|
||||
support = DCN_ZSTATE_SUPPORT_ALLOW_Z8_ONLY;
|
||||
}
|
||||
|
||||
context->bw_ctx.bw.dcn.clk.zstate_support = support;
|
||||
}
|
||||
|
@ -39,4 +39,6 @@ int dcn35_populate_dml_pipes_from_context_fpu(struct dc *dc,
|
||||
display_e2e_pipe_params_st *pipes,
|
||||
bool fast_validate);
|
||||
|
||||
void dcn35_decide_zstate_support(struct dc *dc, struct dc_state *context);
|
||||
|
||||
#endif
|
||||
|
@ -6329,7 +6329,7 @@ static void dml_prefetch_check(struct display_mode_lib_st *mode_lib)
|
||||
mode_lib->ms.NoOfDPPThisState,
|
||||
mode_lib->ms.dpte_group_bytes,
|
||||
s->HostVMInefficiencyFactor,
|
||||
mode_lib->ms.soc.hostvm_min_page_size_kbytes,
|
||||
mode_lib->ms.soc.hostvm_min_page_size_kbytes * 1024,
|
||||
mode_lib->ms.cache_display_cfg.plane.HostVMMaxPageTableLevels);
|
||||
|
||||
s->NextMaxVStartup = s->MaxVStartupAllPlanes[j];
|
||||
@ -6542,7 +6542,7 @@ static void dml_prefetch_check(struct display_mode_lib_st *mode_lib)
|
||||
mode_lib->ms.cache_display_cfg.plane.HostVMEnable,
|
||||
mode_lib->ms.cache_display_cfg.plane.HostVMMaxPageTableLevels,
|
||||
mode_lib->ms.cache_display_cfg.plane.GPUVMEnable,
|
||||
mode_lib->ms.soc.hostvm_min_page_size_kbytes,
|
||||
mode_lib->ms.soc.hostvm_min_page_size_kbytes * 1024,
|
||||
mode_lib->ms.PDEAndMetaPTEBytesPerFrame[j][k],
|
||||
mode_lib->ms.MetaRowBytes[j][k],
|
||||
mode_lib->ms.DPTEBytesPerRow[j][k],
|
||||
@ -7687,7 +7687,7 @@ dml_bool_t dml_core_mode_support(struct display_mode_lib_st *mode_lib)
|
||||
CalculateVMRowAndSwath_params->HostVMMaxNonCachedPageTableLevels = mode_lib->ms.cache_display_cfg.plane.HostVMMaxPageTableLevels;
|
||||
CalculateVMRowAndSwath_params->GPUVMMaxPageTableLevels = mode_lib->ms.cache_display_cfg.plane.GPUVMMaxPageTableLevels;
|
||||
CalculateVMRowAndSwath_params->GPUVMMinPageSizeKBytes = mode_lib->ms.cache_display_cfg.plane.GPUVMMinPageSizeKBytes;
|
||||
CalculateVMRowAndSwath_params->HostVMMinPageSize = mode_lib->ms.soc.hostvm_min_page_size_kbytes;
|
||||
CalculateVMRowAndSwath_params->HostVMMinPageSize = mode_lib->ms.soc.hostvm_min_page_size_kbytes * 1024;
|
||||
CalculateVMRowAndSwath_params->PTEBufferModeOverrideEn = mode_lib->ms.cache_display_cfg.plane.PTEBufferModeOverrideEn;
|
||||
CalculateVMRowAndSwath_params->PTEBufferModeOverrideVal = mode_lib->ms.cache_display_cfg.plane.PTEBufferMode;
|
||||
CalculateVMRowAndSwath_params->PTEBufferSizeNotExceeded = mode_lib->ms.PTEBufferSizeNotExceededPerState;
|
||||
@ -7957,7 +7957,7 @@ dml_bool_t dml_core_mode_support(struct display_mode_lib_st *mode_lib)
|
||||
UseMinimumDCFCLK_params->GPUVMMaxPageTableLevels = mode_lib->ms.cache_display_cfg.plane.GPUVMMaxPageTableLevels;
|
||||
UseMinimumDCFCLK_params->HostVMEnable = mode_lib->ms.cache_display_cfg.plane.HostVMEnable;
|
||||
UseMinimumDCFCLK_params->NumberOfActiveSurfaces = mode_lib->ms.num_active_planes;
|
||||
UseMinimumDCFCLK_params->HostVMMinPageSize = mode_lib->ms.soc.hostvm_min_page_size_kbytes;
|
||||
UseMinimumDCFCLK_params->HostVMMinPageSize = mode_lib->ms.soc.hostvm_min_page_size_kbytes * 1024;
|
||||
UseMinimumDCFCLK_params->HostVMMaxNonCachedPageTableLevels = mode_lib->ms.cache_display_cfg.plane.HostVMMaxPageTableLevels;
|
||||
UseMinimumDCFCLK_params->DynamicMetadataVMEnabled = mode_lib->ms.ip.dynamic_metadata_vm_enabled;
|
||||
UseMinimumDCFCLK_params->ImmediateFlipRequirement = s->ImmediateFlipRequiredFinal;
|
||||
@ -8699,7 +8699,7 @@ void dml_core_mode_programming(struct display_mode_lib_st *mode_lib, const struc
|
||||
CalculateVMRowAndSwath_params->HostVMMaxNonCachedPageTableLevels = mode_lib->ms.cache_display_cfg.plane.HostVMMaxPageTableLevels;
|
||||
CalculateVMRowAndSwath_params->GPUVMMaxPageTableLevels = mode_lib->ms.cache_display_cfg.plane.GPUVMMaxPageTableLevels;
|
||||
CalculateVMRowAndSwath_params->GPUVMMinPageSizeKBytes = mode_lib->ms.cache_display_cfg.plane.GPUVMMinPageSizeKBytes;
|
||||
CalculateVMRowAndSwath_params->HostVMMinPageSize = mode_lib->ms.soc.hostvm_min_page_size_kbytes;
|
||||
CalculateVMRowAndSwath_params->HostVMMinPageSize = mode_lib->ms.soc.hostvm_min_page_size_kbytes * 1024;
|
||||
CalculateVMRowAndSwath_params->PTEBufferModeOverrideEn = mode_lib->ms.cache_display_cfg.plane.PTEBufferModeOverrideEn;
|
||||
CalculateVMRowAndSwath_params->PTEBufferModeOverrideVal = mode_lib->ms.cache_display_cfg.plane.PTEBufferMode;
|
||||
CalculateVMRowAndSwath_params->PTEBufferSizeNotExceeded = s->dummy_boolean_array[0];
|
||||
@ -8805,7 +8805,7 @@ void dml_core_mode_programming(struct display_mode_lib_st *mode_lib, const struc
|
||||
mode_lib->ms.cache_display_cfg.hw.DPPPerSurface,
|
||||
locals->dpte_group_bytes,
|
||||
s->HostVMInefficiencyFactor,
|
||||
mode_lib->ms.soc.hostvm_min_page_size_kbytes,
|
||||
mode_lib->ms.soc.hostvm_min_page_size_kbytes * 1024,
|
||||
mode_lib->ms.cache_display_cfg.plane.HostVMMaxPageTableLevels);
|
||||
|
||||
locals->TCalc = 24.0 / locals->DCFCLKDeepSleep;
|
||||
@ -8995,7 +8995,7 @@ void dml_core_mode_programming(struct display_mode_lib_st *mode_lib, const struc
|
||||
CalculatePrefetchSchedule_params->GPUVMEnable = mode_lib->ms.cache_display_cfg.plane.GPUVMEnable;
|
||||
CalculatePrefetchSchedule_params->HostVMEnable = mode_lib->ms.cache_display_cfg.plane.HostVMEnable;
|
||||
CalculatePrefetchSchedule_params->HostVMMaxNonCachedPageTableLevels = mode_lib->ms.cache_display_cfg.plane.HostVMMaxPageTableLevels;
|
||||
CalculatePrefetchSchedule_params->HostVMMinPageSize = mode_lib->ms.soc.hostvm_min_page_size_kbytes;
|
||||
CalculatePrefetchSchedule_params->HostVMMinPageSize = mode_lib->ms.soc.hostvm_min_page_size_kbytes * 1024;
|
||||
CalculatePrefetchSchedule_params->DynamicMetadataEnable = mode_lib->ms.cache_display_cfg.plane.DynamicMetadataEnable[k];
|
||||
CalculatePrefetchSchedule_params->DynamicMetadataVMEnabled = mode_lib->ms.ip.dynamic_metadata_vm_enabled;
|
||||
CalculatePrefetchSchedule_params->DynamicMetadataLinesBeforeActiveRequired = mode_lib->ms.cache_display_cfg.plane.DynamicMetadataLinesBeforeActiveRequired[k];
|
||||
@ -9240,7 +9240,7 @@ void dml_core_mode_programming(struct display_mode_lib_st *mode_lib, const struc
|
||||
mode_lib->ms.cache_display_cfg.plane.HostVMEnable,
|
||||
mode_lib->ms.cache_display_cfg.plane.HostVMMaxPageTableLevels,
|
||||
mode_lib->ms.cache_display_cfg.plane.GPUVMEnable,
|
||||
mode_lib->ms.soc.hostvm_min_page_size_kbytes,
|
||||
mode_lib->ms.soc.hostvm_min_page_size_kbytes * 1024,
|
||||
locals->PDEAndMetaPTEBytesFrame[k],
|
||||
locals->MetaRowByte[k],
|
||||
locals->PixelPTEBytesPerRow[k],
|
||||
|
@ -341,25 +341,42 @@ void dml2_init_soc_states(struct dml2_context *dml2, const struct dc *in_dc,
|
||||
break;
|
||||
}
|
||||
|
||||
/* Override from passed values, mainly for debugging purposes, if available */
|
||||
if (dml2->config.bbox_overrides.sr_exit_latency_us) {
|
||||
p->in_states->state_array[0].sr_exit_time_us = dml2->config.bbox_overrides.sr_exit_latency_us;
|
||||
}
|
||||
/* Override from passed values, if available */
|
||||
for (i = 0; i < p->in_states->num_states; i++) {
|
||||
if (dml2->config.bbox_overrides.sr_exit_latency_us) {
|
||||
p->in_states->state_array[i].sr_exit_time_us =
|
||||
dml2->config.bbox_overrides.sr_exit_latency_us;
|
||||
}
|
||||
|
||||
if (dml2->config.bbox_overrides.sr_enter_plus_exit_latency_us) {
|
||||
p->in_states->state_array[0].sr_enter_plus_exit_time_us = dml2->config.bbox_overrides.sr_enter_plus_exit_latency_us;
|
||||
}
|
||||
if (dml2->config.bbox_overrides.sr_enter_plus_exit_latency_us) {
|
||||
p->in_states->state_array[i].sr_enter_plus_exit_time_us =
|
||||
dml2->config.bbox_overrides.sr_enter_plus_exit_latency_us;
|
||||
}
|
||||
|
||||
if (dml2->config.bbox_overrides.urgent_latency_us) {
|
||||
p->in_states->state_array[0].urgent_latency_pixel_data_only_us = dml2->config.bbox_overrides.urgent_latency_us;
|
||||
}
|
||||
if (dml2->config.bbox_overrides.sr_exit_z8_time_us) {
|
||||
p->in_states->state_array[i].sr_exit_z8_time_us =
|
||||
dml2->config.bbox_overrides.sr_exit_z8_time_us;
|
||||
}
|
||||
|
||||
if (dml2->config.bbox_overrides.dram_clock_change_latency_us) {
|
||||
p->in_states->state_array[0].dram_clock_change_latency_us = dml2->config.bbox_overrides.dram_clock_change_latency_us;
|
||||
}
|
||||
if (dml2->config.bbox_overrides.sr_enter_plus_exit_z8_time_us) {
|
||||
p->in_states->state_array[i].sr_enter_plus_exit_z8_time_us =
|
||||
dml2->config.bbox_overrides.sr_enter_plus_exit_z8_time_us;
|
||||
}
|
||||
|
||||
if (dml2->config.bbox_overrides.fclk_change_latency_us) {
|
||||
p->in_states->state_array[0].fclk_change_latency_us = dml2->config.bbox_overrides.fclk_change_latency_us;
|
||||
if (dml2->config.bbox_overrides.urgent_latency_us) {
|
||||
p->in_states->state_array[i].urgent_latency_pixel_data_only_us =
|
||||
dml2->config.bbox_overrides.urgent_latency_us;
|
||||
}
|
||||
|
||||
if (dml2->config.bbox_overrides.dram_clock_change_latency_us) {
|
||||
p->in_states->state_array[i].dram_clock_change_latency_us =
|
||||
dml2->config.bbox_overrides.dram_clock_change_latency_us;
|
||||
}
|
||||
|
||||
if (dml2->config.bbox_overrides.fclk_change_latency_us) {
|
||||
p->in_states->state_array[i].fclk_change_latency_us =
|
||||
dml2->config.bbox_overrides.fclk_change_latency_us;
|
||||
}
|
||||
}
|
||||
|
||||
/* DCFCLK stas values are project specific */
|
||||
@ -498,8 +515,8 @@ void dml2_translate_socbb_params(const struct dc *in, struct soc_bounding_box_st
|
||||
out->do_urgent_latency_adjustment = in_soc_params->do_urgent_latency_adjustment;
|
||||
out->dram_channel_width_bytes = (dml_uint_t)in_soc_params->dram_channel_width_bytes;
|
||||
out->fabric_datapath_to_dcn_data_return_bytes = (dml_uint_t)in_soc_params->fabric_datapath_to_dcn_data_return_bytes;
|
||||
out->gpuvm_min_page_size_kbytes = in_soc_params->gpuvm_min_page_size_bytes * 1024;
|
||||
out->hostvm_min_page_size_kbytes = in_soc_params->hostvm_min_page_size_bytes * 1024;
|
||||
out->gpuvm_min_page_size_kbytes = in_soc_params->gpuvm_min_page_size_bytes / 1024;
|
||||
out->hostvm_min_page_size_kbytes = in_soc_params->hostvm_min_page_size_bytes / 1024;
|
||||
out->mall_allocated_for_dcn_mbytes = (dml_uint_t)in_soc_params->mall_allocated_for_dcn_mbytes;
|
||||
out->max_avg_dram_bw_use_normal_percent = in_soc_params->max_avg_dram_bw_use_normal_percent;
|
||||
out->max_avg_fabric_bw_use_normal_percent = in_soc_params->max_avg_fabric_bw_use_normal_percent;
|
||||
@ -1040,9 +1057,12 @@ void map_dc_state_into_dml_display_cfg(struct dml2_context *dml2, struct dc_stat
|
||||
}
|
||||
|
||||
//Generally these are set by referencing our latest BB/IP params in dcn32_resource.c file
|
||||
dml_dispcfg->plane.GPUVMEnable = true;
|
||||
dml_dispcfg->plane.GPUVMMaxPageTableLevels = 4;
|
||||
dml_dispcfg->plane.HostVMEnable = false;
|
||||
dml_dispcfg->plane.GPUVMEnable = dml2->v20.dml_core_ctx.ip.gpuvm_enable;
|
||||
dml_dispcfg->plane.GPUVMMaxPageTableLevels = dml2->v20.dml_core_ctx.ip.gpuvm_max_page_table_levels;
|
||||
dml_dispcfg->plane.HostVMEnable = dml2->v20.dml_core_ctx.ip.hostvm_enable;
|
||||
dml_dispcfg->plane.HostVMMaxPageTableLevels = dml2->v20.dml_core_ctx.ip.hostvm_max_page_table_levels;
|
||||
if (dml2->v20.dml_core_ctx.ip.hostvm_enable)
|
||||
dml2->v20.dml_core_ctx.policy.AllowForPStateChangeOrStutterInVBlankFinal = dml_prefetch_support_uclk_fclk_and_stutter;
|
||||
|
||||
dml2_populate_pipe_to_plane_index_mapping(dml2, context);
|
||||
|
||||
|
@ -139,6 +139,8 @@ struct dml2_soc_bbox_overrides {
|
||||
double urgent_latency_us;
|
||||
double sr_exit_latency_us;
|
||||
double sr_enter_plus_exit_latency_us;
|
||||
double sr_exit_z8_time_us;
|
||||
double sr_enter_plus_exit_z8_time_us;
|
||||
double dram_clock_change_latency_us;
|
||||
double fclk_change_latency_us;
|
||||
unsigned int dram_num_chan;
|
||||
|
@ -487,8 +487,7 @@ bool dcn32_set_mcm_luts(
|
||||
if (plane_state->blend_tf->type == TF_TYPE_HWPWL)
|
||||
lut_params = &plane_state->blend_tf->pwl;
|
||||
else if (plane_state->blend_tf->type == TF_TYPE_DISTRIBUTED_POINTS) {
|
||||
cm_helper_translate_curve_to_hw_format(plane_state->ctx,
|
||||
plane_state->blend_tf,
|
||||
cm3_helper_translate_curve_to_hw_format(plane_state->blend_tf,
|
||||
&dpp_base->regamma_params, false);
|
||||
lut_params = &dpp_base->regamma_params;
|
||||
}
|
||||
@ -503,8 +502,7 @@ bool dcn32_set_mcm_luts(
|
||||
else if (plane_state->in_shaper_func->type == TF_TYPE_DISTRIBUTED_POINTS) {
|
||||
// TODO: dpp_base replace
|
||||
ASSERT(false);
|
||||
cm_helper_translate_curve_to_hw_format(plane_state->ctx,
|
||||
plane_state->in_shaper_func,
|
||||
cm3_helper_translate_curve_to_hw_format(plane_state->in_shaper_func,
|
||||
&dpp_base->shaper_params, true);
|
||||
lut_params = &dpp_base->shaper_params;
|
||||
}
|
||||
|
@ -879,7 +879,7 @@ static bool detect_link_and_local_sink(struct dc_link *link,
|
||||
(link->dpcd_sink_ext_caps.bits.oled == 1)) {
|
||||
dpcd_set_source_specific_data(link);
|
||||
msleep(post_oui_delay);
|
||||
set_cached_brightness_aux(link);
|
||||
set_default_brightness_aux(link);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -2142,8 +2142,7 @@ static enum dc_status enable_link_dp(struct dc_state *state,
|
||||
if (link->dpcd_sink_ext_caps.bits.oled == 1 ||
|
||||
link->dpcd_sink_ext_caps.bits.sdr_aux_backlight_control == 1 ||
|
||||
link->dpcd_sink_ext_caps.bits.hdr_aux_backlight_control == 1) {
|
||||
set_cached_brightness_aux(link);
|
||||
|
||||
set_default_brightness_aux(link);
|
||||
if (link->dpcd_sink_ext_caps.bits.oled == 1)
|
||||
msleep(bl_oled_enable_delay);
|
||||
edp_backlight_enable_aux(link, true);
|
||||
|
@ -115,7 +115,7 @@ static enum link_training_result perform_fixed_vs_pe_nontransparent_training_seq
|
||||
lt_settings->cr_pattern_time = 16000;
|
||||
|
||||
/* Fixed VS/PE specific: Toggle link rate */
|
||||
apply_toggle_rate_wa = (link->vendor_specific_lttpr_link_rate_wa == target_rate);
|
||||
apply_toggle_rate_wa = ((link->vendor_specific_lttpr_link_rate_wa == target_rate) || (link->vendor_specific_lttpr_link_rate_wa == 0));
|
||||
target_rate = get_dpcd_link_rate(<_settings->link_settings);
|
||||
toggle_rate = (target_rate == 0x6) ? 0xA : 0x6;
|
||||
|
||||
@ -271,7 +271,7 @@ enum link_training_result dp_perform_fixed_vs_pe_training_sequence_legacy(
|
||||
/* Vendor specific: Toggle link rate */
|
||||
toggle_rate = (rate == 0x6) ? 0xA : 0x6;
|
||||
|
||||
if (link->vendor_specific_lttpr_link_rate_wa == rate) {
|
||||
if (link->vendor_specific_lttpr_link_rate_wa == rate || link->vendor_specific_lttpr_link_rate_wa == 0) {
|
||||
core_link_write_dpcd(
|
||||
link,
|
||||
DP_LINK_BW_SET,
|
||||
@ -617,7 +617,7 @@ enum link_training_result dp_perform_fixed_vs_pe_training_sequence(
|
||||
/* Vendor specific: Toggle link rate */
|
||||
toggle_rate = (rate == 0x6) ? 0xA : 0x6;
|
||||
|
||||
if (link->vendor_specific_lttpr_link_rate_wa == rate) {
|
||||
if (link->vendor_specific_lttpr_link_rate_wa == rate || link->vendor_specific_lttpr_link_rate_wa == 0) {
|
||||
core_link_write_dpcd(
|
||||
link,
|
||||
DP_LINK_BW_SET,
|
||||
|
@ -170,7 +170,6 @@ bool edp_set_backlight_level_nits(struct dc_link *link,
|
||||
*(uint32_t *)&dpcd_backlight_set.backlight_level_millinits = backlight_millinits;
|
||||
*(uint16_t *)&dpcd_backlight_set.backlight_transition_time_ms = (uint16_t)transition_time_in_ms;
|
||||
|
||||
link->backlight_settings.backlight_millinits = backlight_millinits;
|
||||
|
||||
if (!link->dpcd_caps.panel_luminance_control) {
|
||||
if (core_link_write_dpcd(link, DP_SOURCE_BACKLIGHT_LEVEL,
|
||||
@ -288,9 +287,9 @@ bool set_default_brightness_aux(struct dc_link *link)
|
||||
if (link && link->dpcd_sink_ext_caps.bits.oled == 1) {
|
||||
if (!read_default_bl_aux(link, &default_backlight))
|
||||
default_backlight = 150000;
|
||||
// if < 1 nits or > 5000, it might be wrong readback
|
||||
if (default_backlight < 1000 || default_backlight > 5000000)
|
||||
default_backlight = 150000; //
|
||||
// if > 5000, it might be wrong readback
|
||||
if (default_backlight > 5000000)
|
||||
default_backlight = 150000;
|
||||
|
||||
return edp_set_backlight_level_nits(link, true,
|
||||
default_backlight, 0);
|
||||
@ -298,15 +297,6 @@ bool set_default_brightness_aux(struct dc_link *link)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool set_cached_brightness_aux(struct dc_link *link)
|
||||
{
|
||||
if (link->backlight_settings.backlight_millinits)
|
||||
return edp_set_backlight_level_nits(link, true,
|
||||
link->backlight_settings.backlight_millinits, 0);
|
||||
else
|
||||
return set_default_brightness_aux(link);
|
||||
return false;
|
||||
}
|
||||
bool edp_is_ilr_optimization_enabled(struct dc_link *link)
|
||||
{
|
||||
if (link->dpcd_caps.edp_supported_link_rates_count == 0 || !link->panel_config.ilr.optimize_edp_link_rate)
|
||||
|
@ -30,7 +30,6 @@
|
||||
enum dp_panel_mode dp_get_panel_mode(struct dc_link *link);
|
||||
void dp_set_panel_mode(struct dc_link *link, enum dp_panel_mode panel_mode);
|
||||
bool set_default_brightness_aux(struct dc_link *link);
|
||||
bool set_cached_brightness_aux(struct dc_link *link);
|
||||
void edp_panel_backlight_power_on(struct dc_link *link, bool wait_for_hpd);
|
||||
int edp_get_backlight_level(const struct dc_link *link);
|
||||
bool edp_get_backlight_level_nits(struct dc_link *link,
|
||||
|
@ -1077,6 +1077,7 @@ enum dmub_status dmub_srv_wait_for_inbox0_ack(struct dmub_srv *dmub, uint32_t ti
|
||||
ack = dmub->hw_funcs.read_inbox0_ack_register(dmub);
|
||||
if (ack)
|
||||
return DMUB_STATUS_OK;
|
||||
udelay(1);
|
||||
}
|
||||
return DMUB_STATUS_TIMEOUT;
|
||||
}
|
||||
|
@ -6369,6 +6369,8 @@
|
||||
#define regTCP_INVALIDATE_BASE_IDX 1
|
||||
#define regTCP_STATUS 0x19a1
|
||||
#define regTCP_STATUS_BASE_IDX 1
|
||||
#define regTCP_CNTL 0x19a2
|
||||
#define regTCP_CNTL_BASE_IDX 1
|
||||
#define regTCP_CNTL2 0x19a3
|
||||
#define regTCP_CNTL2_BASE_IDX 1
|
||||
#define regTCP_DEBUG_INDEX 0x19a5
|
||||
|
@ -781,6 +781,8 @@
|
||||
#define regBIF_BIF256_CI256_RC3X4_USB4_PCIE_CNTL2_BASE_IDX 5
|
||||
#define regBIF_BIF256_CI256_RC3X4_USB4_PCIE_TX_POWER_CTRL_1 0x420187
|
||||
#define regBIF_BIF256_CI256_RC3X4_USB4_PCIE_TX_POWER_CTRL_1_BASE_IDX 5
|
||||
#define regBIF_BIF256_CI256_RC3X4_USB4_PCIE_MST_CTRL_3 0x4201c6
|
||||
#define regBIF_BIF256_CI256_RC3X4_USB4_PCIE_MST_CTRL_3_BASE_IDX 5
|
||||
|
||||
|
||||
// addressBlock: nbio_nbif0_bif_cfg_dev0_rc_bifcfgdecp
|
||||
|
@ -24646,6 +24646,35 @@
|
||||
//BIF_BIF256_CI256_RC3X4_USB4_PCIE_TX_POWER_CTRL_1
|
||||
#define BIF_BIF256_CI256_RC3X4_USB4_PCIE_TX_POWER_CTRL_1__MST_MEM_LS_EN_MASK 0x00000001L
|
||||
#define BIF_BIF256_CI256_RC3X4_USB4_PCIE_TX_POWER_CTRL_1__REPLAY_MEM_LS_EN_MASK 0x00000008L
|
||||
//BIF_BIF256_CI256_RC3X4_USB4_PCIE_MST_CTRL_3
|
||||
#define BIF_BIF256_CI256_RC3X4_USB4_PCIE_MST_CTRL_3__CI_SWUS_MAX_PAYLOAD_SIZE_MODE__SHIFT 0x8
|
||||
#define BIF_BIF256_CI256_RC3X4_USB4_PCIE_MST_CTRL_3__CI_SWUS_PRIV_MAX_PAYLOAD_SIZE__SHIFT 0x9
|
||||
#define BIF_BIF256_CI256_RC3X4_USB4_PCIE_MST_CTRL_3__CI_10BIT_TAG_EN_OVERRIDE__SHIFT 0xb
|
||||
#define BIF_BIF256_CI256_RC3X4_USB4_PCIE_MST_CTRL_3__CI_SWUS_10BIT_TAG_EN_OVERRIDE__SHIFT 0xd
|
||||
#define BIF_BIF256_CI256_RC3X4_USB4_PCIE_MST_CTRL_3__MST_DROP_SYNC_FLOOD_EN__SHIFT 0xf
|
||||
#define BIF_BIF256_CI256_RC3X4_USB4_PCIE_MST_CTRL_3__CI_MAX_PAYLOAD_SIZE_MODE__SHIFT 0x10
|
||||
#define BIF_BIF256_CI256_RC3X4_USB4_PCIE_MST_CTRL_3__CI_PRIV_MAX_PAYLOAD_SIZE__SHIFT 0x11
|
||||
#define BIF_BIF256_CI256_RC3X4_USB4_PCIE_MST_CTRL_3__CI_MAX_READ_REQUEST_SIZE_MODE__SHIFT 0x14
|
||||
#define BIF_BIF256_CI256_RC3X4_USB4_PCIE_MST_CTRL_3__CI_PRIV_MAX_READ_REQUEST_SIZE__SHIFT 0x15
|
||||
#define BIF_BIF256_CI256_RC3X4_USB4_PCIE_MST_CTRL_3__CI_MAX_READ_SAFE_MODE__SHIFT 0x18
|
||||
#define BIF_BIF256_CI256_RC3X4_USB4_PCIE_MST_CTRL_3__CI_EXTENDED_TAG_EN_OVERRIDE__SHIFT 0x19
|
||||
#define BIF_BIF256_CI256_RC3X4_USB4_PCIE_MST_CTRL_3__CI_SWUS_MAX_READ_REQUEST_SIZE_MODE__SHIFT 0x1b
|
||||
#define BIF_BIF256_CI256_RC3X4_USB4_PCIE_MST_CTRL_3__CI_SWUS_MAX_READ_REQUEST_SIZE_PRIV__SHIFT 0x1c
|
||||
#define BIF_BIF256_CI256_RC3X4_USB4_PCIE_MST_CTRL_3__CI_SWUS_EXTENDED_TAG_EN_OVERRIDE__SHIFT 0x1e
|
||||
#define BIF_BIF256_CI256_RC3X4_USB4_PCIE_MST_CTRL_3__CI_SWUS_MAX_PAYLOAD_SIZE_MODE_MASK 0x00000100L
|
||||
#define BIF_BIF256_CI256_RC3X4_USB4_PCIE_MST_CTRL_3__CI_SWUS_PRIV_MAX_PAYLOAD_SIZE_MASK 0x00000600L
|
||||
#define BIF_BIF256_CI256_RC3X4_USB4_PCIE_MST_CTRL_3__CI_10BIT_TAG_EN_OVERRIDE_MASK 0x00001800L
|
||||
#define BIF_BIF256_CI256_RC3X4_USB4_PCIE_MST_CTRL_3__CI_SWUS_10BIT_TAG_EN_OVERRIDE_MASK 0x00006000L
|
||||
#define BIF_BIF256_CI256_RC3X4_USB4_PCIE_MST_CTRL_3__MST_DROP_SYNC_FLOOD_EN_MASK 0x00008000L
|
||||
#define BIF_BIF256_CI256_RC3X4_USB4_PCIE_MST_CTRL_3__CI_MAX_PAYLOAD_SIZE_MODE_MASK 0x00010000L
|
||||
#define BIF_BIF256_CI256_RC3X4_USB4_PCIE_MST_CTRL_3__CI_PRIV_MAX_PAYLOAD_SIZE_MASK 0x000E0000L
|
||||
#define BIF_BIF256_CI256_RC3X4_USB4_PCIE_MST_CTRL_3__CI_MAX_READ_REQUEST_SIZE_MODE_MASK 0x00100000L
|
||||
#define BIF_BIF256_CI256_RC3X4_USB4_PCIE_MST_CTRL_3__CI_PRIV_MAX_READ_REQUEST_SIZE_MASK 0x00E00000L
|
||||
#define BIF_BIF256_CI256_RC3X4_USB4_PCIE_MST_CTRL_3__CI_MAX_READ_SAFE_MODE_MASK 0x01000000L
|
||||
#define BIF_BIF256_CI256_RC3X4_USB4_PCIE_MST_CTRL_3__CI_EXTENDED_TAG_EN_OVERRIDE_MASK 0x06000000L
|
||||
#define BIF_BIF256_CI256_RC3X4_USB4_PCIE_MST_CTRL_3__CI_SWUS_MAX_READ_REQUEST_SIZE_MODE_MASK 0x08000000L
|
||||
#define BIF_BIF256_CI256_RC3X4_USB4_PCIE_MST_CTRL_3__CI_SWUS_MAX_READ_REQUEST_SIZE_PRIV_MASK 0x30000000L
|
||||
#define BIF_BIF256_CI256_RC3X4_USB4_PCIE_MST_CTRL_3__CI_SWUS_EXTENDED_TAG_EN_OVERRIDE_MASK 0xC0000000L
|
||||
|
||||
// addressBlock: nbio_nbif0_bif_cfg_dev0_rc_bifcfgdecp
|
||||
//BIF_CFG_DEV0_RC0_VENDOR_ID
|
||||
|
@ -444,6 +444,7 @@ struct amd_pm_funcs {
|
||||
struct dpm_clocks *clock_table);
|
||||
int (*get_smu_prv_buf_details)(void *handle, void **addr, size_t *size);
|
||||
void (*pm_compute_clocks)(void *handle);
|
||||
int (*notify_rlc_state)(void *handle, bool en);
|
||||
};
|
||||
|
||||
struct metrics_table_header {
|
||||
|
@ -181,6 +181,24 @@ int amdgpu_dpm_set_mp1_state(struct amdgpu_device *adev,
|
||||
return ret;
|
||||
}
|
||||
|
||||
int amdgpu_dpm_notify_rlc_state(struct amdgpu_device *adev, bool en)
|
||||
{
|
||||
int ret = 0;
|
||||
const struct amd_pm_funcs *pp_funcs = adev->powerplay.pp_funcs;
|
||||
|
||||
if (pp_funcs && pp_funcs->notify_rlc_state) {
|
||||
mutex_lock(&adev->pm.mutex);
|
||||
|
||||
ret = pp_funcs->notify_rlc_state(
|
||||
adev->powerplay.pp_handle,
|
||||
en);
|
||||
|
||||
mutex_unlock(&adev->pm.mutex);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool amdgpu_dpm_is_baco_supported(struct amdgpu_device *adev)
|
||||
{
|
||||
const struct amd_pm_funcs *pp_funcs = adev->powerplay.pp_funcs;
|
||||
|
@ -415,6 +415,8 @@ int amdgpu_dpm_mode1_reset(struct amdgpu_device *adev);
|
||||
int amdgpu_dpm_set_mp1_state(struct amdgpu_device *adev,
|
||||
enum pp_mp1_state mp1_state);
|
||||
|
||||
int amdgpu_dpm_notify_rlc_state(struct amdgpu_device *adev, bool en);
|
||||
|
||||
int amdgpu_dpm_set_gfx_power_up_by_imu(struct amdgpu_device *adev);
|
||||
|
||||
int amdgpu_dpm_baco_exit(struct amdgpu_device *adev);
|
||||
|
@ -1710,6 +1710,16 @@ static int smu_disable_dpms(struct smu_context *smu)
|
||||
}
|
||||
}
|
||||
|
||||
/* Notify SMU RLC is going to be off, stop RLC and SMU interaction.
|
||||
* otherwise SMU will hang while interacting with RLC if RLC is halted
|
||||
* this is a WA for Vangogh asic which fix the SMU hang issue.
|
||||
*/
|
||||
ret = smu_notify_rlc_state(smu, false);
|
||||
if (ret) {
|
||||
dev_err(adev->dev, "Fail to notify rlc status!\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (amdgpu_ip_version(adev, GC_HWIP, 0) >= IP_VERSION(9, 4, 2) &&
|
||||
!((adev->flags & AMD_IS_APU) && adev->gfx.imu.funcs) &&
|
||||
!amdgpu_sriov_vf(adev) && adev->gfx.rlc.funcs->stop)
|
||||
|
@ -1360,6 +1360,11 @@ struct pptable_funcs {
|
||||
* management.
|
||||
*/
|
||||
int (*dpm_set_umsch_mm_enable)(struct smu_context *smu, bool enable);
|
||||
|
||||
/**
|
||||
* @notify_rlc_state: Notify RLC power state to SMU.
|
||||
*/
|
||||
int (*notify_rlc_state)(struct smu_context *smu, bool en);
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user