Adding Integer Scaling Toggle to Legion Space

Hey Lenovo,

My name is ProjectSBC and ive been developing handheld software for some time. Ben Myers told me integer scaling will be enabled in the upcoming graphics driver. This is good, it means it can be toggled from AMD control panel. I would suggest adding integer scaling to the quick access menu. This can be done via AMD's ADLX SDK. I already created the code and compiled into a DLL, but i likely can't share that here so here is my code below.

I would love to help you improve and develop Legion Space, and i'm happy to do the work solo and share the code for whatever you would like to implement, so you can do it without me seeing your source code. This ADLX dll is an example of the support I would like to deliver to Lenovo.

Edit: If you are from the Chinese software team and reading this, I can speak some Mandarin (and some Cantonese)! I also have several of the popular chinese social media apps too. Should be easy to talk with you Slight smile

#include "SDK/ADLXHelper/Windows/Cpp/ADLXHelper.h"
#include "SDK/Include/IDisplaySettings.h"
#include "SDK/Include/IDisplays.h"

#define ADLX_DisplaySettings _declspec(dllexport)

extern "C" {
    using namespace adlx;
    static ADLXHelper g_ADLXHelp;

    ADLX_DisplaySettings bool HasIntegerScalingSupport()
    {
        // Define return code
        ADLX_RESULT  res = ADLX_FAIL ;

        // Initialize ADLX
        res = g_ADLXHelp.Initialize();
        if (ADLX_SUCCEEDED (res))
        {
            // Get display service
            IADLXDisplayServicesPtr displayService;
            res = g_ADLXHelp.GetSystemServices()->GetDisplaysServices(&displayService);
            if (ADLX_SUCCEEDED (res))
            {
                // Get display list
                IADLXDisplayListPtr displayList;
                res = displayService->GetDisplays(&displayList);
                if (ADLX_SUCCEEDED  (res))
                {
                    // Inspect for the first display in the list
                    adlx_uint it = 0;
                    IADLXDisplayPtr display;
                    res = displayList->At(it, &display);
                    if (ADLX_SUCCEEDED (res))
                    {
                        IADLXDisplayIntegerScalingPtr displayIntegerScaling;
                        res = displayService->GetIntegerScaling(display, &displayIntegerScaling);

                        if (ADLX_SUCCEEDED(res))
                        {
                            adlx_bool supported = false;
                            res = displayIntegerScaling->IsSupported(&supported);
                            return supported;
                        }

                        
                    }
                }
                else
                {
                    
                }
            }
            else
            {
                // Destroy ADLX
                res = g_ADLXHelp.Terminate ();
              
            }
        }
        else
        {
           
        }

        // Destroy ADLX
        res = g_ADLXHelp.Terminate();
      
    }

    ADLX_DisplaySettings bool IsIntegerScalingEnabled()
    {
        // Define return code
        ADLX_RESULT  res = ADLX_FAIL ;

        // Initialize ADLX
        res = g_ADLXHelp.Initialize();
        if (ADLX_SUCCEEDED (res))
        {
            // Get display service
            IADLXDisplayServicesPtr displayService;
            res = g_ADLXHelp.GetSystemServices()->GetDisplaysServices(&displayService);
            if (ADLX_SUCCEEDED (res))
            {
                // Get display list
                IADLXDisplayListPtr displayList;
                res = displayService->GetDisplays(&displayList);
                if (ADLX_SUCCEEDED  (res))
                {
                    // Inspect for the first display in the list
                    adlx_uint it = 0;
                    IADLXDisplayPtr display;
                    res = displayList->At(it, &display);
                    if (ADLX_SUCCEEDED (res))
                    {
                        IADLXDisplayIntegerScalingPtr displayIntegerScaling;
                        res = displayService->GetIntegerScaling(display, &displayIntegerScaling);

                        if (ADLX_SUCCEEDED(res))
                        {
                            adlx_bool supported = false;
                            res = displayIntegerScaling->IsSupported(&supported);
                            return supported;
                        }

                        
                    }
                }
                else
                {
                    
                }
            }
            else
            {
                // Destroy ADLX
                res = g_ADLXHelp.Terminate ();
              
            }
        }
        else
        {
           
        }

        // Destroy ADLX
        res = g_ADLXHelp.Terminate();
      
    }
    ADLX_DisplaySettings int SetIntegerScaling(const int key)
    {
        // Define return code
        ADLX_RESULT  res = ADLX_FAIL ;

        // Initialize ADLX
        res = g_ADLXHelp.Initialize();
        if (ADLX_SUCCEEDED (res))
        {
            // Get display service
            IADLXDisplayServicesPtr displayService;
            res = g_ADLXHelp.GetSystemServices()->GetDisplaysServices(&displayService);
            if (ADLX_SUCCEEDED (res))
            {
                // Get display list
                IADLXDisplayListPtr displayList;
                res = displayService->GetDisplays(&displayList);
                if (ADLX_SUCCEEDED  (res))
                {
                    // Inspect for the first display in the list
                    adlx_uint it = 0;
                    IADLXDisplayPtr display;
                    res = displayList->At(it, &display);
                    if (ADLX_SUCCEEDED (res))
                    {
                        IADLXDisplayIntegerScalingPtr displayIntegerScaling;
                        res = displayService->GetIntegerScaling(display, &displayIntegerScaling);

                        if (ADLX_SUCCEEDED(res))
                        {
                            res = ADLX_FAIL;
                            switch (key)
                            {
                                // Set integer scaling disabled
                            case 0:
                              
                                res = displayIntegerScaling->SetEnabled(false);
                                break;
                                // Set integer scaling enabled
                            case 1:
                              
                                res = displayIntegerScaling->SetEnabled(true);
                                break;
                            default:
                                break;
                            }
                            return res;
                        }

                        
                    }
                }
                else
                {
                    
                }
            }
            else
            {
                // Destroy ADLX
                res = g_ADLXHelp.Terminate ();
              
            }
        }
        else
        {
           
        }

        // Destroy ADLX
        res = g_ADLXHelp.Terminate();
      
    }
}

  • Sent this to them, just FYI

  • Thanks Ben!