Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • xserver xserver
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 935
    • Issues 935
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 122
    • Merge requests 122
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

Due to an influx of spam, we have had to impose restrictions on new accounts. Please see this wiki page for instructions on how to get full permissions. Sorry for the inconvenience.

  • xorgxorg
  • xserverxserver
  • Merge requests
  • !971

xfree86: Fix xf86Entities's xf86_platform_device pointing when udl screen unpluging.

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open ydc-dadada requested to merge ydc-dadada/xserver:work into master Sep 05, 2022
  • Overview 1
  • Commits 2
  • Pipelines 4
  • Changes 1

When a computer has a usb controller and a discrete graphics card, and the device number of the pci bus where the usb controller is located is smaller than the discrete graphics card, Xorg will first identify the udl screen connected to the usb controller and then identify the discrete graphics card when it starts.

So the first member of xf86_platform_devices is the device information of the udl screen. And the second member is the information about the discrete graphics card.

Because the udl screen cannot be used as the main card, the xf86platformProbeDev function first points xf86Entities[0]->bus.id.plat to xf86_platform_devices[1]. Then point xf86Entities[1]->bus.id.plat to xf86_platform_devices[0].

When the udl screen is unplugged, the xf86_remove_platform_device function will reduce the members of the xf86_platform_devices array. At this time, there is only one member of xf86_platform_devices[], and xf86_platform_devices[0] saves the device information of the discrete graphics card.

But the address pointed to by xf86Entities[i]->bus.id.plat has not been changed. xf86Entities[1]->bus.id.plat = &xf86_platform_devices[0]; This makes xf86Entities[1] save the information of the discrete graphics card, but use the state of the udl screen. It makes it invalid to plug and unplug the udl screen again.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: work