mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-09-12 18:44:25 +08:00
fix: 完善 RK3588 HDMI RX 兼容性
This commit is contained in:
@@ -20,7 +20,9 @@ pub mod bridge;
|
||||
pub mod bridge;
|
||||
|
||||
pub(crate) fn is_rk_hdmirx_driver(driver: &str, card: &str) -> bool {
|
||||
driver.eq_ignore_ascii_case("rk_hdmirx") || card.eq_ignore_ascii_case("rk_hdmirx")
|
||||
[driver, card].iter().any(|name| {
|
||||
name.eq_ignore_ascii_case("rk_hdmirx") || name.eq_ignore_ascii_case("snps_hdmirx")
|
||||
})
|
||||
}
|
||||
|
||||
pub(crate) fn is_rk_hdmirx_device(device: &VideoDeviceInfo) -> bool {
|
||||
@@ -37,5 +39,18 @@ pub(crate) fn is_csi_hdmi_bridge(device: &VideoDeviceInfo) -> bool {
|
||||
is_rk_hdmirx_device(device) || is_rkcif_driver(&device.driver)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::is_rk_hdmirx_driver;
|
||||
|
||||
#[test]
|
||||
fn recognizes_vendor_and_upstream_native_hdmirx_names() {
|
||||
assert!(is_rk_hdmirx_driver("rk_hdmirx", "rk_hdmirx"));
|
||||
assert!(is_rk_hdmirx_driver("snps_hdmirx", "Synopsys HDMI RX"));
|
||||
assert!(is_rk_hdmirx_driver("other", "SNPS_HDMIRX"));
|
||||
assert!(!is_rk_hdmirx_driver("rkcif", "stream_cif_mipi_id0"));
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
pub(crate) use linux::parse_bridge_kind;
|
||||
|
||||
Reference in New Issue
Block a user