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

DRM Writeback connector priority changes #6345

Merged
merged 2 commits into from
Oct 22, 2024

Conversation

6by9
Copy link
Contributor

@6by9 6by9 commented Sep 9, 2024

@jc-kynesim

These should get the 10bittest working on Pi3.

@jc-kynesim
Copy link
Contributor

Good oh! Thanks. Do you want me to test (I'm only going to do the obvious) or are you happy that you've already done that?

dsp3_mux = VC4_SET_FIELD(2, SCALER_DISPCTRL_DSP3_MUX);
if (vc4_crtc->feeds_txp) {
dsp3_mux_pri = VC4_SET_FIELD(3, SCALER_DISPCTRL_DSP3_MUX);
dsp3_mux_pri |= VC4_SET_FIELD(1, SCALER_DISPCTRL_PANIC2);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Any reason for this being 1 (Use panic mode for first two of the frame or if empty) rather than 0 (Fixed priority of 2’b00 (never panic).) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copied from the firmware (middleware/hvs/hvs.c)

   static const uint32_t priority_0 = 0x2;  // panic when <2 lines in FIFO
   static const uint32_t priority_1 = 0x2;  // panic when <2 lines in FIFO
   static const uint32_t priority_2 = 0x1;  // raised but no panic

If you think we can work with never panic, then I'm happy to switch it to that.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The full options are:

0 = Fixed priority of 2’b00 (never panic).
1 = Use panic mode for first two of the frame or if empty.
2 = Use panic mode whenever less than two complete lines in FIFO.
3 = Fixed priority of 2’b11 (always panic).

I don't see this as real time, so I don't think it needs to panic ever.

But there could be a concern that a non-panicking memory access from a plane being fetched for writeback will hold up a following panicking access from a plane needed by HDMI, effectively killing it's priority (I don't believe there's any way to overtake).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I know very little on how the AXI priorities are going to interact, hence just copying the firmware settings.

Happy to take guidance on which to use.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think logically 0 (never panic) makes sense - we are not real time when writing back, and don't want to interfere with actual real time masters like camera.

If we see the theoretical issue of low priority writeback accesses holding off subsequent high priority accesses needed by hdmi, then we can revisit (it will likely have to be the same as hdmi priority) - but I have no evidence of that actually occurring.

So, I'd recommend 0 for this PR.

@6by9
Copy link
Contributor Author

6by9 commented Sep 9, 2024

Good oh! Thanks. Do you want me to test (I'm only going to do the obvious) or are you happy that you've already done that?

Give it the quick tests that you were looking at - I've only done 10bittest -P NV12 -w. I don't see it being affected by anything else, but you never know.

As per my email, there seems to be another issue lurking:
I have just hit a funny one in that I had a DSI display connected. That took HVS channel 2, which is the only one that can feed the transposer. 10bittest then couldn't start as it couldn't get the appropriate channel :-(
The channel allocation code in the kernel was always a little funky and made some assumptions, so it may want to be revisited.

I wasn't going to try fixing that under this PR, but may limit our ability to use writeback generically. That's possibly of more interest to DT than you, but thought it worth flagging.

The transposer/writeback connector should be running with a
lower priority, so shouldn't be factored into the load
calculations.

Signed-off-by: Dave Stevenson <[email protected]>
As the writeback connector doesn't have the same realtime
constraints of a live display, drop the panic priority for it.

Signed-off-by: Dave Stevenson <[email protected]>
@6by9
Copy link
Contributor Author

6by9 commented Oct 22, 2024

I'd forgotten about updating this PR based on popcornmix's request for priority 0. Now done.

@pelwell pelwell merged commit 2e85eb0 into raspberrypi:rpi-6.6.y Oct 22, 2024
12 checks passed
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Oct 22, 2024
See: raspberrypi/linux#6273

kernel: DRM Writeback connector priority changes
See: raspberrypi/linux#6345

kernel: Input: matrix-keypad - don't map irqs when atomic
See: raspberrypi/linux#6427
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Oct 22, 2024
See: raspberrypi/linux#6273

kernel: DRM Writeback connector priority changes
See: raspberrypi/linux#6345

kernel: Input: matrix-keypad - don't map irqs when atomic
See: raspberrypi/linux#6427
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.

4 participants