Skip to content

Conversation

ngphibang
Copy link
Contributor

@ngphibang ngphibang commented Aug 12, 2025

  • Use normal child nodes for pipes: the pipe nodes are not video interfaces. Describe them as normal child nodes instead of using port/endpoint.
  • Define video device for each pipe instead of only the main dcmipp device so that we can do set/get_ctrl()
  • Another minor typo fix

The driver instance variable name is inst, not n.

Signed-off-by: Phi Bang Nguyen <[email protected]>
@zephyrbot zephyrbot added platform: STM32 ST Micro STM32 area: Video Video subsystem area: Shields Shields (add-on boards) labels Aug 12, 2025
@ngphibang ngphibang changed the title Fix dcmipp devicetree video: fix dcmipp devicetree Aug 12, 2025
@ngphibang ngphibang force-pushed the fix_dcmipp_devicetree branch from 9dcba5b to 1ea37c5 Compare August 12, 2025 11:32
Comment on lines 24 to 25
pipes {
compatible = "st,stm32-dcmipp-pipes";
#address-cells = <1>;
#size-cells = <0>;

port@0 {
pipe_dump: pipe@0 {
reg = <0>;

endpoint {
remote-endpoint-label = "";
bus-type = <VIDEO_BUS_TYPE_PARALLEL>;
};
};
};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

By reviewing #94081, it seems only n6 has multiple pipes and this one has just one pipe ? In this case, pipes {} node is not needed and we can remove compatible string too. Otherwise, need to add an if in the dcmipp driver when retrieving the pipe / pipes:

DT_FOREACH_CHILD_VARGS(DT_INST_CHILD(inst, pipes), DCMIPP_PIPE_INIT_DEFINE, inst);

Choose a reason for hiding this comment

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

Yes, only the N6 has several pipe. Others have single pipe. Is that an issue to keep it as you propose with current patch ?
Aka always have pipes { } and below it one or more pipe@x entries ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Both ways works but I think it is more "correct" to remove the pipes {} node if we are sure that it has only one pipe and in the driver we treat it with #if defined(STM32_DCMIPP_HAS_PIXEL_PIPES) as alreadt done in some other places in the driver ?

Choose a reason for hiding this comment

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

Both ways works but I think it is more "correct" to remove the pipes {} node if we are sure that it has only one pipe and in the driver we treat it with #if defined(STM32_DCMIPP_HAS_PIXEL_PIPES) as alreadt done in some other places in the driver ?

Yes ok for me. Would you update your PR to make this change as well ?

@kartben kartben assigned ngphibang and josuah and unassigned kartben Aug 23, 2025
@avolmat-st
Copy link

Thanks @ngphibang for the patches and sorry for the long delay for review/test/reply. I confirm this looks good to me and is working fine.
One small point, it seems to me that, in the 2nd patch, the

#define STM32_DCMIPP_INIT(inst)                                                                    \

part is all modified while actually the only modification is related to the DT_FOREACH_CHILD_VARGS, making it hard to notice.
Could you maybe only modify minimum amount of lines and all other parts ? (were there another difference apart from the DT_FOREACH_CHILD_VARGS part ?)

@josuah
Copy link
Contributor

josuah commented Sep 8, 2025

When suggesting to repurpose port/endpoint as support to instantiate the pipes, I think I was not understanding DCMIPP well.

After reading the conversations I could grasp it better. The changes make sense to me.

@ngphibang ngphibang force-pushed the fix_dcmipp_devicetree branch from 1ea37c5 to b417504 Compare September 8, 2025 12:39
@ngphibang
Copy link
Contributor Author

Could you maybe only modify minimum amount of lines and all other parts ?

Yes, done.

I added a 3rd commit "drivers: video: dcmipp: Define video device for each pipe" as well.

Otherwise, I encountered a compilation error (due to the 2nd commit):

/home/nxf91161/zephyrproject/zephyr/drivers/video/video_stm32_dcmipp.c:1623:31: error: '#' is not followed by a macro parameter
 1623 | #define STM32_DCMIPP_INIT(inst)****

It took me quite a time to debug but still cannot figure out what does it mean this error (I didn't modify these lines at all ...).

Will come back to this later or would be glad if you can help :-).

@ngphibang ngphibang force-pushed the fix_dcmipp_devicetree branch from b417504 to 40b4625 Compare September 8, 2025 21:30
@ngphibang
Copy link
Contributor Author

Otherwise, I encountered a compilation error (due to the 2nd commit):

The issue is the directive #if defined cannot be used inside a macro as both need to be expanded. Fixed it.

@avolmat-st
Copy link

Thanks @ngphibang for the update. LGTM, could you just update based on @etienne-lms comment and that sounds good for me. Tested ok on MP13 & N6 as well.

The pipe nodes are not video interfaces. Describe them as normal child
nodes instead of using port/endpoint.

Signed-off-by: Phi Bang Nguyen <[email protected]>
Define a video device for each pipe instead for the main dcmipp device
since the pipe is the device that communicates with application
(zephyr,camera chosen node), not the dcmipp device.

This helps to enable camera controls as well.

Signed-off-by: Phi Bang Nguyen <[email protected]>
@ngphibang ngphibang force-pushed the fix_dcmipp_devicetree branch from 40b4625 to 6d8550d Compare September 10, 2025 06:59
Copy link

Copy link

@avolmat-st avolmat-st left a comment

Choose a reason for hiding this comment

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

Thanks @ngphibang !!

Copy link
Contributor

@etienne-lms etienne-lms left a comment

Choose a reason for hiding this comment

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

Looks consistent to me, AFAICT.

@fabiobaltieri fabiobaltieri merged commit 2bfa186 into zephyrproject-rtos:main Sep 10, 2025
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Shields Shields (add-on boards) area: Video Video subsystem platform: STM32 ST Micro STM32
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants