microsoft / microsoft/Windows-driver-samples

[indirect display driver (IDD)] Question: dynamic resolution support and selection at runtime

Open
#1,400 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
7.8k
Forks
5k
Avg merge
3d 17h
Merged PRs (30d)
7

Description

I have an IDD (non remote) that is supposed to support and select new resolutions at runtime. The idea is that the user resizes their local window, the IDD receives the new resolution, which, of course, can be any value and sets it. But i still want to keep a few defaul resolution e.g: 1280x720, 1600x1200, 1920x1080... so the user can select those manually. So my two options to archive this would be:

1. Hot Plug the monitor with a new preferred resolution in the EDID. But every hot plug seems to create new registry entries. Windows automatically sets the preferred resolution for a while until there are too many registry entries; then a random resolution is set. Another downside is that since the monitor is gone for a short amount, a msft display is enabled and open application windows get thrown around.

Image

2. Use [IddCxMonitorUpdateModes](https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/iddcx/nf-iddcx-iddcxmonitorupdatemodes) to update the modes at runtime and use a userspace app to select the resolution. I never got this properly to work. If I call [IddCxMonitorUpdateModes](https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/iddcx/nf-iddcx-iddcxmonitorupdatemodes) with the list of old(static) and the new resolution, the monitor goes black for a blink and then is back. But the new resolution does not appear in the windows display settings menu. Also, if I try to set the resolution with [SetDisplayConfig](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setdisplayconfig), I can only set the sourceMode and not targetMode otherwise the function throws an error. But it seems I also have to set it to targetMode, otherwise the image is distorted. Am I missing something here? The only way this somewhat works is by only sending the preferred resolution, but not the static ones.
I assume that the second option makes more sense. if it works?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the IddCxMonitorUpdateModes and SetDisplayConfig documentation, then compare their handling of source and target modes with the IDD sample's runtime mode flow. Reproduce the update using the existing static and preferred resolutions, and verify the result in Windows display settings and on screen without hot-plugging the monitor.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.