Giter VIP home page Giter VIP logo

Comments (15)

terrymacdonald avatar terrymacdonald commented on May 29, 2024 1

OK, So after a bit more development I'm here:

  • Develop code to get the current configuration when the Eyefinity is not in use, and store it in a Display Profile.

To give an idea of the amount of work it takes to add AMD support, we're at 3200 lines of additional code so far :). I'm expecting to be closer to 9,000 when I'm finished AMD support, but we will find out the exact amount when we get there!

from displaymagician.

terrymacdonald avatar terrymacdonald commented on May 29, 2024

I've started an amd-eyefinity-support branch which will contain the work as I slowly ship away at AMD support. The process I'll try to use at this stage is:

  • Learn how P/Invoke works
  • Learn how to load AMD ADL library from C#
  • Learn how to pass data between managed and unmanaged code
  • Get DisplayMagician to load and get a list of adapters on my test system
  • Start looking around the data returned by various functions to see what I can use
  • Find out how to get a list of all display adapters that the OS knows about (avoiding AMD Eyefinity if enabled)
  • Develop code to create AMD display Identifiers
  • Develop code to get the current configuration when the EYefinity is not in use, and store it in a Display Profile.
  • Develop code to get the current configuration when the EYefinity IS in use, and store it in a Display Profile.
  • Develop code to get an AMD Display Profile configuration when the EYefinity is not in use, and enable it
  • Develop code to get an AMD Display Profile configuration when the EYefinity IS in use, and enable it
  • Refactor NVIDIA driver code to a similar level of extraction as the AMD codebase to allow for future video card vendors
  • Add HDR support to AMD Display Profiles
  • Add HDR support to NVIDIA Display Profiles
  • Add HDR support to Windows-only Display Profiles (if possible?)

from displaymagician.

terrymacdonald avatar terrymacdonald commented on May 29, 2024

After a few weeks work I am currently at here:

  • Learn how P/Invoke works
  • Learn how to load AMD ADL library from C#
  • Learn how to pass data between managed and unmanaged code
  • Get DisplayMagician to load and get a list of adapters on my test system
  • Start looking around the data returned by various functions to see what I can use
  • Find out how to get a list of all display adapters that the OS knows about (avoiding AMD Eyefinity if enabled)

I'm estimating 2 months more work in order to get AMD Eyefinity support built.

I will need people to test that this works, so if you are interested, please leave your github name in another comment below this and I'll ping you when the first alphas are ready to test!

from displaymagician.

terrymacdonald avatar terrymacdonald commented on May 29, 2024

Another update! So I've been chipping away at the AMD code and trying to integrate it into the DisplayProfile, but I've noticed that the DisplayProfiles are designed specifically for the NVIDIA and Windows CCD library support developed by Soroush. This gives me two options:

  • Create my own AMD library that will emulate the same Paths structure that Soroush has used for his libraries; OR
  • Refactor the video card library code for all 3 video card libraries to separate them out, so that there is common code across all three of them, but individual overrides where it makes sense.

After a lot of deliberation, I decided to refactor the video code to separate the video card libraries out. This will allow me to add additional video card support more easily in the long term (e.g, Intel) as well as hopefully make the overall program size smaller without the need to use external libraries.

The big downside, is that I now have to refactor NVIDIA and Windows CCD libraries, and I'll probably have to create some more P/Invoke libraries specifically for those functions I need in both of those video cards. This is a LOT more work. I'm also planning on adding HDR detection (see #20) to the DisplayProfiles, so you'll be able to store the HDR setting within your DisplayProfile, and DisplayMagician will make the required changes when it swaps!

Another large downside is that I will need to change the DisplayProfile file format SO much that I will have to move to a new Display Profile file format. This means that DisplayMagician v2.0.0 will not support the older file format. Everyone will need to recreate their DisplayProfile again from scratch, as there is just no way for me to derive the information I need from the existing file format. I really do think that the

And that doesn't even include the extra work I need to do to update the Profile Icons, Display Views, Profile Items and other classes to support the new functionality.

So as you can see, there is quite a bit of work to do. It will take a while, but hopefully the flexibility that the end result gives me will be worth it in the end.

I'll keep the v2.0.0 github milestone updated with the estimated date this functionality will all arrive, but please don't be surprised if it slips. Life can sometimes get in the way, as well as the myriad of bugs I have to squash, code I have to write and test, and video card SDK documentation I have to read. So please bear with me as I work through all this stuff. It'll hopefully be worth the wait!

from displaymagician.

terrymacdonald avatar terrymacdonald commented on May 29, 2024

Oh, I forgot one other thing. I wont enable automatic upgrade from DisplayMagician v1.x to v2.0.0. This is because it is a breaking change. A lot of the people using DisplayMagician will find v1.x series works fine. You will only want to upgrade to v2.0.0 if you have an AMD card, or if you use HDR.

So, I plan on having DisplayMagician v2.x upgrade it's own 2.x version, and will ask the 1.x users to manually upgrade themselves. I will do that by releasing a v1.1.5 version of DisplayMagician that will tell all users that v2.0.0 is available, but they need to manually go an upgrade, and that they will have to recreate their Display Profiles and update their Shortcuts to use those new DisplayProfiles.

from displaymagician.

terrymacdonald avatar terrymacdonald commented on May 29, 2024

I just struck some more tricky problems. Changing the DisplayProfile structure meant that the logic for creating Profile Bitmaps and Profile Icons broke. So I had to invent a new way to store display layouts in a standardised way independent of the individual video card libraries. I can up with a Screen structure that seems to work ok.

I then had to build the ability for that structure to be regenerated when a profile was stored and then loaded back in. And then I had to build the ability for the Screen structure to be populated by the actual data grabbed from the AMD video card driver.

Once that was done, then it was getting the ProfileRepository to successfully load the profiles, and to understand what the AMDProfileItem was, and to correctly populate the Screen structure each time the profile was loaded (this is likely to be enhanced at a later date to store and reuse the bitmaps). And then onto the logic that detects whether a profile is valid to be used. This had to be redesigned as well so that it handled the AMD specific profile items.

And then, the ability for the profile to actually be applied. This is the bit I'm working on at the moment. I needed to update the Program class to create and execute an AMD specific task if the DisplayProfile was a display specific profile. I have just finished creating the required scaffolding to allow this to actually happen.

So what's next? Well, I'm still only at the point that I can create an AMD-specific DisplayProfile and save it to JSON, and then load up that same JSON and be able to start to apply an AMD-specific display configuration..... but

  • The DisplayProfile only contains a guess at what AMD information I'll need stored to be able to apply a display config
  • The AMD ADL library file I've created doesn't include all the functions to Set the displays to the right functions
  • Neither the Getting or Setting of AMD configs currently support AMD Eyefinity (which is the whole point of doing this!!!)

As you can see there is a metric ton of work still to go on this Display Profile revamp. And that's not even including the fact that I need to replicate this work for NVIDIA and Windows CCD libraries before I'll be able to release anything.

And then of course I will need some help to test the AMD functionality in the real world. I only have access to a crappy old AMD HD7790 with two outputs. I cannot test many of the DisplayMagician features as I need at least 3 screens to see how things work. I need someone with an older AMD video card to provide it to me in order to fully test the functionality.

So if you have a one of the following cards supported by AMD Radeon Software Adrenalin 21.6.1 or later and you don't need it, then please consider donating it to this project. Compatible discrete video cards are listed below:

  • Radeon™ RX 6900/6800/6700 Series Graphics
  • Radeon™ RX 5700/5600/5500/5300 Series Graphics
  • Radeon™ VII
  • Radeon™ RX Vega Series Graphics
  • AMD Radeon™ Pro Duo
  • Radeon™ RX 500 / Radeon 500X Series Graphics
  • Radeon™ RX 400 Series Graphics

I would prefer a slower card rather than something faster as I don't need it for speed, I only need it to test DisplayMagician Compatibility.

Additionally, if you are running an AMD Card yourself, and you're able to test, then please comment below and start following this issue. I will be asking for help in a 3-4 weeks to test a special alpha version of DisplayMagician. As my AMD card is so hamstrung I need help from the Internet :). So please leave your name below.

from displaymagician.

terrymacdonald avatar terrymacdonald commented on May 29, 2024

OK - so an update! I've created and tested the library for manipulating any WDDM compatible video card (i.e 99.9% of them) through the Windows Display Driver Model (the CCD interface). It works fine, and has been incorporated into a new test programme called CCDInfo available here: https://github.com/terrymacdonald/CCDInfo

Now with that bit done, I can continue working on the AMD driver library. I am part way there, having created a new C# ADL library and wrapper that at least works, but I am now adding the SLS (Eyefinity) functionality into the ADL library and figuring out how it all works. The AMD documentation is woeful, so I'm having to figure out how it works myself.

My plan is to use AMD specific functions for the SLS and AMD HDR functionality, and reuse the Windows CCD library for the display layout and Windows HDR settings. Testing will tell me whether that's a good strategy, but that's where I'm headed :).

from displaymagician.

terrymacdonald avatar terrymacdonald commented on May 29, 2024

Another wee little update. I've managed to manipulate my AMD video card to set and unset an AMD Eyefinity configuration, but the problem is that a couple of AMD ADL provided driver functions don't appear to be working. These are unfortunately both critical functions that I need to use to get the Eyefinity configuration so I can save it for later :(.

I've asked for help from the ADL development team, and I'm hopeful they'll be able to provide some help, or a fix. In my testing it really seems like there is either an error in the ADL function, or an error in the documentation. I even resorted to trying to reverse engineer the DLL to identify where the error is coming from but sadly my skill set only stretches so far....

Hopefully the AMD ADL team come back to me quickly, as I think I now understand how I'm going to get this AMD Eyefinity stuff to work! I would be extremely sad if AMD themselves are the reason that I'm not able to complete this.

from displaymagician.

terrymacdonald avatar terrymacdonald commented on May 29, 2024

OK - In the month since I last posted in this issue, I've been solidly working on creating a new bespoke NVIDIA library that interrogates NVIDIA video cards and records the Mosaic/Surround configurations and HDR configurations from them, and then uses the Windows CCD library to records screen layouts. That is nearly ready to be integrated into DisplayMagician.

AMD Eyefinity support will be added once I've integrated NVIDIA into DisplayMagician.

from displaymagician.

terrymacdonald avatar terrymacdonald commented on May 29, 2024

Another update. The NVIDIA library is working fine and in integrated into DisplayMagician v2.0.0 and seems to be working, so far anyways. Next step is to have another attempt at the AMD ADL library. This will take a bit to set up again, as I need to remove my NVIDIA video card and drivers, and get the AMD card and drivers installed and working.

I think with the extra experience I have with using P/Invoke to integrate with external vide driver DLLs I might be able to fix the issue I was having with AMD ADL before. We'll soon see :).

from displaymagician.

terrymacdonald avatar terrymacdonald commented on May 29, 2024

And another update. This has been a monster challenge, but I think I'm nearing the end of the NVIDIA chapter at least. Things that the new DisplayMagician can do:

  • Swap between surround and non-surround profiles within about 14 seconds
  • Handle surround and non-surround screens together
  • Works with NVIDIA mosaic cards now
  • Uses the PCI video card vendor ID to recognise NVIDIA and AMD vendors, and sets it's driver mode accordingly
  • Can be 'forced' to use a different video card mode if needed (unlikely to be used, but hey, why not)
  • Can set/clear a Desktop Background per profile if you want
  • Stores and applies Windows HDR and NVIDIA HDR settings
  • Records all settings provided by the NVIDIA driver and windows drivers under Windows 10, meaning that you display refresh settings are stored and set, as are bezel distances, or any other weird and wonderful settings you creative users are able to configure :)

But at present there are still bits I have to finish before I can craft any sort of production ready release:

  • It is very slow to load. I've identified this is due to DisplayMagician keeping on calling the video card libraries. I need to implement some caching to ensure that the video detection is only run at programme launch and when screen layout changes in some way.
  • I need to add AMD library support. This is the core reason why I started this journey, so it seems a little disingenuous to release DisplayMagician without this!
  • I need to add a nice message that popups when an old DisplayMagician file is detected, that informs the user that this is a new version of DisplayMagician that uses a brand new DisplayProfile format that will require them to create a brand new set of Display Profile layouts.
  • I need to test, and to provide my beta testers an early release of the software so that I iron out any bugs before a general release.
  • I need to add the ability to test the upgrade mechanism without upgrading the production upgrade functionality. This is needed so I can iron out any issues before a general release. Very important as DisplayMagician now has over 1500 users!

And I think that's about it!

Some cool things to come for sure, and it's taken a lot of hard work to get this close. Another little while and we're hopefully good to go!

Thanks
Terry

from displaymagician.

terrymacdonald avatar terrymacdonald commented on May 29, 2024

Getting closer! Today is a fairly momentous day, as I managed to get the AMD library completed and (partially) integrated into DisplayMagician! There are a few missing features (like the profile layout icons don't work) but this means that DisplayMagician can now support, NVIDIA Surround, AMD Eyefinity and normal windows displays! It handles NVIDIA and AMD HDR, as well as Windows HDR. The graphics bits are working fine!

The problem now, is ironing out all the bugs I've introduced while integrating the new video libraries, and then squashing all the bugs that my faithful users have reported, and then finally adding some more required changes to the way that DisplayMagician works to enable a smooth migration path from DisplayMagician v1.1.4 to DisplayMagician v2.0.0.

It's a big step forward, but there is just so much more to do!

Terry

from displaymagician.

terrymacdonald avatar terrymacdonald commented on May 29, 2024

So I thought people would like to see this :)

image

Yes! Thanks to @scowling's testing, and my hard work, we now have a fully functioning, robust AMD Eyefinity video library. Makes me very happy!

from displaymagician.

terrymacdonald avatar terrymacdonald commented on May 29, 2024

I'll close this issue for now, as the code is ready to go when I release DisplayMagician v2.0.0.

from displaymagician.

terrymacdonald avatar terrymacdonald commented on May 29, 2024

Great news! DisplayMagician v2.0.1 has been released, and it should fix this very issue. Please test it out, and if you still have any issues please log a new issue. You can get DIsplayMagician v2.0.1 from here: https://github.com/terrymacdonald/DisplayMagician/releases/tag/v2.0.1

I'm closing this issue as the fix is in DisplayMagician v2.0.1, and I need to clear out the completed issues so I am able to work on the new issues that come in.

Thanks
Terry

from displaymagician.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.