Skip to content

feat: [GPU] Add logic to show GPU info.#497

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:develop/eaglefrom
GongHeng2017:202507241606-eagle-feat2
Jul 24, 2025
Merged

feat: [GPU] Add logic to show GPU info.#497
deepin-bot[bot] merged 1 commit into
linuxdeepin:develop/eaglefrom
GongHeng2017:202507241606-eagle-feat2

Conversation

@GongHeng2017
Copy link
Copy Markdown
Contributor

@GongHeng2017 GongHeng2017 commented Jul 24, 2025

-- In some special computer, the GPU info not show. -- Add logic to show GPU info.
-- Remove duplicate code and improve code readability.

Log: add feature for GPU.
Task: https://pms.uniontech.com/task-view-378987.html

Summary by Sourcery

Add GPU information display by integrating unified EDID parsing and refactoring duplicate code

New Features:

  • Display GPU info by invoking the consolidated EDID parsing logic

Enhancements:

  • Move EDID parsing into CommonTools and remove redundant static function
  • Improve code readability by including a shared parser and updating imports

-- In some special computer, the GPU info not show.
-- Add logic to show GPU info.
-- Remove duplicate code and improve code readability.

Log: add feature for GPU.
Task: https://pms.uniontech.com/task-view-378987.html
@deepin-ci-robot
Copy link
Copy Markdown

deepin pr auto review

关键摘要:

  • parseEDID 函数被移除,但 CommonTools::parseEDID 函数未提供,可能导致编译错误。
  • parseEDID 函数中的 QProcess 使用了 -1 作为 waitForFinished 的参数,这可能会导致程序在等待进程完成时无限期阻塞。

是否建议立即修改:

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Jul 24, 2025

Reviewer's Guide

This PR refactors GPU information extraction by removing the in-class EDID parser and delegating that logic to a shared CommonTools implementation. It adds the necessary header, deletes the duplicate static function, and updates the generatorMonitorDevice method to invoke CommonTools::parseEDID.

Sequence diagram for GPU info extraction using CommonTools::parseEDID

sequenceDiagram
    participant HWGenerator
    participant CommonTools
    participant DeviceMonitor
    participant DeviceManager
    HWGenerator->>CommonTools: parseEDID(allEDIDS_all, interface)
    CommonTools->>DeviceMonitor: setInfoFromEdid(mapInfo)
    CommonTools->>DeviceManager: addMonitor(device)
Loading

Class diagram for HWGenerator and CommonTools after GPU info refactor

classDiagram
    class HWGenerator {
        +void generatorMonitorDevice()
        +void getMemoryInfoFromLshw()
    }
    class CommonTools {
        +static void parseEDID(QStringList allEDIDS, QString input)
    }
    HWGenerator ..> CommonTools : uses
Loading

File-Level Changes

Change Details Files
Refactored EDID parsing logic to use shared utility instead of local implementation
  • Added include for commontools.h
  • Removed static parseEDID function implementation
  • Replaced parseEDID call with CommonTools::parseEDID in generatorMonitorDevice
deepin-devicemanager/src/GenerateDevice/HWGenerator.cpp

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@deepin-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: GongHeng2017, max-lvs

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@GongHeng2017
Copy link
Copy Markdown
Contributor Author

/forcemerge

@deepin-bot deepin-bot Bot merged commit 553f3a9 into linuxdeepin:develop/eagle Jul 24, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants