Skip to content

Commit d1b28ba

Browse files
authored
PR #14026 from remibettan: Support new SKU - D415 gmsl
2 parents fd81300 + 4a3ad0f commit d1b28ba

9 files changed

+106
-41
lines changed

src/ds/advanced_mode/advanced_mode.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ namespace librealsense
107107
{
108108
case ds::RS410_PID:
109109
case ds::RS415_PID:
110+
case ds::RS415_GMSL_PID:
110111
default_410(p);
111112
break;
112113
case ds::RS421_PID:

src/ds/d400/d400-active.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ namespace librealsense
3434
auto pid = this->_pid;
3535
auto& depth_ep = get_depth_sensor();
3636

37-
if( pid == ds::RS457_PID || pid == ds::RS430_GMSL_PID)
37+
if( _is_mipi_device )
3838
{
3939
depth_ep.register_option( RS2_OPTION_PROJECTOR_TEMPERATURE,
4040
std::make_shared< projector_temperature_option_mipi >(

src/ds/d400/d400-color.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,16 @@ namespace librealsense
6464
// except for D405, in which the color is part of the depth unit
6565
// and it will then been found in end point 0 (the depth's one)
6666
auto color_devs_info_mi3 = filter_by_mi(group.uvc_devices, 3);
67-
if (color_devs_info_mi3.size() == 1 || ds::RS457_PID == _pid)
67+
if (color_devs_info_mi3.size() == 1 || _is_mipi_device)
6868
{
6969
// means color end point in part of a separate color sensor (e.g. D435)
70-
if (ds::RS457_PID == _pid)
70+
if (_is_mipi_device)
7171
color_devs_info = group.uvc_devices;
7272
else
7373
color_devs_info = color_devs_info_mi3;
7474
std::unique_ptr< frame_timestamp_reader > d400_timestamp_reader_backup( new ds_timestamp_reader() );
7575
frame_timestamp_reader* timestamp_reader_from_metadata;
76-
if (ds::RS457_PID != _pid)
76+
if (!_is_mipi_device)
7777
timestamp_reader_from_metadata = new ds_timestamp_reader_from_metadata(std::move(d400_timestamp_reader_backup));
7878
else
7979
timestamp_reader_from_metadata = new ds_timestamp_reader_from_metadata_mipi_color(std::move(d400_timestamp_reader_backup));
@@ -82,7 +82,7 @@ namespace librealsense
8282

8383
auto enable_global_time_option = std::shared_ptr<global_time_option>(new global_time_option());
8484
platform::uvc_device_info info;
85-
if (ds::RS457_PID == _pid)
85+
if (_is_mipi_device)
8686
info = color_devs_info[1];
8787
else
8888
info = color_devs_info.front();
@@ -148,7 +148,7 @@ namespace librealsense
148148
register_color_features();
149149
register_options();
150150

151-
if (_pid != ds::RS457_PID)
151+
if (!_is_mipi_device)
152152
{
153153
register_metadata(color_ep);
154154
}
@@ -165,7 +165,7 @@ namespace librealsense
165165
{
166166
auto& color_ep = get_color_sensor();
167167

168-
if (!val_in_range(_pid, { ds::RS457_PID }))
168+
if (!_is_mipi_device)
169169
{
170170
_ds_color_common->register_color_options();
171171
color_ep.register_pu(RS2_OPTION_BACKLIGHT_COMPENSATION);
@@ -182,7 +182,7 @@ namespace librealsense
182182
if (_separate_color)
183183
{
184184
// Currently disabled for certain sensors
185-
if (!val_in_range(_pid, { ds::RS457_PID}))
185+
if (!_is_mipi_device)
186186
{
187187
color_ep.register_pu(RS2_OPTION_AUTO_EXPOSURE_PRIORITY);
188188
}
@@ -199,7 +199,7 @@ namespace librealsense
199199
}
200200

201201
// Currently disabled for certain sensors
202-
if (!val_in_range(_pid, { ds::RS457_PID }))
202+
if (!_is_mipi_device)
203203
{
204204
color_ep.register_pu(RS2_OPTION_HUE);
205205
}
@@ -245,7 +245,7 @@ namespace librealsense
245245
// attributes of md_rgb_control
246246
auto raw_color_ep = get_raw_color_sensor();
247247

248-
if (_pid != ds::RS457_PID)
248+
if (!_is_mipi_device)
249249
{
250250
color_ep.register_processing_block(processing_block_factory::create_pbf_vector<yuy2_converter>(RS2_FORMAT_YUYV, map_supported_color_formats(RS2_FORMAT_YUYV), RS2_STREAM_COLOR));
251251
color_ep.register_processing_block(processing_block_factory::create_id_pbf(RS2_FORMAT_RAW16, RS2_STREAM_COLOR));

src/ds/d400/d400-device.cpp

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ namespace librealsense
523523

524524
std::unique_ptr< frame_timestamp_reader > timestamp_reader_backup( new ds_timestamp_reader() );
525525
frame_timestamp_reader* timestamp_reader_from_metadata;
526-
if (all_device_infos.front().pid != RS457_PID && all_device_infos.front().pid != RS430_GMSL_PID)
526+
if (!val_in_range(all_device_infos.front().pid, { RS457_PID, RS430_GMSL_PID, RS415_GMSL_PID }))
527527
timestamp_reader_from_metadata = new ds_timestamp_reader_from_metadata(std::move(timestamp_reader_backup));
528528
else
529529
timestamp_reader_from_metadata = new ds_timestamp_reader_from_metadata_mipi(std::move(timestamp_reader_backup));
@@ -571,8 +571,8 @@ namespace librealsense
571571

572572
auto raw_sensor = get_raw_depth_sensor();
573573
_pid = group.uvc_devices.front().pid;
574-
// to be changed for D457
575-
bool mipi_sensor = (RS457_PID == _pid || RS430_GMSL_PID == _pid);
574+
575+
_is_mipi_device = val_in_range(_pid, { RS457_PID, RS430_GMSL_PID, RS415_GMSL_PID });
576576

577577
_color_calib_table_raw = [this]()
578578
{
@@ -588,7 +588,7 @@ namespace librealsense
588588
}
589589
else
590590
{
591-
if( ! mipi_sensor )
591+
if( !_is_mipi_device)
592592
_hw_monitor = std::make_shared< hw_monitor >(
593593
std::make_shared< locked_transfer >(
594594
get_backend()->create_usb_device( group.usb_devices.front() ),
@@ -597,7 +597,7 @@ namespace librealsense
597597
set_hw_monitor_for_auto_calib(_hw_monitor);
598598

599599

600-
_ds_device_common = std::make_shared<ds_device_common>(this, _hw_monitor, (mipi_sensor) ? true : false);
600+
_ds_device_common = std::make_shared<ds_device_common>(this, _hw_monitor, (_is_mipi_device) ? true : false);
601601

602602

603603
// Define Left-to-Right extrinsics calculation (lazy)
@@ -662,26 +662,14 @@ namespace librealsense
662662
usb_modality = false;
663663
}
664664

665-
if (!mipi_sensor)
665+
if (!_is_mipi_device)
666666
{
667667
depth_sensor.register_processing_block(
668668
{ {RS2_FORMAT_Y8I} },
669669
{ {RS2_FORMAT_Y8, RS2_STREAM_INFRARED, 1} , {RS2_FORMAT_Y8, RS2_STREAM_INFRARED, 2} },
670670
[]() { return std::make_shared<y8i_to_y8y8>(); }
671671
); // L+R
672-
}
673-
else
674-
{
675-
depth_sensor.register_processing_block(
676-
{ {RS2_FORMAT_Y8I} },
677-
{ {RS2_FORMAT_Y8, RS2_STREAM_INFRARED, 1} , {RS2_FORMAT_Y8, RS2_STREAM_INFRARED, 2} },
678-
[]() { return std::make_shared<y8i_to_y8y8_mipi>(); }
679-
); // L+R
680-
}
681-
682672

683-
if (!mipi_sensor)
684-
{
685673
depth_sensor.register_processing_block(
686674
{ RS2_FORMAT_Y12I },
687675
{ {RS2_FORMAT_Y16, RS2_STREAM_INFRARED, 1}, {RS2_FORMAT_Y16, RS2_STREAM_INFRARED, 2} },
@@ -690,6 +678,12 @@ namespace librealsense
690678
}
691679
else
692680
{
681+
depth_sensor.register_processing_block(
682+
{ {RS2_FORMAT_Y8I} },
683+
{ {RS2_FORMAT_Y8, RS2_STREAM_INFRARED, 1} , {RS2_FORMAT_Y8, RS2_STREAM_INFRARED, 2} },
684+
[]() { return std::make_shared<y8i_to_y8y8_mipi>(); }
685+
); // L+R
686+
693687
depth_sensor.register_processing_block(
694688
{ RS2_FORMAT_Y12I },
695689
{ {RS2_FORMAT_Y16, RS2_STREAM_INFRARED, 1}, {RS2_FORMAT_Y16, RS2_STREAM_INFRARED, 2} },
@@ -719,7 +713,7 @@ namespace librealsense
719713
//if hw_monitor was created by usb replace it with xu
720714
// D400_IMU will remain using USB interface due to HW limitations
721715
{
722-
if (_pid == ds::RS457_PID || _pid == ds::RS430_GMSL_PID)
716+
if (_is_mipi_device)
723717
{
724718
depth_sensor.register_option(RS2_OPTION_ASIC_TEMPERATURE,
725719
std::make_shared<asic_temperature_option_mipi>(_hw_monitor,
@@ -940,7 +934,7 @@ namespace librealsense
940934
}
941935
}
942936

943-
if (!val_in_range(_pid, { ds::RS457_PID, RS430_GMSL_PID }))
937+
if (!_is_mipi_device)
944938
{
945939
depth_sensor.register_option( RS2_OPTION_STEREO_BASELINE,
946940
std::make_shared< const_value_option >(
@@ -974,7 +968,7 @@ namespace librealsense
974968

975969

976970
// REGISTER METADATA
977-
if (!mipi_sensor)
971+
if (!_is_mipi_device)
978972
{
979973
register_metadata(depth_sensor, hdr_firmware_version);
980974
}
@@ -1023,7 +1017,7 @@ namespace librealsense
10231017
firmware_version fw_ver = firmware_version( get_info( RS2_CAMERA_INFO_FIRMWARE_VERSION ) );
10241018
auto pid = get_pid();
10251019

1026-
if( ( pid == ds::RS457_PID || pid == ds::RS455_PID || pid == ds::RS430_GMSL_PID ) && fw_ver >= firmware_version( 5, 14, 0, 0 ) )
1020+
if( (_is_mipi_device || pid == ds::RS455_PID) && fw_ver >= firmware_version( 5, 14, 0, 0 ) )
10271021
register_feature( std::make_shared< emitter_frequency_feature >( get_depth_sensor() ) );
10281022

10291023
if( fw_ver >= firmware_version( 5, 11, 9, 0 ) )
@@ -1034,7 +1028,7 @@ namespace librealsense
10341028

10351029
register_feature( std::make_shared< auto_exposure_roi_feature >( get_depth_sensor(), _hw_monitor ) );
10361030

1037-
if( pid != ds::RS457_PID && pid != ds::RS415_PID && pid != ds::RS430_GMSL_PID && fw_ver >= firmware_version( 5, 12, 10, 11 ) )
1031+
if( !_is_mipi_device && fw_ver >= firmware_version( 5, 12, 10, 11 ) )
10381032
{
10391033
register_feature(
10401034
std::make_shared< auto_exposure_limit_feature >( get_depth_sensor(), d400_device::_hw_monitor ) );

src/ds/d400/d400-device.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ namespace librealsense
118118

119119
std::shared_ptr<auto_gain_limit_option> _gain_limit_value_control;
120120
std::shared_ptr<auto_exposure_limit_option> _ae_limit_value_control;
121+
bool _is_mipi_device;
121122
};
122123

123124
class ds5u_device : public d400_device

src/ds/d400/d400-factory.cpp

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,49 @@ namespace librealsense
208208
};
209209
};
210210

211+
// monochrome not implemented for this device
212+
class rs415_gmsl_device :
213+
public d400_active,
214+
public d400_color,
215+
public ds_advanced_mode_base,
216+
public firmware_logger_device
217+
{
218+
public:
219+
rs415_gmsl_device(std::shared_ptr< const d400_info > const& dev_info, bool register_device_notifications)
220+
: device(dev_info, register_device_notifications)
221+
, backend_device(dev_info, register_device_notifications)
222+
, d400_device(dev_info)
223+
, d400_active(dev_info)
224+
, d400_color(dev_info)
225+
, ds_advanced_mode_base(d400_device::_hw_monitor, get_depth_sensor())
226+
, firmware_logger_device(
227+
dev_info, d400_device::_hw_monitor, get_firmware_logs_command(), get_flash_logs_command())
228+
{
229+
}
230+
231+
std::shared_ptr<matcher> create_matcher(const frame_holder& frame) const override;
232+
233+
std::vector<tagged_profile> get_profiles_tags() const override
234+
{
235+
std::vector<tagged_profile> tags;
236+
auto usb_spec = get_usb_spec();
237+
if (usb_spec >= platform::usb3_type || usb_spec == platform::usb_undefined)
238+
{
239+
tags.push_back({ RS2_STREAM_COLOR, -1, 1280, 720, get_color_format(), 30, profile_tag::PROFILE_TAG_SUPERSET | profile_tag::PROFILE_TAG_DEFAULT });
240+
tags.push_back({ RS2_STREAM_DEPTH, -1, 1280, 720, RS2_FORMAT_Z16, 30, profile_tag::PROFILE_TAG_SUPERSET | profile_tag::PROFILE_TAG_DEFAULT });
241+
tags.push_back({ RS2_STREAM_INFRARED, -1, 1280, 720, RS2_FORMAT_Y8, 30, profile_tag::PROFILE_TAG_SUPERSET });
242+
}
243+
else
244+
{
245+
tags.push_back({ RS2_STREAM_COLOR, -1, 640, 480, get_color_format(), 15, profile_tag::PROFILE_TAG_SUPERSET | profile_tag::PROFILE_TAG_DEFAULT });
246+
tags.push_back({ RS2_STREAM_DEPTH, -1, 640, 480, RS2_FORMAT_Z16, 15, profile_tag::PROFILE_TAG_SUPERSET | profile_tag::PROFILE_TAG_DEFAULT });
247+
tags.push_back({ RS2_STREAM_INFRARED, -1, 640, 480, RS2_FORMAT_Y8, 15, profile_tag::PROFILE_TAG_SUPERSET });
248+
}
249+
return tags;
250+
};
251+
};
252+
253+
211254
class rs416_device : public d400_nonmonochrome,
212255
public d400_active,
213256
public ds_advanced_mode_base,
@@ -1119,6 +1162,8 @@ namespace librealsense
11191162
return std::make_shared< rs457_device >( dev_info, register_device_notifications );
11201163
case RS430_GMSL_PID:
11211164
return std::make_shared< rs430_gmsl_device >( dev_info, register_device_notifications );
1165+
case RS415_GMSL_PID:
1166+
return std::make_shared< rs415_gmsl_device >(dev_info, register_device_notifications);
11221167
default:
11231168
throw std::runtime_error( rsutils::string::from() << "Unsupported RS400 model! 0x" << std::hex
11241169
<< std::setw( 4 ) << std::setfill( '0' ) << (int)pid );
@@ -1209,6 +1254,12 @@ namespace librealsense
12091254
return matcher_factory::create(RS2_MATCHER_DEFAULT, streams);
12101255
}
12111256

1257+
std::shared_ptr<matcher> rs415_gmsl_device::create_matcher(const frame_holder& frame) const
1258+
{
1259+
std::vector<stream_interface*> streams = { _depth_stream.get() , _left_ir_stream.get() , _right_ir_stream.get(), _color_stream.get() };
1260+
return matcher_factory::create(RS2_MATCHER_DEFAULT, streams);
1261+
}
1262+
12121263
std::shared_ptr<matcher> rs416_device::create_matcher(const frame_holder& frame) const
12131264
{
12141265
std::vector<stream_interface*> streams = { _depth_stream.get() , _left_ir_stream.get() , _right_ir_stream.get() };

src/ds/d400/d400-private.h

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ namespace librealsense
4141
const uint16_t RS457_PID = 0xabcd; // D457
4242
const uint16_t RS400_MIPI_RECOVERY_PID = 0xbbcd; // D4XX MIPI DFU Recovery
4343
const uint16_t RS430_GMSL_PID = 0xabce; // D430 GMSL
44+
const uint16_t RS415_GMSL_PID = 0xabcf; // D415 GMSL
4445

4546
// d400 Devices supported by the current version
4647
static const std::set<std::uint16_t> rs400_sku_pid = {
@@ -68,7 +69,8 @@ namespace librealsense
6869
ds::RS405_PID,
6970
ds::RS455_PID,
7071
ds::RS457_PID,
71-
ds::RS430_GMSL_PID
72+
ds::RS430_GMSL_PID,
73+
ds::RS415_GMSL_PID
7274
};
7375

7476
static const std::set<std::uint16_t> d400_multi_sensors_pid = {
@@ -83,12 +85,14 @@ namespace librealsense
8385
ds::RS435I_PID,
8486
ds::RS455_PID,
8587
ds::RS457_PID,
86-
ds::RS430_GMSL_PID
88+
ds::RS430_GMSL_PID,
89+
ds::RS415_GMSL_PID
8790
};
8891

8992
static const std::set<std::uint16_t> d400_mipi_device_pid = {
9093
ds::RS457_PID,
91-
ds::RS430_GMSL_PID
94+
ds::RS430_GMSL_PID,
95+
ds::RS415_GMSL_PID
9296
};
9397

9498
static const std::set<std::uint16_t> d400_hid_sensors_pid = {
@@ -144,6 +148,7 @@ namespace librealsense
144148
{ RS457_PID, "Intel RealSense D457" },
145149
{ RS400_MIPI_RECOVERY_PID, "Intel RealSense D4XX MIPI Recovery"},
146150
{ RS430_GMSL_PID, "Intel RealSense D430" },
151+
{ RS415_GMSL_PID, "Intel RealSense D415" },
147152
};
148153

149154
static std::map<uint16_t, std::string> d400_device_to_fw_min_version = {
@@ -174,7 +179,8 @@ namespace librealsense
174179
{RS455_PID, "5.13.0.50" },
175180
{RS457_PID, "5.16.8.0" },
176181
{RS400_MIPI_RECOVERY_PID, "5.16.0.1" },
177-
{RS430_GMSL_PID, "5.16.8.0" }
182+
{RS430_GMSL_PID, "5.16.8.0" },
183+
{RS415_GMSL_PID, "5.17.0.2" }
178184
};
179185

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

src/linux/backend-v4l2.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -868,8 +868,9 @@ namespace librealsense
868868
// GVD product ID
869869
const uint8_t GVD_PID_OFFSET = 4;
870870

871-
const uint8_t GVD_PID_D430_GMSL = 0x0F;
872871
const uint8_t GVD_PID_D457 = 0x12;
872+
const uint8_t GVD_PID_D430_GMSL = 0x0F;
873+
const uint8_t GVD_PID_D415_GMSL = 0x06;
873874

874875
// device PID
875876
uint16_t device_pid = 0;
@@ -914,11 +915,15 @@ namespace librealsense
914915
switch(product_pid)
915916
{
916917
case(GVD_PID_D457):
917-
device_pid = 0xABCD;
918+
device_pid = D457_PID;
918919
break;
919920

920921
case(GVD_PID_D430_GMSL):
921-
device_pid = 0xABCE;
922+
device_pid = D430_GMSL_PID;
923+
break;
924+
925+
case(GVD_PID_D415_GMSL):
926+
device_pid = D415_GMSL_PID;
922927
break;
923928

924929
default:
@@ -2988,7 +2993,9 @@ namespace librealsense
29882993

29892994
std::shared_ptr<uvc_device> v4l_backend::create_uvc_device(uvc_device_info info) const
29902995
{
2991-
bool mipi_device = (0xABCD == info.pid || 0xABCE == info.pid); // D457 development. Not for upstream
2996+
bool mipi_device = (D457_PID == info.pid ||
2997+
D430_GMSL_PID == info.pid ||
2998+
D415_GMSL_PID == info.pid);
29922999
auto v4l_uvc_dev = mipi_device ? std::make_shared<v4l_mipi_device>(info) :
29933000
((!info.has_metadata_node) ? std::make_shared<v4l_uvc_device>(info) :
29943001
std::make_shared<v4l_uvc_meta_device>(info));

src/linux/backend-v4l2.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,11 @@ namespace librealsense
474474
std::vector<std::shared_ptr<buffer>> _md_buffers;
475475
};
476476

477+
478+
const uint16_t D457_PID = 0xABCD;
479+
const uint16_t D430_GMSL_PID = 0xABCE;
480+
const uint16_t D415_GMSL_PID = 0xABCF;
481+
477482
// D457 Development. To be merged into underlying class
478483
class v4l_mipi_device : public v4l_uvc_meta_device
479484
{

0 commit comments

Comments
 (0)