Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

修复显卡名称带空格时(刚出的APU集显)字符串分割错误导致的设置失败 #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

YihaoPeng
Copy link

@YihaoPeng YihaoPeng commented Aug 6, 2020

考虑如下命令输出,来自我的华硕天选FA506笔记本(AMD Ryzen 4900h带集显 + RTX2060):

$ xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x1e8 cap: 0x1, Source Output crtcs: 4 outputs: 2 associated providers: 1 name:NVIDIA-0
Provider 1: id: 0x45 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 4 outputs: 2 associated providers: 1 name:Unknown AMD Radeon GPU @ pci:0000:06:00.0

其中Unknown AMD Radeon GPU @ pci:0000:06:00.0是我的集显名称,5.7.0版本内核带的开源驱动还没有识别这个显卡,所以名称长这样,带有好几个空格。

如果用原来的分割方法,显卡名称就变成了0000setprovideroutputsource也就会失败。

新方法可以正确获得GPU的完整名称Unknown AMD Radeon GPU @ pci:0000:06:00.0,设置可以成功。


图1:xrandr --listproviders输出:
截图录屏_选择区域_20200806215656

图2:修改前只有独显外接的屏幕亮:
TIM图片20200806224412

图3:旧版本的执行结果:
截图录屏_选择区域_20200806215452

图4:修改后可以同时驱动内屏和外接屏幕了:
TIM图片20200806224306

Consider the following command output:

    $ xrandr --listproviders
    Providers: number : 2
    Provider 0: id: 0x1e8 cap: 0x1, Source Output crtcs: 4 outputs: 2 associated providers: 1 name:NVIDIA-0
    Provider 1: id: 0x45 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 4 outputs: 2 associated providers: 1 name:Unknown AMD Radeon GPU @ pci:0000:06:00.0

Cutting "Unknown AMD Radeon GPU @ pci:0000:06:00.0" with the original method will get "0000", and setprovideroutputsource will fail.

The new method can get the complete GPU name.
Copy link

@XMuli XMuli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

刚查, 本仓库已经目前已经没有使用了(2020-12-15)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants