Lenovo IdeaPad S540 13ARE

From ArchWiki
Jump to navigation Jump to search

The Lenovo Ideapad S540-13ARE is a laptop introduced in Mid-2020. It features a 13" QHD screen, AMD Ryzen 4000 processors (Renoir), and integrated AMD Vega graphics. It uses the name Xiaoxin Pro 13 2020 in some markets.

Component Functioning
Microcode Yes
AMDGPU Yes
Wireless Yes
Bluetooth Yes
Webcam Yes
Screen Brightness Yes
Keyboard backlight Yes
Touchpad Yes
Audio Yes

Processors

The Lenovo Ideapad S540-13ARE contains an AMD Ryzen APU. You can retrieve the precise models as follows:

$ lscpu | awk -F ": *" '/Model name/{print $NF}'
AMD Ryzen 7 4800U with Radeon Graphics
$ lspci | awk -F ": *" '/VGA compatible controller/{print $NF}'
Advanced Micro Devices, Inc. [AMD/ATI] Renoir (rev c1)

CPU

It is strongly recommended to enable proprietary microcode updates, see Ryzen and Microcode for details. Successful enabling of microcode updates can be verified as follows:

$ dmesg | grep microcode
[    2.376363] microcode: CPU0: patch_level=0x08600103
[    2.376367] microcode: CPU1: patch_level=0x08600103
[    2.376395] microcode: CPU2: patch_level=0x08600103
[    2.376422] microcode: CPU3: patch_level=0x08600103
[    2.376425] microcode: CPU4: patch_level=0x08600103
[    2.376436] microcode: CPU5: patch_level=0x08600103
[    2.376459] microcode: CPU6: patch_level=0x08600103
[    2.376480] microcode: CPU7: patch_level=0x08600103
[    2.376520] microcode: CPU8: patch_level=0x08600103
[    2.376534] microcode: CPU9: patch_level=0x08600103
[    2.376573] microcode: CPU10: patch_level=0x08600103
[    2.376598] microcode: CPU11: patch_level=0x08600103
[    2.376640] microcode: CPU12: patch_level=0x08600103
[    2.376655] microcode: CPU13: patch_level=0x08600103
[    2.376698] microcode: CPU14: patch_level=0x08600103
[    2.376721] microcode: CPU15: patch_level=0x08600103
[    2.376821] microcode: Microcode Update Driver: v2.2.

Example raw output of lscpu:

$ lscpu
Architecture:                    x86_64
CPU op-mode(s):                  32-bit, 64-bit
Byte Order:                      Little Endian
Address sizes:                   48 bits physical, 48 bits virtual
CPU(s):                          16
On-line CPU(s) list:             0-15
Thread(s) per core:              2
Core(s) per socket:              8
Socket(s):                       1
NUMA node(s):                    1
Vendor ID:                       AuthenticAMD
CPU family:                      23
Model:                           96
Model name:                      AMD Ryzen 7 4800U with Radeon Graphics
Stepping:                        1
Frequency boost:                 enabled
CPU MHz:                         1668.417
CPU max MHz:                     1800.0000
CPU min MHz:                     1400.0000
BogoMIPS:                        3593.36
Virtualization:                  AMD-V
L1d cache:                       256 KiB
L1i cache:                       256 KiB
L2 cache:                        4 MiB
L3 cache:                        8 MiB
NUMA node0 CPU(s):               0-15
Vulnerability Itlb multihit:     Not affected
Vulnerability L1tf:              Not affected
Vulnerability Mds:               Not affected
Vulnerability Meltdown:          Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1:        Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:        Mitigation; Full AMD retpoline, IBPB conditional, IBRS_FW, STIBP conditiona
                                 l, RSB filling
Vulnerability Srbds:             Not affected
Vulnerability Tsx async abort:   Not affected
Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clf
                                 lush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm cons
                                 tant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulq
                                 dq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdr
                                 and lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowpr
                                 efetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfct
                                 r_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba ibrs ibpb stibp vmmcall f
                                 sgsbase bmi1 avx2 smep bmi2 cqm rdt_a rdseed adx smap clflushopt clwb sha_n
                                 i xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mb
                                 m_local clzero irperf xsaveerptr rdpru wbnoinvd arat npt lbrv svm_lock nrip
                                 _save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshol
                                 d avic v_vmsave_vmload vgif umip rdpid overflow_recov succor smca

GPU

Specification

Follow the instructions at AMDGPU#Installation and Hardware video acceleration#ATI/AMD. If you installed the package libva-utils, you can verify that hardware video acceleration is enabled as follows:

$ vainfo
vainfo: VA-API version: 1.7 (libva 2.7.1)
vainfo: Driver version: Mesa Gallium driver 20.1.1 for AMD RENOIR (DRM 3.37.0, 5.7.2-zen1-1-zen, LLVM 10.0.0)
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointEncSlice
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc

Example raw output of glxinfo:

$ glxinfo -B
name of display: :0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: X.Org (0x1002)
    Device: AMD RENOIR (DRM 3.37.0, 5.7.2-zen1-1-zen, LLVM 10.0.0) (0x1636)
    Version: 20.1.1
    Accelerated: yes
    Video memory: 512MB
    Unified memory: no
    Preferred profile: core (0x1)
    Max core profile version: 4.6
    Max compat profile version: 4.6
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.2
Memory info (GL_ATI_meminfo):
    VBO free memory - total: 4 MB, largest block: 4 MB
    VBO free aux. memory - total: 2165 MB, largest block: 2165 MB
    Texture free memory - total: 4 MB, largest block: 4 MB
    Texture free aux. memory - total: 2165 MB, largest block: 2165 MB
    Renderbuffer free memory - total: 4 MB, largest block: 4 MB
    Renderbuffer free aux. memory - total: 2165 MB, largest block: 2165 MB
Memory info (GL_NVX_gpu_memory_info):
    Dedicated video memory: 512 MB
    Total available memory: 3584 MB
    Currently available dedicated video memory: 4 MB
OpenGL vendor string: X.Org
OpenGL renderer string: AMD RENOIR (DRM 3.37.0, 5.7.2-zen1-1-zen, LLVM 10.0.0)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 20.1.1
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 4.6 (Compatibility Profile) Mesa 20.1.1
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile

OpenGL ES profile version string: OpenGL ES 3.2 Mesa 20.1.1
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

Display driver issues

System sudden freezes

Some vega-graphics powered devices, including this one, are suffering from a series of critical random crash issues of AMDGPU kernel driver, which probably leads to a sudden freeze of the whole system.

You can refer to this bug report from Arch bug tracker, this bug report and this bug report from upstream for further information.

It works *almost* fine for kernel 5.7.12 and newer, expect some infrequent regression though.

Screen brightness out of control

Backlight control in AMDGPU kernel driver was borked in the first few versions of kernel 5.7.

It works fine for kernel 5.7.6 and newer.

Input devices and buttons

The raw list of input devices can be checked as follows:

$ xinput list
⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ MSFT0001:00 04F3:3138 Mouse               id=16   [slave  pointer  (2)]
⎜   ↳ MSFT0001:00 04F3:3138 Touchpad            id=17   [slave  pointer  (2)]
⎣ Virtual core keyboard                         id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Video Bus                                 id=7    [slave  keyboard (3)]
    ↳ Power Button                              id=8    [slave  keyboard (3)]
    ↳ Integrated Camera: Integrated C           id=13   [slave  keyboard (3)]
    ↳ Integrated Camera: Integrated I           id=14   [slave  keyboard (3)]
    ↳ Ideapad extra buttons                     id=15   [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=18   [slave  keyboard (3)]

Keyboard

Works out-of-the-box. The keys are correctly mapped by default and keyboard backlight works as intended.

Touchpad

Works out-of-the-box.

Webcam

Works out-of-the-box.

Power button

Works out-of-the-box.

Network and connectivity

Wireless controller

The wireless controller works out-of-the-box, see Network configuration/Wireless for details.

$ lspci | awk -F ": *" '/Network controller/{print $NF}'
Realtek Semiconductor Co., Ltd. RTL8822CE 802.11ac PCIe Wireless Network Adapter

Bluetooth controller

Works out-of-the-box, see Bluetooth for details.

$ lsusb
...
Bus 001 Device 003: ID 0bda:c123 Realtek Semiconductor Corp. Bluetooth Radio 
...

Audio

Works out-of-the-box, see Sound system for details.

$ lspci | grep Audio | awk -F ": *" '{$1=$2="";print $0}'
Advanced Micro Devices, Inc. [AMD/ATI] Device 1637
Advanced Micro Devices, Inc. [AMD] Raven/Raven2/FireFlight/Renoir Audio Processor (rev 01)
Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh) HD Audio Controller

Storage

$ lspci | awk -F ": *" '/Non-Volatile memory controller/{$1=$2="";print $0}'
Samsung Electronics Co Ltd NVMe SSD Controller SM981/PM981/PM983

Raw list(s) of hardware components

$ lspci
00:00.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Renoir Root Complex
00:00.2 IOMMU: Advanced Micro Devices, Inc. [AMD] Renoir IOMMU
00:01.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Renoir PCIe Dummy Host Bridge
00:02.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Renoir PCIe Dummy Host Bridge
00:02.2 PCI bridge: Advanced Micro Devices, Inc. [AMD] Renoir PCIe GPP Bridge
00:02.4 PCI bridge: Advanced Micro Devices, Inc. [AMD] Renoir PCIe GPP Bridge
00:08.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Renoir PCIe Dummy Host Bridge
00:08.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] Renoir Internal PCIe GPP Bridge to Bus
00:14.0 SMBus: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller (rev 51)
00:14.3 ISA bridge: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge (rev 51)
00:18.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Renoir Device 24: Function 0
00:18.1 Host bridge: Advanced Micro Devices, Inc. [AMD] Renoir Device 24: Function 1
00:18.2 Host bridge: Advanced Micro Devices, Inc. [AMD] Renoir Device 24: Function 2
00:18.3 Host bridge: Advanced Micro Devices, Inc. [AMD] Renoir Device 24: Function 3
00:18.4 Host bridge: Advanced Micro Devices, Inc. [AMD] Renoir Device 24: Function 4
00:18.5 Host bridge: Advanced Micro Devices, Inc. [AMD] Renoir Device 24: Function 5
00:18.6 Host bridge: Advanced Micro Devices, Inc. [AMD] Renoir Device 24: Function 6
00:18.7 Host bridge: Advanced Micro Devices, Inc. [AMD] Renoir Device 24: Function 7
01:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8822CE 802.11ac PCIe Wireless Network Adapter
02:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe SSD Controller SM981/PM981/PM983
03:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Renoir (rev c1)
03:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Device 1637
03:00.2 Encryption controller: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh) Platform Security Processor
03:00.3 USB controller: Advanced Micro Devices, Inc. [AMD] Renoir USB 3.1
03:00.4 USB controller: Advanced Micro Devices, Inc. [AMD] Renoir USB 3.1
03:00.5 Multimedia controller: Advanced Micro Devices, Inc. [AMD] Raven/Raven2/FireFlight/Renoir Audio Processor (rev 01)
03:00.6 Audio device: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh) HD Audio Controller
$ lsusb
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 002: ID 04f2:b67c Chicony Electronics Co., Ltd Integrated Camera
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 0bda:c123 Realtek Semiconductor Corp. Bluetooth Radio
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Tips and tricks

System Performance Mode

There are 3 modes available: Intelligent Cooling, Extreme Performance and Battery Saving. To toggle it, you need to call some ACPI methods.

First install acpi_call (or acpi_call-lts for LTS kernel, acpi_call-dkms for other kernels) and load the kernel module:

 $ sudo modprobe acpi_call

Set it to Intelligent Cooling mode:

 $ echo '\_SB.PCI0.LPC0.EC0.VPC0.DYTC 0x000FB001' | sudo tee /proc/acpi/call

Set it to Extreme Performance mode:

 $ echo '\_SB.PCI0.LPC0.EC0.VPC0.DYTC 0x0012B001' | sudo tee /proc/acpi/call

Set it to Battery Saving mode:

 $ echo '\_SB.PCI0.LPC0.EC0.VPC0.DYTC 0x0013B001' | sudo tee /proc/acpi/call

To verify your setting:

 $ echo '\_SB.PCI0.LPC0.EC0.FCMO' | sudo tee /proc/acpi/call
 $ sudo cat /proc/acpi/call | cut -d '' -f1

where 0x0 stands for Intelligent Cooling, 0x1 stands for Extreme Performance and 0x2 stands for Battery Saving.

Rapid Charge

Make sure you have set up acpi_call.

Turn on:

 $ echo '\_SB.PCI0.LPC0.EC0.VPC0.SBMC 0x07' | sudo tee /proc/acpi/call

Turn off:

 $ echo '\_SB.PCI0.LPC0.EC0.VPC0.SBMC 0x08' | sudo tee /proc/acpi/call

To verify your setting:

 $ echo '\_SB.PCI0.LPC0.EC0.QCHO' | sudo tee /proc/acpi/call
 $ sudo cat /proc/acpi/call | cut -d '' -f1

where 0x0 stands for off and 0x1 stands for on.