联系管理员

开通文章发布权限

扫码 添加微信
微信图片
电话: QQ:1602036736

RK3566 buildroot LVDS+HDMI 双屏同显

在SDK里面去到这个路径创建文件weston.sh:

没有路径就新建,在泰山派里面就是新建了 /profile.d/weston.sh
board/rockchip/rk356x/fs-overlay/etc/profile.d/weston.sh

在里面写:

# The env variables below can be override by the init script(e.g. S50launcher)

export XDG_RUNTIME_DIR=/var/run

# Comment out this for atomic related functions, e.g. sprites
export WESTON_DISABLE_ATOMIC=1

# Allow using drm modifier, e.g. ARM AFBC
# export WESTON_ALLOW_GBM_MODIFIERS=1

# Enable black background for fullscreen views
# export WESTON_FULLSCREEN_BLACK_BACKGROUND=1

# Allow disabling unused CRTCs
# WESTON_DRM_MASTER=1

# Override output's freezing time
# export WESTON_DRM_RESIZE_FREEZE_MS=1000

# Primary screen
# export WESTON_DRM_PRIMARY=eDP-1

# Single screen
# export WESTON_DRM_SINGLE_HEAD=1

# Fallback to any available connector
# export WESTON_DRM_HEAD_FALLBACK=1

# Connector selecting mode:
# default|primary|internal|external|external-dual
# export WESTON_DRM_HEAD_MODE=external-dual

# Screens layout direction
# horizontal|vertical|same-as
# export WESTON_OUTPUT_FLOW=vertical

# Virtual display size
# export WESTON_DRM_VIRTUAL_SIZE=1024x768

# Comment out these to disable mirror mode
export WESTON_DRM_MIRROR=1
export WESTON_DRM_KEEP_RATIO=1
export WESTON_DRM_PRIMARY=HDMI-A-1
export WESTON_DRM_HEAD_FALLBACK=1
export WESTON_DRM_HEAD_MODE=external-dual

# Disable DRM plane hardware scale feature
# export WESTON_DRM_DISABLE_PLANE_SCALE=1

# Tag file for freezing weston display
# export WESTON_FREEZE_DISPLAY=/tmp/.freeze_weston

# Dynamic config file path, config examples:
# echo "compositor:state:sleep" > /tmp/.weston_drm.conf
# echo "compositor:state:off" > /tmp/.weston_drm.conf
# echo "compositor:state:on" > /tmp/.weston_drm.conf
# echo "output:DSI-1:off" >> /tmp/.weston_drm.conf
# echo "output:eDP-1:freeze" >> /tmp/.weston_drm.conf
# echo "output:DSI-1:on" >> /tmp/.weston_drm.conf
# echo "output:all:rotate90" >> /tmp/.weston_drm.conf
# echo "output:all:rect=<100,20,1636,2068>" >> /tmp/.weston_drm.conf
# echo "output:HDMI-A-1:mode=800x600" >> /tmp/.weston_drm.conf
# echo "output:HDMI-A-1:pos=100,200" >> /tmp/.weston_drm.conf
# echo "output:HDMI-A-1:size=1920x1080" >> /tmp/.weston_drm.conf
# echo "output:HDMI-A-1:prefer" >> /tmp/.weston_drm.conf
# echo "output:HDMI-A-1:primary" >> /tmp/.weston_drm.conf
# export WESTON_DRM_CONFIG=/tmp/.weston_drm.conf

export QT_QPA_PLATFORM=wayland

解释:

# /etc/profile.d/weston.sh
export WESTON_DRM_PRIMARY=HDMI-A-1 # 指定主显为HDMI-A-1
export WESTON_DRM_SINGLE_HEAD=1 # 强制单显
export WESTON_DRM_MIRROR=1 # 使⽤镜像模式(多屏同显),不设置此环境变量即为异显
export WESTON_DRM_KEEP_RATIO=1 # 镜像模式下缩放保持纵横⽐,不设置此变量即为强制全屏
export WESTON_DRM_HEAD_MODE=primary # 只使能主显
export WESTON_DRM_HEAD_MODE=internal # 只使能内置显⽰器
export WESTON_DRM_HEAD_MODE=external # 只使能外置显⽰器
export WESTON_DRM_HEAD_MODE=external-dual # 使能所有显⽰器,优先外置显⽰器
export WESTON_DRM_HEAD_FALLBACK=1 # 未匹配到显⽰器时,使能任意⼀个有效显⽰器
export WESTON_OUTPUT_FLOW=horizontal # 默认⽔平排列
export WESTON_OUTPUT_FLOW=vertical # 默认垂直排列
export WESTON_OUTPUT_FLOW=same-as # 所有显⽰器默认位置(0,0)

设备树上分配好VP。

LVDS:

&dsi0_in_vp0 {
	status = "disabled";
};

&dsi0_in_vp1 {
	status = "okay";
};

&route_dsi0 {
	status = "okay";
	connect = <&vp1_out_dsi0>;
};

HDMI:

&hdmi_in_vp0 {
	status = "okay";
};

&hdmi_in_vp1 {
	status = "disabled";
};

&hdmi_sound {
	status = "okay";
};

&i2s0_8ch {
	status = "okay";
};

&route_hdmi {
	status = "okay";
	connect = <&vp0_out_hdmi>;
};

 

全编译烧录就可以了。

 

评论

快捷导航

把好文章收藏到微信

打开微信,扫码查看

关闭

还没有账号?立即注册