cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

jossgray
Adept II

ADL_Display_Modes_Set giving ADL_ERR_INVALID_PARAM

I'm struggling to get ADL_Display_Modes_Set to work. Constantly getting ADL_ERR_INVALID_PARAM

Would someone be able to let me know what fields in the ADLMode structure are required for this function and what checks are done on that structure so I can find out where I'm going wrong?

Thanks,

Joss

0 Likes
1 Solution
chm
Staff
Staff

Hi,

first you need to determine the Adapter Index (AapterInfo.iAdapterIndex)  and the DisplayLogicalIndex (ADLDisplayInfo.displayID.iDisplayLogicalIndex) that belong to the display. You can do this by enumerating the mapped displays. The best is to first retrieve the current mode and just to update the parameters you want to change. Than you can use the Display_Modes_Set as follow:

nModes   = 0;

ADLMode* pMode    = NULL;

// Get current disply mode information

nADLErrCode = ADL_Display_Modes_Get(iAdapterIndex, DspLogicalIdx, &nModes, &pMode);

if (nADLErrCode == ADL_OK)

{

   pMode[0].iXRes = nHres;
   pMode[0].iYRes = nVres;
   pMode[0].fRefreshRate = (float)Freq;

  

   // set new mode

   nADLErrCode = ADL_Display_Modes_Set(iAdapterIndex, DspLogicalIdx, nModes, pMode);

}

Depending on the parameters you enter for the mode there might still be errors if the mode cannot be applied. E.g. applying a dual link resolution to a display that is connected through single link DVI. But in this case you should get an ADL_ERR an no ADL_ERR_INVALID_PARAM.

Chris

View solution in original post

0 Likes
2 Replies
chm
Staff
Staff

Hi,

first you need to determine the Adapter Index (AapterInfo.iAdapterIndex)  and the DisplayLogicalIndex (ADLDisplayInfo.displayID.iDisplayLogicalIndex) that belong to the display. You can do this by enumerating the mapped displays. The best is to first retrieve the current mode and just to update the parameters you want to change. Than you can use the Display_Modes_Set as follow:

nModes   = 0;

ADLMode* pMode    = NULL;

// Get current disply mode information

nADLErrCode = ADL_Display_Modes_Get(iAdapterIndex, DspLogicalIdx, &nModes, &pMode);

if (nADLErrCode == ADL_OK)

{

   pMode[0].iXRes = nHres;
   pMode[0].iYRes = nVres;
   pMode[0].fRefreshRate = (float)Freq;

  

   // set new mode

   nADLErrCode = ADL_Display_Modes_Set(iAdapterIndex, DspLogicalIdx, nModes, pMode);

}

Depending on the parameters you enter for the mode there might still be errors if the mode cannot be applied. E.g. applying a dual link resolution to a display that is connected through single link DVI. But in this case you should get an ADL_ERR an no ADL_ERR_INVALID_PARAM.

Chris

0 Likes

Thanks, thats got it working now.

Previously I was using an ADLMode from ADL_Display_PossibleModes_Get().

0 Likes