Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DSO-18376 D4XX HWMC UVC LibRealSense compatibility #120

Merged
merged 1 commit into from
Aug 9, 2022

Conversation

dmipx
Copy link
Contributor

@dmipx dmipx commented Jul 21, 2022

Signed-off-by: Dmitry Perchanov dmitry.perchanov@intel.com

@dmipx dmipx requested review from ev-mp and remibettan July 24, 2022 12:34
Copy link
Contributor

@remibettan remibettan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Several minor changes requested

+
+ ds5_raw_read_with_check(state, DS5_HWMC_DATA, data, tmp_len);
+
+ /* This is needed for librealsense, to align there code with UVC,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines could have been exported to a separate function, in order to make it reusable, and to make the code more readable - but up to you to export it or let it this way.

break;
+ case DS5_CAMERA_CID_HWMC_RW:
+ if (ctrl->p_new.p_u8) {
+ u16 size = *((u8*)ctrl->p_new.p_u8 + 1) << 8;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a comment for the "<<8" - changing the "8" to some const could be also better.

.name = "HWMC",
.type = V4L2_CTRL_TYPE_U8,
- .dims = {1028},
+ .dims = {DS5_HWMC_BUFFER_SIZE + 4},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add some comment for the "size+4" - consider changing the "4" to a const number - its name could be self-explained and avoid the comment.

+ .elem_size = sizeof(u8),
+ .min = 0,
+ .max = 0xFFFFFFFF,
+ .def = 240,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add some comment for the "def = 240" - consider changing the "240" to a const number - its name could be self-explained and avoid the comment.

@dmipx dmipx requested a review from remibettan July 24, 2022 14:40
@dmipx dmipx force-pushed the DSO-18376-hwmc-rw branch from fa3c4ed to 292c202 Compare July 25, 2022 07:23
+ memset(data, 0, DS5_HWMC_BUFFER_SIZE);
+
+ do {
+ msleep_range(1);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pls refactor to apply the sleep in all but the first iteration

- added new volatile CID (offset 32) for set/get HWMC
- Addressing https://rsjira.intel.com/browse/DSO-18376
  [D457][MIPI] Make HWMC work in USB-compatible manner

Signed-off-by: Dmitry Perchanov <dmitry.perchanov@intel.com>
@dmipx dmipx force-pushed the DSO-18376-hwmc-rw branch from 292c202 to 4a249b5 Compare August 2, 2022 12:05
@ev-mp ev-mp merged commit c03aa1f into IntelRealSense:master Aug 9, 2022
@dmipx dmipx deleted the DSO-18376-hwmc-rw branch January 31, 2023 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants