Configuration affichage Raspberry Pi OS

Mise à jour : Raspberry Pi OS 10.7

Ce document décrit

Sommaire

1 - Configuration des sorties d'affichage

1.1 - Fichier configuration par défaut

$ cat /boot/config.txt
# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
dtoverlay=vc4-fkms-v3d
max_framebuffers=2

[all]
#dtoverlay=vc4-fkms-v3d
[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
dtoverlay=vc4-fkms-v3d
max_framebuffers=2

1.2 - Exemple 1 - Connexion d'un écran tactile hdmi 7 pouces sur hdmi0

max_usb_current=1
hdmi_force_hotplug=1
config_hdmi_boost=7
hdmi_group=2
hdmi_mode=87
hdmi_drive=1 display_rotate=0 hdmi_cvt 1024 600 60 6 0 0 0
[hdmi:0]

# Set hdmi signal boost to the default value
config_hdmi_boost=5

# Set monitor mode to DMT

hdmi_group=2

# Set monitor resolution to 10024x600 / 60 Hz /
ratio 1:6
hdmi_mode=87
hdmi_cvt 1024 600 60 6 0 0 0

# Don't set audio on hdmi
hdmi_drive=1

# Don't rotate the HDMI display orientation
display_hdmi_rotate=0

1.3 - Exemple 2 - Connexion d'un moniteur PC sur hdmi1

[hdmi:1]

# Set monitor mode to DMT hdmi_group=2

# Set Normal HDMI mode (sound will be sent if supported and enabled)
hdmi_drive=2

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

# Set monitor resolution to 1920x1080 / 60 Hz /
ratio 16:9
hdmi_mode=87
hdmi_cvt=1920 1080 60
3

2 - Installation

2.1 - Processeurs graphiques

2.2 - Mode texte

$ sudo dmesg |grep vc4
[ 5.071121] vc4-drm gpu: bound fe600000.firmwarekms (ops vc4_fkms_ops [vc4])
[ 5.073838] [drm] Initialized vc4 0.0.0 20140616 for gpu on minor 0

$ lsmod |grep "^vc4"
vc4 253952 0

$ sudo modinfo vc4
filename: /lib/modules/5.10.11-v7l+/kernel/drivers/gpu/drm/vc4/vc4.ko
license: GPL v2
author: Eric Anholt <eric@anholt.net>
description: Broadcom VC4 DRM Driver
alias: platform:vc4-drm
......
$ fbset -i

mode "1024x600"
geometry 1024 600 1024 600 16
timings 0 0 0 0 0 0 0
accel true
rgba 5/11,6/5,5/0,0/0
endmode

Frame buffer device information:
Name : vc4drmfb
Address : 0
Size : 1228800
Type : PACKED PIXELS
Visual : TRUECOLOR
XPanStep : 1
YPanStep : 1
YWrapStep : 0
LineLength : 2048
Accelerator : No
$ sudo dpkg reconfigure console-setup

pour obtenir par exemple les valeurs suivantes

$ sudo debconf-show console-setup |grep "*"
* console-setup/fontsize-fb47: 12x24 (uniquement tampon vidéo (« framebuffer »))
* console-setup/fontface47: Terminus
* console-setup/codeset47: # Latin1 and Latin5 - western Europe and Turkic languages
* console-setup/charmap47: UTF-8

2.3 Mode graphique

2.3.1 Choix du module

Dans ce qui suit, on utilise fbdev

2.3.2 Mode graphique sans bureau

$ sudo aptitude install --without-recommends xorg xserver-xorg xserver-xorg-video-fbdev openbox mesa-utils x11-xserver-utils
$ sudo aptitude install --without-recommends xorg xserver-xorg xserver-xorg-video-fbtrubo openbox mesa-utils x11-xserver-utils
$ startx
$ vblank_mode=0 glxgears
ATTENTION: default value of option vblank_mode overridden by environment.
9329 frames in 5.0 seconds = 1855,727 FPS
....

Note : La performance est fortement fonction de la taille de la fenêtre d'affichage

$ pkill xinit

2.2.3 Mode graphique avec bureau "Pixel"

$ sudo apt install raspberrypi-ui-mods
$ systemctl start lightdm

Annexe - Fichier de configuration graphique par défaut

$ cat /boot/config.txt
# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
dtoverlay=vc4-fkms-v3d
max_framebuffers=2

[all]
#dtoverlay=vc4-fkms-v3d