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

Implement NvAPI_GetAssociatedNvidiaDisplayHandle #175

Merged
merged 1 commit into from
May 26, 2024

Conversation

SveSop
Copy link
Contributor

@SveSop SveSop commented May 25, 2024

This is needed to get the NVIDIA Tech demo "Apollo 11 Lunar Landing Demo" running. Downloaded from here:
https://us.download.nvidia.com/downloads/cool_stuff/demos/Setup-Apollo-11-(1.05).exe

@SveSop
Copy link
Contributor Author

SveSop commented May 25, 2024

Did not make any "tests", as i am .. uhm.. not sure how that works i guess.

Copy link
Owner

@jp7677 jp7677 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, very cool and straight forward, nice.

Wrt having a test, it should be very similar to https://github.com/jp7677/dxvk-nvapi/blob/master/tests/nvapi_sysinfo_topo.cpp#L191. In fact, it should look like:

    SECTION("GetAssociatedNvidiaDisplayHandle succeeds") {
        NvDisplayHandle handle1 = nullptr;
        NvDisplayHandle handle2 = nullptr;
        NvDisplayHandle handle3 = nullptr;
        REQUIRE(NvAPI_EnumNvidiaDisplayHandle(0U, &handle1) == NVAPI_OK);
        REQUIRE(NvAPI_EnumNvidiaDisplayHandle(1U, &handle2) == NVAPI_OK);
        REQUIRE(NvAPI_EnumNvidiaDisplayHandle(2U, &handle3) == NVAPI_OK);

        NvDisplayHandle handle;

        REQUIRE(NvAPI_GetAssociatedNvidiaDisplayHandle("Output1", &handle) == NVAPI_OK);
        REQUIRE(handle == handle1);

        REQUIRE(NvAPI_GetAssociatedNvidiaDisplayHandle("Output2", &handle) == NVAPI_OK);
        REQUIRE(handle == handle2);

        REQUIRE(NvAPI_GetAssociatedNvidiaDisplayHandle("Output3", &handle) == NVAPI_OK);
        REQUIRE(handle == handle3);

        REQUIRE(NvAPI_GetAssociatedNvidiaDisplayHandle("Output4", &handle) == NVAPI_NVIDIA_DEVICE_NOT_FOUND);
    }

Could you also please prefix the commit message with nvapi:?

@jp7677 jp7677 merged commit bafc456 into jp7677:master May 26, 2024
2 checks passed
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.

2 participants