manjaro / mdd

Manjaro Data Donor - WIP
MIT License
12 stars 3 forks source link

feat: fallback to xrandr #4

Closed romangg closed 2 weeks ago

romangg commented 2 weeks ago

In some cases inxi can't find basic graphics data. In this case let's fallback to xrandr to complement the data.

In the future we might additionally look into a fallback to wayland-info. But as a first step the xrandr fallback is sufficient as it is also available on Wayland via Xwayland.

fhdk commented 2 weeks ago

Exerpt of the dry run with the changes

    "graphics": {
        "comp": "kwin_wayland",
        "dri": "radeonsi",
        "gpus": [
            {
                "vendor": "Tul / PowerColor",
                "model": "Advanced Micro Devices [AMD/ATI] Navi 31 [Radeon RX 7900 XT/7900 XTX/7900 GRE/7900M]",
                "driver": "amdgpu"
            }
        ],
        "outputs": [
            {
                "model": null,
                "res": "5120x1440",
                "refresh": null,
                "dpi": null,
                "size": "N/A",
                "mapped": null
            },
            {
                "model": "",
                "res": "5120x1440",
                "refresh": 239.63,
                "dpi": null,
                "size": null,
                "mapped": "DP-2"
            }
        ]
    },

connecting a second monitor

    "graphics": {
        "comp": "kwin_wayland",
        "dri": "radeonsi",
        "gpus": [
            {
                "vendor": "Tul / PowerColor",
                "model": "Advanced Micro Devices [AMD/ATI] Navi 31 [Radeon RX 7900 XT/7900 XTX/7900 GRE/7900M]",
                "driver": "amdgpu"
            }
        ],
        "outputs": [
            {
                "model": null,
                "res": "1920x1080",
                "refresh": null,
                "dpi": null,
                "size": "N/A",
                "mapped": null
            },
            {
                "model": null,
                "res": "5120x1440",
                "refresh": null,
                "dpi": null,
                "size": "N/A",
                "mapped": null
            },
            {
                "model": "",
                "res": "5120x1440",
                "refresh": 239.63,
                "dpi": null,
                "size": null,
                "mapped": "DP-2"
            },
            {
                "model": "",
                "res": "1920x1080",
                "refresh": 143.8,
                "dpi": null,
                "size": null,
                "mapped": "DP-1"
            }
        ]
    },
romangg commented 2 weeks ago

Thanks. Doesn't seem to pick up the matched state. Can you paste your xrandr output and inxi -Gxxx?

fhdk commented 2 weeks ago
 $ xrandr
Screen 0: minimum 16 x 16, current 7040 x 1440, maximum 32767 x 32767
DP-2 connected primary 5120x1440+1920+0 (normal left inverted right x axis y axis) 1193mm x 336mm
   5120x1440    239.63*+
   1920x1440    239.62  
   1600x1200    239.70  
   1440x1080    239.57  
   1400x1050    239.75  
   1280x1024    239.55  
   1280x960     239.55  
   1152x864     239.57  
   1024x768     239.35  
   800x600      239.48  
   640x480      239.21  
   320x240      238.24  
   1920x1200    239.68  
   1680x1050    239.75  
   1440x900     239.56  
   1280x800     239.65  
   1152x720     239.53  
   960x600      239.45  
   928x580      239.49  
   800x500      239.33  
   768x480      239.29  
   720x480      239.35  
   640x400      238.88  
   320x200      238.84  
   2560x1440    239.63  
   2048x1152    239.61  
   1920x1080    239.66  
   1600x900     239.51  
   1368x768     239.44  
   1280x720     239.62  
   1024x576     239.52  
   864x486      239.23  
   720x400      239.07  
   640x350      238.88  
DP-1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 598mm x 336mm
   1920x1080    143.80*+
   1440x1080    143.80  
   1400x1050    143.89  
   1280x1024    143.79  
   1280x960     143.86  
   1152x864     143.75  
   1024x768     143.66  
   800x600      143.83  
   640x480      143.85  
   320x240      142.05  
   1680x1050    143.88  
   1440x900     143.86  
   1280x800     143.67  
   1152x720     143.77  
   960x600      143.72  
   928x580      143.50  
   800x500      143.68  
   768x480      143.69  
   720x480      143.85  
   640x400      143.37  
   320x200      141.40  
   1600x900     143.93  
   1368x768     143.77  
   1280x720     143.67  
   1024x576     143.91  
   864x486      143.63  
   720x400      143.29  
   640x350      143.57 
 $ inxi -Gxxx
Graphics:
  Device-1: Advanced Micro Devices [AMD/ATI] Navi 31 [Radeon RX 7900 XT/7900
    XTX/7900 GRE/7900M] vendor: Tul / PowerColor driver: amdgpu v: kernel
    arch: RDNA-3 pcie: speed: 16 GT/s lanes: 16 ports: active: DP-1,DP-2
    empty: DP-3,HDMI-A-1,Writeback-1 bus-ID: 63:00.0 chip-ID: 1002:744c
    class-ID: 0300
  Display: wayland server: X.org v: 1.21.1.14 with: Xwayland v: 24.1.4
    compositor: kwin_wayland driver: X: loaded: modesetting
    alternate: fbdev,vesa dri: radeonsi gpu: amdgpu d-rect: 7040x1440
    display-ID: 0
  Monitor-1: DP-1 pos: primary,left res: 1920x1080 size: N/A modes: N/A
  Monitor-2: DP-2 pos: right res: 5120x1440 size: N/A modes: N/A
  API: EGL v: 1.5 hw: drv: amd radeonsi platforms: device: 0 drv: radeonsi
    device: 1 drv: swrast gbm: drv: kms_swrast surfaceless: drv: radeonsi
    wayland: drv: radeonsi x11: drv: radeonsi
  API: OpenGL v: 4.6 compat-v: 4.5 vendor: amd mesa v: 24.2.6-arch1.1
    glx-v: 1.4 direct-render: yes renderer: AMD Radeon RX 7900 XTX (radeonsi
    navi31 LLVM 18.1.8 DRM 3.59 6.11.6-1-MANJARO) device-ID: 1002:744c
    display-ID: :0.0
  API: Vulkan v: 1.3.295 layers: 8 surfaces: xcb,xlib,wayland device: 0
    type: discrete-gpu driver: amd device-ID: 1002:744c device: 1
    type: discrete-gpu driver: amd device-ID: 1002:744c
romangg commented 2 weeks ago

Please also paste output of inxi --output json --output-file print -Gxxx

fhdk commented 2 weeks ago
 $ inxi --output json --output-file print -Gxxx
[
    {
        "000#1#0#Graphics":
        [
            {
                "002#0#2#vendor": "Tul / PowerColor",
                "012#0#2#bus-ID": "63:00.0",
                "010#0#3#active": "DP-1,DP-2",
                "006#1#2#pcie": "",
                "001#1#1#Device": "Advanced Micro Devices [AMD/ATI] Navi 31 [Radeon RX 7900 XT/7900 XTX/7900 GRE/7900M]",
                "005#1#2#arch": "RDNA-3",
                "007#0#3#speed": "16 GT/s",
                "014#0#2#class-ID": "0300",
                "008#0#3#lanes": "16",
                "011#0#3#empty": "DP-3,HDMI-A-1,Writeback-1",
                "004#0#3#v": "kernel",
                "013#0#2#chip-ID": "1002:744c",
                "009#1#2#ports": "",
                "003#1#2#driver": "amdgpu"
            },
            {
                "004#0#4#v": "24.1.4",
                "007#1#3#X": "",
                "000#1#1#Display": "wayland",
                "005#1#2#compositor": "kwin_wayland",
                "002#0#3#v": "1.21.1.14",
                "013#0#2#display-ID": "0",
                "008#1#4#loaded": "modesetting",
                "011#1#3#gpu": "amdgpu",
                "003#1#3#with": "Xwayland",
                "001#1#2#server": "X.org",
                "012#0#2#d-rect": "7040x1440",
                "006#1#2#driver": "",
                "010#1#3#dri": "radeonsi",
                "009#0#4#alternate": "fbdev,vesa"
            },
            {
                "018#0#3#modes": "N/A",
                "017#0#3#size": "N/A",
                "016#0#3#res": "1920x1080",
                "015#0#3#pos": "primary,left",
                "014#1#2#Monitor": "DP-1"
            },
            {
                "020#0#3#pos": "right",
                "023#0#3#modes": "N/A",
                "019#1#2#Monitor": "DP-2",
                "021#0#3#res": "5120x1440",
                "022#0#3#size": "N/A"
            },
            {
                "011#1#3#surfaceless": "",
                "002#1#2#hw": "",
                "010#0#4#drv": "kms_swrast",
                "005#1#3#device": "0",
                "006#0#4#drv": "radeonsi",
                "004#1#2#platforms": "",
                "015#1#3#x11": "",
                "016#0#4#drv": "radeonsi",
                "001#0#2#v": 1.5,
                "013#1#3#wayland": "",
                "000#1#1#API": "EGL",
                "012#0#4#drv": "radeonsi",
                "009#1#3#gbm": "",
                "007#1#3#device": "1",
                "003#0#3#drv": "amd radeonsi",
                "014#0#4#drv": "radeonsi",
                "008#0#4#drv": "swrast"
            },
            {
                "009#0#2#display-ID": ":0.0",
                "003#1#2#vendor": "amd mesa",
                "001#0#2#v": "4.6",
                "008#0#2#device-ID": "1002:744c",
                "006#0#2#direct-render": "yes",
                "004#0#3#v": "24.2.6-arch1.1",
                "007#0#2#renderer": "AMD Radeon RX 7900 XTX (radeonsi navi31 LLVM 18.1.8 DRM 3.59 6.11.6-1-MANJARO)",
                "002#0#2#compat-v": "4.5",
                "005#0#2#glx-v": "1.4",
                "000#1#1#API": "OpenGL"
            },
            {
                "011#0#3#device-ID": "1002:744c",
                "008#1#2#device": "1",
                "010#1#3#driver": "amd",
                "006#1#3#driver": "amd",
                "000#1#1#API": "Vulkan",
                "002#0#2#layers": "8",
                "001#0#2#v": "1.3.295",
                "007#0#3#device-ID": "1002:744c",
                "004#1#2#device": "0",
                "009#0#3#type": "discrete-gpu",
                "003#0#2#surfaces": "xcb,xlib,wayland",
                "005#0#3#type": "discrete-gpu"
            }
        ]
    }
]
romangg commented 2 weeks ago

I updated the branch. Can you try again?