Skip to content

Commit aeadb0f

Browse files
authored
PR #14445 from remibettan: adding d401_gmsl device is SDK and linux backend
2 parents 18ee3b0 + 7ae658e commit aeadb0f

File tree

6 files changed

+64
-10
lines changed

6 files changed

+64
-10
lines changed

src/ds/d400/d400-device.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ namespace librealsense
503503

504504
std::unique_ptr< frame_timestamp_reader > timestamp_reader_backup( new ds_timestamp_reader() );
505505
frame_timestamp_reader* timestamp_reader_from_metadata;
506-
if (!val_in_range(all_device_infos.front().pid, { RS457_PID, RS430_GMSL_PID, RS415_GMSL_PID }))
506+
if (!(ds::d400_mipi_device_pid.count(all_device_infos.front().pid) > 0))
507507
timestamp_reader_from_metadata = new ds_timestamp_reader_from_metadata(std::move(timestamp_reader_backup));
508508
else
509509
timestamp_reader_from_metadata = new ds_timestamp_reader_from_metadata_mipi(std::move(timestamp_reader_backup));
@@ -552,7 +552,7 @@ namespace librealsense
552552
auto raw_sensor = get_raw_depth_sensor();
553553
_pid = group.uvc_devices.front().pid;
554554

555-
_is_mipi_device = val_in_range(_pid, { RS457_PID, RS430_GMSL_PID, RS415_GMSL_PID });
555+
_is_mipi_device = (ds::d400_mipi_device_pid.count(_pid) > 0);
556556

557557
_color_calib_table_raw = [this]()
558558
{

src/ds/d400/d400-factory.cpp

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,34 @@ namespace librealsense
7878
};
7979
};
8080

81+
class rs401_gmsl_device : //public d400_color,
82+
public d400_nonmonochrome,
83+
public d400_mipi_device,
84+
public firmware_logger_device
85+
{
86+
public:
87+
rs401_gmsl_device( std::shared_ptr< const d400_info > const & dev_info, bool register_device_notifications )
88+
: device( dev_info, register_device_notifications )
89+
, backend_device( dev_info, register_device_notifications )
90+
, d400_device( dev_info )
91+
//, d400_color( dev_info )
92+
, d400_nonmonochrome( dev_info )
93+
, d400_mipi_device()
94+
, firmware_logger_device( dev_info, d400_device::_hw_monitor, get_firmware_logs_command(), get_flash_logs_command() )
95+
{
96+
}
97+
98+
std::shared_ptr<matcher> create_matcher(const frame_holder& frame) const override;
99+
100+
std::vector<tagged_profile> get_profiles_tags() const override
101+
{
102+
std::vector<tagged_profile> tags;
103+
104+
tags.push_back({ RS2_STREAM_DEPTH, -1, 640, 480, RS2_FORMAT_Z16, 30, profile_tag::PROFILE_TAG_SUPERSET | profile_tag::PROFILE_TAG_DEFAULT });
105+
return tags;
106+
};
107+
};
108+
81109
// Not used, should be removed with EOL devices clean up
82110
class rs405u_device : public ds5u_device,
83111
public ds_advanced_mode_base,
@@ -1096,6 +1124,8 @@ namespace librealsense
10961124
return std::make_shared< rs430_gmsl_device >( dev_info, register_device_notifications );
10971125
case RS415_GMSL_PID:
10981126
return std::make_shared< rs415_gmsl_device >(dev_info, register_device_notifications);
1127+
case RS401_GMSL_PID:
1128+
return std::make_shared< rs401_gmsl_device >( dev_info, register_device_notifications );
10991129
default:
11001130
throw std::runtime_error( rsutils::string::from() << "Unsupported RS400 model! 0x" << std::hex
11011131
<< std::setw( 4 ) << std::setfill( '0' ) << (int)pid );
@@ -1168,6 +1198,12 @@ namespace librealsense
11681198
return matcher_factory::create(RS2_MATCHER_DEFAULT, streams);
11691199
}
11701200

1201+
std::shared_ptr<matcher> rs401_gmsl_device::create_matcher(const frame_holder& frame) const
1202+
{
1203+
std::vector<stream_interface*> streams = { _depth_stream.get() , _left_ir_stream.get() , _right_ir_stream.get() };
1204+
return matcher_factory::create(RS2_MATCHER_DEFAULT, streams);
1205+
}
1206+
11711207
std::shared_ptr<matcher> rs405u_device::create_matcher(const frame_holder& frame) const
11721208
{
11731209
std::vector<stream_interface*> streams = { _depth_stream.get() , _left_ir_stream.get() , _right_ir_stream.get()};

src/ds/d400/d400-nonmonochrome.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ namespace librealsense
3535

3636
if ((_fw_version >= firmware_version("5.5.8.0")) && (!val_in_range(pid, { RS_USB2_PID })))
3737
{
38-
if (!val_in_range(pid, { RS405_PID, RS455_PID }))
38+
if (!val_in_range(pid, { RS405_PID, RS455_PID, RS401_GMSL_PID }))
3939
{
4040
depth_ep.register_option(RS2_OPTION_ENABLE_AUTO_WHITE_BALANCE,
4141
std::make_shared<uvc_xu_option<uint8_t>>(get_raw_depth_sensor(),

src/ds/d400/d400-private.h

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ namespace librealsense
4242
const uint16_t RS400_MIPI_RECOVERY_PID = 0xbbcd; // D4XX MIPI DFU Recovery
4343
const uint16_t RS430_GMSL_PID = 0xabce; // D430 GMSL
4444
const uint16_t RS415_GMSL_PID = 0xabcf; // D415 GMSL
45+
const uint16_t RS401_GMSL_PID = 0xabcc; // D401 GMSL
4546

4647
// d400 Devices supported by the current version
4748
static const std::set<std::uint16_t> rs400_sku_pid = {
@@ -70,7 +71,8 @@ namespace librealsense
7071
ds::RS455_PID,
7172
ds::RS457_PID,
7273
ds::RS430_GMSL_PID,
73-
ds::RS415_GMSL_PID
74+
ds::RS415_GMSL_PID,
75+
ds::RS401_GMSL_PID
7476
};
7577

7678
static const std::set<std::uint16_t> d400_multi_sensors_pid = {
@@ -86,13 +88,15 @@ namespace librealsense
8688
ds::RS455_PID,
8789
ds::RS457_PID,
8890
ds::RS430_GMSL_PID,
89-
ds::RS415_GMSL_PID
91+
ds::RS415_GMSL_PID,
92+
ds::RS401_GMSL_PID
9093
};
9194

9295
static const std::set<std::uint16_t> d400_mipi_device_pid = {
9396
ds::RS457_PID,
9497
ds::RS430_GMSL_PID,
95-
ds::RS415_GMSL_PID
98+
ds::RS415_GMSL_PID,
99+
ds::RS401_GMSL_PID
96100
};
97101

98102
static const std::set<std::uint16_t> d400_hid_sensors_pid = {
@@ -149,6 +153,7 @@ namespace librealsense
149153
{ RS400_MIPI_RECOVERY_PID, "Intel RealSense D4XX MIPI Recovery"},
150154
{ RS430_GMSL_PID, "Intel RealSense D430" },
151155
{ RS415_GMSL_PID, "Intel RealSense D415" },
156+
{ RS401_GMSL_PID, "Intel RealSense D401" },
152157
};
153158

154159
static std::map<uint16_t, std::string> d400_device_to_fw_min_version = {
@@ -180,7 +185,8 @@ namespace librealsense
180185
{RS457_PID, "5.16.8.0" },
181186
{RS400_MIPI_RECOVERY_PID, "5.16.0.1" },
182187
{RS430_GMSL_PID, "5.16.8.0" },
183-
{RS415_GMSL_PID, "5.17.1.1" }
188+
{RS415_GMSL_PID, "5.17.1.1" },
189+
{RS401_GMSL_PID, "5.17.2.100" } // TO BE UPDATED!!!
184190
};
185191

186192
std::vector<platform::uvc_device_info> filter_d400_device_by_capability(

src/linux/backend-v4l2.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -944,6 +944,7 @@ namespace librealsense
944944
const uint8_t GVD_PID_OFFSET = 4;
945945

946946
const uint8_t GVD_PID_D457 = 0x12;
947+
const uint8_t GVD_PID_D401_GMSL = 0x13;
947948
const uint8_t GVD_PID_D430_GMSL = 0x0F;
948949
const uint8_t GVD_PID_D415_GMSL = 0x06;
949950

@@ -1001,6 +1002,10 @@ namespace librealsense
10011002
device_pid = D415_GMSL_PID;
10021003
break;
10031004

1005+
case(GVD_PID_D401_GMSL):
1006+
device_pid = D401_GMSL_PID;
1007+
break;
1008+
10041009
default:
10051010
LOG_WARNING("Unidentified MIPI device product id: 0x" << std::hex << (int) product_pid << "remaining retries = " << retries);
10061011
device_pid = 0x0000;
@@ -3114,9 +3119,8 @@ namespace librealsense
31143119

31153120
std::shared_ptr<uvc_device> v4l_backend::create_uvc_device(uvc_device_info info) const
31163121
{
3117-
bool mipi_device = (D457_PID == info.pid ||
3118-
D430_GMSL_PID == info.pid ||
3119-
D415_GMSL_PID == info.pid);
3122+
bool mipi_device = (mipi_devices_pid.count(info.pid) > 0);
3123+
31203124
auto v4l_uvc_dev = mipi_device ? std::make_shared<v4l_mipi_device>(info) :
31213125
((!info.has_metadata_node) ? std::make_shared<v4l_uvc_device>(info) :
31223126
std::make_shared<v4l_uvc_meta_device>(info));

src/linux/backend-v4l2.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,14 @@ namespace librealsense
500500
const uint16_t D457_PID = 0xABCD;
501501
const uint16_t D430_GMSL_PID = 0xABCE;
502502
const uint16_t D415_GMSL_PID = 0xABCF;
503+
const uint16_t D401_GMSL_PID = 0xABCC;
504+
505+
static const std::set<std::uint16_t> mipi_devices_pid = {
506+
D457_PID,
507+
D430_GMSL_PID,
508+
D415_GMSL_PID,
509+
D401_GMSL_PID
510+
};
503511

504512
// D457 Development. To be merged into underlying class
505513
class v4l_mipi_device : public v4l_uvc_meta_device

0 commit comments

Comments
 (0)