Screen modes and monitors
  • MDW
  • Order of the Butterfly
    Order of the Butterfly
    MDW
    Posts: 496 from 2003/7/25
    From: Wroclaw, Poland
    I have a slightly unusual question about display modes. Maybe I am trying to do something that is not really necessary, but I would still like to ask. I hope I can explain it clearly. :) :)

    When I connect a TV to my PowerBook using DVI and enumerate all available display modes, the system returns a single list that contains modes for both displays: the internal PowerBook screen and the external TV.
    This works correctly, but I would like to separate these modes into two groups - one group per display.
    The problem is that I cannot determine which mode belongs to which monitor.

    For example:

    This belongs to the PowerBook internal display:
    Code:
    mode: 1440x960x32 (1083310162)
    nameInfo: "Radeon9700Mob 24Bit 1440 x 960"


    This belongs to the external TV:
    Code:
    mode: 1920x1080x32 (1083318353)
    nameInfo: "Radeon9700Mob.1 24Bit 1920x1080"


    The only visible difference is the device name (provided by NameInfo struct):
    "Radeon9700Mob" vs "Radeon9700Mob.1".
    But I don’t want to "parse" the name and check if it ends with “.1”, because that is not safe or reliable. That feels like a hacky solution for lamers. ;)

    I can not find any documented field that clearly associates a mode with a specific monitor, so parsing the name string does not feel like a reliable solution.
    I tried querying additional information for each mode:
    Code:
    struct DimensionInfo dimensionInfo;
    struct MonitorInfo monitorInfo;
    struct NameInfo nameInfo;

    ULONG dimensionInfoRes = GetDisplayInfoData(NULL, &dimensionInfo, sizeof(struct DimensionInfo), DTAG_DIMS, modeID);
    ULONG monitorInfoRes = GetDisplayInfoData(NULL, &monitorInfo, sizeof(struct MonitorInfo), DTAG_MNTR, modeID);
    ULONG nameInfoRes = GetDisplayInfoData(NULL, &nameInfo, sizeof(struct NameInfo), DTAG_NAME, modeID);


    But neither DimensionInfo nor MonitorInfo seems to contain any identifier that links the mode to a specific display.

    Is there a proper or recommended way to determine which display a mode belongs to?

    All screen modes on my machine:
    Code:
    mode: 1440x960x8 (1083310080)
    nameInfo: "Radeon9700Mob 8Bit 1440 x 960"

    mode: 720x480x8 (1083310081)
    nameInfo: "Radeon9700Mob 8Bit 720 x 480"

    mode: 320x240x8 (1083310082)
    nameInfo: "Radeon9700Mob 8Bit 320 x 240"

    mode: 640x480x8 (1083310083)
    nameInfo: "Radeon9700Mob 8Bit 640 x 480"

    mode: 1440x960x8 (1083310095)
    nameInfo: "Radeon: TestScreen"

    mode: 1440x960x15 (1083310128)
    nameInfo: "Radeon9700Mob 15Bit 1440 x 960"

    mode: 720x480x15 (1083310129)
    nameInfo: "Radeon9700Mob 15Bit 720 x 480"

    mode: 320x240x15 (1083310130)
    nameInfo: "Radeon9700Mob 15Bit 320 x 240"

    mode: 640x480x15 (1083310131)
    nameInfo: "Radeon9700Mob 15Bit 640 x 480"

    mode: 800x600x15 (1083310132)
    nameInfo: "Radeon9700Mob 15Bit 800 x 600"

    mode: 1024x768x15 (1083310133)
    nameInfo: "Radeon9700Mob 15Bit 1024 x 768"

    mode: 1440x960x15 (1083310143)
    nameInfo: "Radeon: TestScreen"

    mode: 1440x960x16 (1083310144)
    nameInfo: "Radeon9700Mob 16Bit 1440 x 960"

    mode: 720x480x16 (1083310145)
    nameInfo: "Radeon9700Mob 16Bit 720 x 480"

    mode: 320x240x16 (1083310146)
    nameInfo: "Radeon9700Mob 16Bit 320 x 240"

    mode: 640x480x16 (1083310147)
    nameInfo: "Radeon9700Mob 16Bit 640 x 480"

    mode: 800x600x16 (1083310148)
    nameInfo: "Radeon9700Mob 16Bit 800 x 600"

    mode: 1024x768x16 (1083310149)
    nameInfo: "Radeon9700Mob 16Bit 1024 x 768"

    mode: 1440x960x16 (1083310159)
    nameInfo: "Radeon: TestScreen"

    mode: 720x480x32 (1083310160)
    nameInfo: "Radeon9700Mob 24Bit 720 x 480"

    mode: 320x240x32 (1083310161)
    nameInfo: "Radeon9700Mob 24Bit 320 x 240"

    mode: 1440x960x32 (1083310162)
    nameInfo: "Radeon9700Mob 24Bit 1440 x 960"

    mode: 640x480x32 (1083310163)
    nameInfo: "Radeon9700Mob 24Bit 640 x 480"

    mode: 800x600x32 (1083310164)
    nameInfo: "Radeon9700Mob 24Bit 800 x 600"

    mode: 1024x768x32 (1083310165)
    nameInfo: "Radeon9700Mob 24Bit 1024 x 768"

    mode: 720x480x32 (1083310175)
    nameInfo: "Radeon: TestScreen"

    mode: 3840x2160x8 (1083318272)
    nameInfo: "Radeon9700Mob.1 8Bit 3840x2160"

    mode: 1920x1080x8 (1083318273)
    nameInfo: "Radeon9700Mob.1 8Bit 1920x1080"

    mode: 3840x2160x15 (1083318320)
    nameInfo: "Radeon9700Mob.1 15Bit 3840x2160"

    mode: 1920x1080x15 (1083318321)
    nameInfo: "Radeon9700Mob.1 15Bit 1920x1080"

    mode: 3840x2160x16 (1083318336)
    nameInfo: "Radeon9700Mob.1 16Bit 3840x2160"

    mode: 1920x1080x16 (1083318337)
    nameInfo: "Radeon9700Mob.1 16Bit 1920x1080"

    mode: 3840x2160x32 (1083318352)
    nameInfo: "Radeon9700Mob.1 24Bit 3840x2160"

    mode: 1920x1080x32 (1083318353)
    nameInfo: "Radeon9700Mob.1 24Bit 1920x1080"
  • »30.01.26 - 15:49
    Profile Visit Website
  • MorphOS Developer
    jacadcaps
    Posts: 3261 from 2003/3/5
    From: Canada
    The APIs required to do this will be part of the 3.20 SDK (intuition.library).
  • »30.01.26 - 18:11
    Profile Visit Website
  • MDW
  • Order of the Butterfly
    Order of the Butterfly
    MDW
    Posts: 496 from 2003/7/25
    From: Wroclaw, Poland
    Quote:

    jacadcaps wrote:
    The APIs required to do this will be part of the 3.20 SDK (intuition.library).

    It's nice that something like this will be added in MOS 3.20.
    Right now it is not a problem for me. On MorphOS I can simply show the user the standard screen mode requester, and on other systems I can handle it in a more custom way.
    Thanks for the answer.
  • »30.01.26 - 20:46
    Profile Visit Website