Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 7633

Bare metal, Assembly language • Re: Dual HDMI output in bare metal RPi4

$
0
0
Thank you both for your responses. If I didn't find the correct tag, I was looking at the HVS planes.

Searching around more and using multiple requests to ai, I finally found the secret mailbox tag (ID: 0x00048013) to set which HDMI port you are configuring with the message. Since it works, I haven't sifted through the 12 links it provided for me to find out the source, maybe later to find out if there are any other nuggets of information.

The Raspberry Pi SET_DISPLAY_NUM mailbox tag (ID: 0x00048013) is used to specify which physical display should be targeted by subsequent framebuffer operations.
Tag Documentation: SET_DISPLAY_NUM
Tag ID: 0x00048013
Request Length: 4 bytes (1 uint32_t)
Response Length: 0 bytes
Description: Sets the display number to be used for the next display-related mailbox calls (such as setting physical/virtual sizes or allocating a framebuffer). Display ID 0=HDMI0, 1=HDMI1
Request Structure:
Display Number: A 32-bit integer indicating the target display index (typically 0 for the primary display and 1 for the secondary display on dual-HDMI models like the Pi 4 or 5).
Response Structure:
The GPU returns a success or failure status code in the standard mailbox header. A success code is 0x80000000.

Simply use 2 separate mailbox messages, one with ID set to 0 (=HDMI0) and next with ID set to 1 (=HDMI1). I don't think the order matters with the exception that the memory allocated is probably allocated in that order. This works and I now have independent framebuffers each with their own set of parameters. The information I found stated that this tag needs to be before any other framebuffer property tags in the message. That's where I put it and it works, did not try putting later in the message.

I haven't played around to see what config.txt settings are actually needed but I listed my current section below. Note that the attached display will show the rainbow box will remain up until the point that that particular port is initialized with the mailbox message and then it goes blank.


config.txt section
# Automatically load overlays for detected DSI displays
#display_auto_detect=1
#dtoverlay=vc4-kms-dsi-7inch,dsi0

# Automatically load initramfs files, if found
auto_initramfs=1

# Enable DRM VC4 V3D driver
#dtoverlay=vc4-fkms-v3d
#dtoverlay=vc4-kms-v3d
max_framebuffers=2
framebuffer_depth=32
framebuffer_ignore_alpha=0

#[HDMI:0]
hdmi_group:0=2
hdmi_mode:0=82
hdmi_force_hotplug:0=1

#[HDMI:1]
hdmi_cvt:1=1024 600 60 6 0 0 0
hdmi_group:1=2
hdmi_mode:1=87
hdmi_force_hotplug:1=1

#db
#hdmi_safe=1
#hdmi_group=2
#hdmi_mode=16
#hdmi_mode=82

#db
# these are for the 7" 1024 x 600 HDMI from hosyond.com
# double comments are not needed
#hdmi_cvt=1024 600 60 6 0 0 0
#hdmi_group=2
#hdmi_mode=87
##hdmi_force_hotplug=1
##config_hdmi_boost=7
##hdmi_drive=1
##display_hdmi_rotate=0

# Don't have the firmware create an initial video= setting in cmdline.txt.
# Use the kernel's default instead.
disable_fw_kms_setup=1

Statistics: Posted by ibalked — Wed Dec 17, 2025 5:41 pm



Viewing all articles
Browse latest Browse all 7633

Trending Articles