Skip to content

upgrade glenfly arise1 series GPU DRM kernel driver to V46#846

Merged
Avenger-285714 merged 1 commit into
deepin-community:linux-6.6.yfrom
yiliang2008:linux-6.6.y
Jun 6, 2025
Merged

upgrade glenfly arise1 series GPU DRM kernel driver to V46#846
Avenger-285714 merged 1 commit into
deepin-community:linux-6.6.yfrom
yiliang2008:linux-6.6.y

Conversation

@yiliang2008
Copy link
Copy Markdown

@yiliang2008 yiliang2008 commented Jun 5, 2025

main changelist in this chance:

1, adjust file format, delete unused tab/space
2, add more arise1 gpu support
3, add some dynamic power-saving code
4, fix some display issue, enhanced compatibility
5, fix some loongarch64 only issue
6, fix build error for risc-v

Summary by Sourcery

Upgrade Glenfly Arise1 series DRM driver to V46: add Arise10D0 support, implement dynamic engine power‐saving and idle detection, extend DP/HDMI compatibility with EDID/SCDC parsing, patch architecture-specific build issues, and perform comprehensive code cleanup and logging refactoring.

New Features:

  • Support for the new Arise10D0 GPU variant
  • Introduce dynamic per-engine power states (E0–E5, AUTO) with a boost API and user-space get/set hooks
  • Implement display idle/busy tracking (flip, cursor, on-screen draw) to drive power-saving state switches
  • Parse HDMI Forum Sink Capability Data (HF-SCDB), patch EDID quirks (e.g., BenQ EL2870U) and fully handle HDMI SCDC flags
  • Expose new kernel callbacks for display acquire/release integrated into fence and splice flows

Bug Fixes:

  • Fix DisplayPort link-training and ePHY tuning for ACE-family chips (software MAUD, swing settings)
  • Resolve EDID/CEA parsing and mode-filter issues across DP/HDMI paths
  • Address build errors and cache-sync bugs on RISC-V and LoongArch64 architectures

Enhancements:

  • Unify and refactor CBios debug logging via cbGetDebugPrefix/cbCheckDebugLevel, remove old back-buffers
  • Clean up formatting, remove unused tabs/spaces, and standardize naming in CBios and Linux KMS code
  • Bump driver version to 25.00.46 and update release metadata

Build:

  • Add conditional compilation for multiple kernel versions and architectures (mmap signatures, aperture, fbdev, modifiers)
  • Fix include paths and macros to support RISC-V, MIPS64, and LoongArch cache operations

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Jun 5, 2025

Reviewer's Guide

This PR upgrades the Glenfly Arise1 DRM driver to version 25.00.46 by adding Arise10D0 support, integrating fine-grained dynamic power-saving across engines, unifying debug/logging, enhancing EDID parsing and display state tracking, refactoring DP link training, and fixing build issues for LoongArch64 and RISC-V.

File-Level Changes

Change Details Files
Add support for Arise10D0 GPU and version bump
  • Introduce PCI ID and chip mask for 0x3D0E
  • Update driver version/date in gf_version.h
  • Report product_name and metrics in gpuinfo
  • Register new device in pciidlist and global chip_id
  • Adjust build params (gf_params.gf_pwm_mode)
linux/gf_version.h
linux/gf_pcie.c
core/global/global.c
core/global/global.h
linux/gf_gpuinfo_proc_read.c
linux/gf_params.c
Implement dynamic engine power-saving and sysfs control
  • Define ENG_POWER_STATE enum and holding logic
  • Implement vidsch_engine_power_state, power_switch and boost
  • Expose power_state attribute in sysfs with get/set hooks
  • Wire core_interface.get/set_power_state and disp_state_update
  • Add sysfs handlers and kernel_interface glue
core/vidsch/vidsch_dfs_e3k.c
core/vidsch/vidsch.c
core/kernel_interface.c
linux/gf_sysfs.c
core/perfevent/perfevent.c
Refactor debug/logging infrastructure
  • Remove legacy cbPrintMessage/back-buffer logic
  • Add cbVDbgPrint callback and MAKE_LEVEL macro
  • Implement cbGetDebugPrefix/cbCheckDebugLevel
  • Unify cbDebugPrint to new interface
  • Clean up CBiosShare.h definitions
cbios/Callback/CBiosCallbacks.c
cbios/Callback/CBiosCallbacks.h
cbios/Device/CBiosShare.h
cbios/Hw/HwInterface/CBiosHwInterface.c
Enhance EDID parsing and mode filtering
  • Rename HFVSDB parser to HFSCDS with dual-block support
  • Add cbEDIDModule_GetExtBlockNum for override block count
  • Patch CEAModes and filter 3840×2160@29.97Hz on BenQ EL2870U
  • Handle HF-EEODB and HF-SCDS in CEA ext block
  • Correct audio format count limits
cbios/Util/CBiosEDID.c
cbios/Util/CBiosEDID.h
cbios/Device/Monitor/CBiosDPMonitor.c
Track display state with reference counting and timers
  • Introduce disp_state_info_t with ref_count and state_timer
  • Add gf_acquire_display/release_display hooks
  • Schedule idle-state transitions via timer function
  • Lock gamma updates and protect display commits
  • Invoke acquire/release in splice, atomic, plane and fence
linux/gf_disp.c
linux/gf_plane.c
linux/gf_atomic.c
linux/gf_splice.c
linux/gf_fence.c
Refine DP link training and on/off behavior
  • Use LinkedSpeed/LinkedLane fields for main link params
  • Wait vblank in OnOff to avoid artifacts
  • Simplify DPSwing sequences with bACE condition
  • Correct DPMaud SW/HW mode selection
  • Rename and sync DPMonitor speed/lane assignments
cbios/Hw/HwBlock/CBiosDIU_DP.c
cbios/Device/Monitor/CBiosDPMonitor.c
Fix LoongArch64 & RISC-V build and arch quirks
  • Implement ffs() for RISC-V in bit_op.h
  • Adapt gf_dma_cache_sync loops for MIPS/LoongArch
  • Patch sysfb for Kylin on loongarch64
  • Adjust include paths for drm/aperture headers
  • Guard RISC-V cache flush macros
core/util/bit_op.h
linux/os_interface.c
linux/gf_pcie.c
linux/gf_cbios.c
Harden fence driver and primary buffer tracking
  • Add magic_number guard in gf_dma_fence_free
  • Track primary_bo per CRTC and attach via kms callback
  • Implement gf_touch_primary_done in event thread
  • Expose kms.check_touch_primary to cbios render
  • Free and put operations only after fence signaled
linux/gf_fence.c
linux/gf_gem_priv.h
linux/gf_driver.h
core/include/kernel_import.h

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:
Once this PR has been reviewed and has the lgtm label, please assign opsiff for approval. For more information see the Code Review Process.

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

@deepin-ci-robot
Copy link
Copy Markdown

Hi @yiliang2008. Thanks for your PR.

I'm waiting for a deepin-community member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR upgrades the Glenfly Arise1 series GPU DRM driver to version V46. It introduces support for new GPU variants, implements dynamic per-engine power states and idle detection for power saving, enhances DP/HDMI compatibility (including EDID/SCDC parsing and display fixes), and improves build compatibility and code maintainability across diverse architectures.

  • Adjustments to file formatting and removal of unused whitespace.
  • Added support for the new Arise10D0 GPU variant with dynamic power‐saving API and improved display link training.
  • Renamed variables (e.g. to “LinkedLaneNumber” and “LinkedSpeed”) for clarity and added additional validation checks for module indices.

Reviewed Changes

Copilot reviewed 97 out of 97 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
drivers/gpu/drm/arise/cbios/Hw/HwBlock/CBiosDIU_DP.h Renamed variables for clarity and standardized main-link parameters.
drivers/gpu/drm/arise/cbios/Hw/HwBlock/CBiosDIU_HDAC.c Added fallback logic for LinkSpeed to ensure a safe default is applied.
drivers/gpu/drm/arise/cbios/Device/Port/CBiosDP.c Introduced additional module index validations and a vblank wait before device off.
drivers/gpu/drm/arise/cbios/Device/Monitor/CBiosHDMIMonitor.c Updated EDID parsing to use new HFSCDSData structure fields.
drivers/gpu/drm/arise/cbios/Device/Monitor/CBiosDPMonitor.* Updated link training parameter determination with new renaming and local aliases.
drivers/gpu/drm/arise/cbios/Device/CBiosShare.h Reduced debug buffer size and refactored debug macros.
Comments suppressed due to low confidence (5)

drivers/gpu/drm/arise/cbios/Hw/HwBlock/CBiosDIU_DP.h:134

  • Renaming the variables to 'LinkedLaneNumber' and 'LinkedSpeed' improves clarity by reflecting the negotiated link parameters. Please ensure that all downstream references and accompanying documentation are updated to maintain consistency.
CBIOS_U32  LinkedLaneNumber;  // 1 ~ 4 lanes

drivers/gpu/drm/arise/cbios/Device/Monitor/CBiosDPMonitor.c:292

  • The refactoring in the link training logic uses local variables 'LinkSpeed' and 'LaneNum' and then assigns values to both the new LinkPass fields and the legacy ones. Ensure that the separation between the negotiated link parameters (LinkPassSpeed/LinkPassLaneNum) and the previous variables is intentional and that their propagation to downstream calls (e.g., in cbPHY_DP_DPModeOnOff) remains consistent.
/* Link training parameter determination */

drivers/gpu/drm/arise/cbios/Device/Monitor/CBiosHDMIMonitor.c:1113

  • The update from using 'HFVSDBData' to 'HFSCDSData' for EDID parsing appears to reflect recent changes in the EDID specification. Please ensure that all related documentation and further handling of EDID data are updated to align with this new structure.
if(pDevCommon->EdidStruct.Attribute.HFSCDSData.IsSCDCPresent)

drivers/gpu/drm/arise/cbios/Device/Port/CBiosDP.c:210

  • The addition of module index validation (and subsequent immediate return on an invalid index) enhances robustness. Confirm that similar validation patterns are applied consistently across devices to avoid silent failures.
DPModuleIndex = cbGetModuleIndex(pcbe, pDevCommon->DeviceType, CBIOS_MODULE_TYPE_DP);

drivers/gpu/drm/arise/cbios/Hw/HwBlock/CBiosDIU_HDAC.c:479

  • The fallback logic that assigns a default LinkSpeed (CBIOS_DP_LINK_SPEED_5400Mbps) when the current value is zero ensures safer operation. Please verify that this default is appropriate for all supported sink devices and documented in the API specifications.
if(!LinkSpeed)

#ifndef CBIOSDEBUGMESSAGEMAXBYTES
#define CBIOSDEBUGMESSAGEMAXBYTES 256
#endif
#define CBIOSDEBUGMESSAGEMAXBYTES 64
Copy link

Copilot AI Jun 5, 2025

Choose a reason for hiding this comment

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

Reducing CBIOSDEBUGMESSAGEMAXBYTES from 256 to 64 may lead to truncated debug messages during detailed logging. Consider ensuring that 64 bytes is sufficient for all required debug output or document this limitation accordingly.

Suggested change
#define CBIOSDEBUGMESSAGEMAXBYTES 64
#define CBIOSDEBUGMESSAGEMAXBYTES 256

Copilot uses AI. Check for mistakes.
@Avenger-285714 Avenger-285714 merged commit d6c2733 into deepin-community:linux-6.6.y Jun 6, 2025
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants