inconsistent #ifdef CSR_HDMI_IN0_FREQ_BASE

5 views
Skip to first unread message

Carl Karsten

unread,
Sep 9, 2019, 4:22:39 AM9/9/19
to hdmi...@googlegroups.com
No idea if this is a problem, I'm just skimming code and noticed the status code is not the same for hdmi_in0 and hdmi_in1
The #endif is in a different place:

clearly see it here:

kinda see it here:

static void status_print(void)
{
unsigned int underflows;
#ifdef CSR_HDMI_IN0_BASE
wprintf(
"input0: %dx%d",
hdmi_in0_resdetection_hres_read(),
hdmi_in0_resdetection_vres_read());
#ifdef CSR_HDMI_IN0_FREQ_BASE
wprintf(" (@" REFRESH_RATE_PRINTF " MHz)",
REFRESH_RATE_PRINTF_ARGS(hdmi_in0_freq_value_read() / 10000));
if(hdmi_in0_status()) {
wprintf(" (capturing)");
} else {
wprintf(" (disabled)");
}
#endif
wputchar('\n');
#endif

#ifdef CSR_HDMI_IN1_BASE
wprintf(
"input1: %dx%d",
hdmi_in1_resdetection_hres_read(),
hdmi_in1_resdetection_vres_read());
#ifdef CSR_HDMI_IN1_FREQ_BASE
wprintf(" (@" REFRESH_RATE_PRINTF " MHz)",
REFRESH_RATE_PRINTF_ARGS(hdmi_in1_freq_value_read() / 10000));
#endif
if(hdmi_in1_status()) {
wprintf(" (capturing)");
} else {
wprintf(" (disabled)");
}
wputchar('\n');
#endif


--
Carl K

Rohit Kumar Singh

unread,
Sep 9, 2019, 5:49:23 AM9/9/19
to hdmi...@googlegroups.com
Hi Carl,

As far as I can tell, the code of the hdmi_in1 is ideally the correct one. 

Reason: The highlighted part (wprint) depends on a peripheral (frequency detector) which may or may not be present in the gateware. So, we include the printf code only if that peripheral (frequency detector for HDMI_IN1) is present in the gateware.

#ifdef CSR_HDMI_IN1_FREQ_BASE
wprintf(" (@" REFRESH_RATE_PRINTF " MHz)",
REFRESH_RATE_PRINTF_ARGS(hdmi_in1_freq_value_read() / 10000));
#endif

Whereas the `hdmi_in1_status()` section of code is dependent on whether `CSR_HDMI_IN1_BASE` is defined or not.

Thanks!

Best regards,
Rohit


--
You received this message because you are subscribed to the Google Groups "hdmi2usb - A HDMI capture solution" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hdmi2usb+u...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/hdmi2usb/CADmzSSh71DtAaSnt1PqDc_dkT-0-yz4xVzOOXCpSD%2BAaN_0Fnw%40mail.gmail.com.

Carl Karsten

unread,
Sep 9, 2019, 1:46:17 PM9/9/19
to hdmi...@googlegroups.com
welp.. I made a branch, made the change, pushed it to my repo, made a PR and it included a bunch of other commits too.   some of them have already been accepted, so I'm not sure what is going on.

I can't figure out how to do a PR with just this one fix.

Can you do it?

On Mon, Sep 9, 2019 at 4:49 AM Rohit Kumar Singh <rohit9...@gmail.com> wrote:
Hi Carl,

As far as I can tell, the code of the hdmi_in1 is ideally the correct one. 

Reason: The highlighted part (wprint) depends on a peripheral (frequency detector) which may or may not be present in the gateware. So, we include the printf code only if that peripheral (frequency detector for HDMI_IN1) is present in the gateware.

#ifdef CSR_HDMI_IN1_FREQ_BASE
wprintf(" (@" REFRESH_RATE_PRINTF " MHz)",
REFRESH_RATE_PRINTF_ARGS(hdmi_in1_freq_value_read() / 10000));
#endif

Whereas the `hdmi_in1_status()` section of code is dependent on whether `CSR_HDMI_IN1_BASE` is defined or not.

Thanks!

Best regards,
Rohit


On Mon, Sep 9, 2019 at 3:22 AM Carl Karsten <ca...@nextdayvideo.com> wrote:
No idea if this is a problem, I'm just skimming code and noticed the status code is not the same for hdmi_in0 and hdmi_in1 noticed the status code is not the same for hdmi_in0 and hdmi_in1

Tim 'mithro' Ansell

unread,
Sep 9, 2019, 4:21:13 PM9/9/19
to hdmi...@googlegroups.com
git rebase -i upstream/master

Select just the commit you want.

Tim 'mithro' Ansell

Carl Karsten

unread,
Sep 9, 2019, 6:54:46 PM9/9/19
to hdmi...@googlegroups.com
carl@twist:~/src/HDMI2USB-litex-firmware/firmware$ git rebase -i tv/master
Successfully rebased and updated refs/heads/fix479.
carl@twist:~/src/HDMI2USB-litex-firmware/firmware$ git push origin fix479
To github.com:CarlFK/HDMI2USB-litex-firmware.git
 ! [rejected]        fix479 -> fix479 (non-fast-forward)
error: failed to push some refs to 'g...@github.com:CarlFK/HDMI2USB-litex-firmware.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

ok... Ill try the hint...

carl@twist:~/src/HDMI2USB-litex-firmware/firmware$ git pull origin master
From github.com:CarlFK/HDMI2USB-litex-firmware
 * branch            master     -> FETCH_HEAD
Merge made by the 'recursive' strategy.
 mocserver/csr_v0.json   |  521 ++++++++++++++++
 mocserver/grep_addrs.py |  163 +++++
 mocserver/moc-server.py |   35 ++
 mocserver/reg_v1.json   | 1556 +++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 2275 insertions(+)
 create mode 100644 mocserver/csr_v0.json
 create mode 100644 mocserver/grep_addrs.py
 create mode 100644 mocserver/moc-server.py
 create mode 100644 mocserver/reg_v1.json


carl@twist:~/src/HDMI2USB-litex-firmware/firmware$ git push origin fix479
To github.com:CarlFK/HDMI2USB-litex-firmware.git
 ! [rejected]        fix479 -> fix479 (non-fast-forward)
error: failed to push some refs to 'g...@github.com:CarlFK/HDMI2USB-litex-firmware.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Are you sure helping me untangle my mess is worth it?






--
Carl K

Tim Ansell

unread,
Sep 9, 2019, 6:56:34 PM9/9/19
to hdmi...@googlegroups.com
git fetch upstream
git rebase -i upstream/master
git push origin branch --force

Tim 'mithro' Ansell

Carl Karsten

unread,
Sep 9, 2019, 7:52:02 PM9/9/19
to hdmi...@googlegroups.com
I think I got it.





--
Carl K
Reply all
Reply to author
Forward
0 new messages