Skip to content

Fix build on Linux 6.12+ kernel round 2#83

Open
ReachableCEO wants to merge 2 commits intoklogg:masterfrom
ReachableCEO:master
Open

Fix build on Linux 6.12+ kernel round 2#83
ReachableCEO wants to merge 2 commits intoklogg:masterfrom
ReachableCEO:master

Conversation

@ReachableCEO
Copy link
Copy Markdown

No description provided.

Charles N Wyble added 2 commits February 20, 2026 13:47
- Replace drm_fbdev_generic.h with drm_fbdev_shmem.h
- Replace drm_gem_dma_helper.h with drm_gem_shmem_helper.h
- Replace drm_fb_dma_helper.h (removed)
- Update drm_driver to use DRM_GEM_SHMEM_DRIVER_OPS
- Use DEFINE_DRM_GEM_FOPS instead of DEFINE_DRM_GEM_DMA_FOPS
- Replace drm_fbdev_generic_setup with drm_fbdev_shmem_setup
- Update it66121 bridge to use drm_edid_read_custom API
- Remove .lastclose callback (removed from drm_driver in 6.12+)

The DMA GEM helpers are not enabled in Debian's default kernel
configuration, but SHMEM helpers are available. This also adapts
to the renamed/removed DRM APIs in kernel 6.12+.

💘 Generated with Crush

Assisted-by: GLM-5 via Crush <crush@charm.land>
- Fix unsafe SHMEM buffer access using drm_gem_shmem_vmap/vunmap
- Remove .date field from drm_driver (removed in Linux 6.12)
- Change kfree to drm_edid_free for drm_edid structure

💘 Generated with Crush

Assisted-by: GLM-5 via Crush <crush@charm.land>
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @ReachableCEO, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses build compatibility issues with Linux kernel versions 6.12 and newer by modernizing the it66121 bridge driver and the fl2000 DRM driver. It updates several DRM API usages, specifically transitioning EDID handling to the drm_edid API and migrating GEM memory management and fbdev helpers to shared memory-based interfaces. These changes ensure the drivers conform to current kernel standards and maintain functionality on recent kernel releases.

Highlights

  • EDID API Modernization: Updated the it66121_drv.c bridge driver to use the modern drm_edid API for EDID data handling, including type definitions, memory allocation/deallocation, and mode management.
  • GEM Shmem Migration: Migrated the fl2000 DRM driver from DMA-based GEM (Graphics Execution Manager) helpers to shared memory (shmem) based GEM helpers, affecting header includes, driver operations, and framebuffer access.
  • FBDEV Helper Update: Switched from generic fbdev helper functions to shared memory-specific fbdev helpers, ensuring compatibility with newer kernel interfaces.
  • Deprecated Code Removal: Removed the DRM_DRIVER_DATE macro and drm_fb_helper_lastclose callback, aligning with current DRM driver practices.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • bridge/it66121_drv.c
    • Updated edid member type to const struct drm_edid *.
    • Replaced kfree with drm_edid_free for EDID memory management.
    • Migrated EDID reading and mode adding functions to drm_edid_read_custom, drm_edid_connector_update, and drm_edid_connector_add_modes.
    • Adjusted drm_detect_hdmi_monitor call to use drm_edid_raw.
  • fl2000.h
    • Replaced drm_fbdev_generic.h with drm_fbdev_shmem.h.
    • Replaced drm_gem_dma_helper.h with drm_gem_shmem_helper.h.
    • Removed drm_fb_dma_helper.h.
  • fl2000_drm.c
    • Removed DRM_DRIVER_DATE definition.
    • Replaced DEFINE_DRM_GEM_DMA_FOPS with DEFINE_DRM_GEM_FOPS.
    • Removed .lastclose from fl2000_drm_driver.
    • Replaced DRM_GEM_DMA_DRIVER_OPS_VMAP with DRM_GEM_SHMEM_DRIVER_OPS.
    • Updated fb2000_dirty to use drm_gem_shmem_vmap and drm_gem_shmem_vunmap for framebuffer access.
    • Replaced drm_fbdev_generic_setup with drm_fbdev_shmem_setup.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

The pull request correctly updates the it66121 and fl2000 drivers to use modern DRM APIs, specifically transitioning from the legacy struct edid to struct drm_edid and from GEM DMA helpers to GEM SHMEM helpers. These changes are necessary for compatibility with Linux kernel 6.12 and later. The implementation is clean and correctly follows the new API patterns. Additionally, the refactoring in fb2000_dirty fixes a pre-existing bug where drm_dev_exit was skipped on error paths.

Comment on lines +315 to 316
fl2000_stream_compress(drm_if->stream, map.vaddr, fb->height, fb->width,
fb->pitches[0]);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

When compressing the framebuffer data, it is important to account for the memory offset defined in the framebuffer object. While many simple configurations use an offset of 0, user-space can provide a non-zero offset which would result in the driver reading from the wrong memory location if only the base address of the GEM object is used. Since map.vaddr points to the start of the GEM object, adding fb->offsets[0] ensures the correct pixel data is accessed.

	fl2000_stream_compress(drm_if->stream, map.vaddr + fb->offsets[0], fb->height, fb->width,
			       fb->pitches[0]);

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.

1 participant