Fix compatibility with Linux kernel 6.17#81
Fix compatibility with Linux kernel 6.17#81MatiZappacosta wants to merge 1 commit intoklogg:masterfrom
Conversation
- Replace drm_fbdev_generic.h with drm_fbdev_shmem.h - Remove deprecated .lastclose and .date from drm_driver - Add DRM_FBDEV_SHMEM_DRIVER_OPS macro - Update bridge_attach signature (add encoder parameter) - Update mode_valid signature (add const) - Migrate from struct edid to struct drm_edid API: - drm_do_get_edid -> drm_edid_read_custom - drm_connector_update_edid_property -> drm_edid_connector_update - drm_detect_hdmi_monitor -> drm_edid_is_digital - drm_add_edid_modes -> drm_edid_connector_add_modes - kfree -> drm_edid_free Tested on Ubuntu 24.04 with kernel 6.17.0-14-generic
Summary of ChangesHello @MatiZappacosta, 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 updates the DRM driver to ensure compatibility with Linux kernel 6.17. It involves modernizing the framebuffer device handling, removing deprecated driver fields, and migrating to the newer Highlights
🧠 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
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
The pull request successfully updates the driver for compatibility with Linux kernel 6.17. The changes involve migrating from deprecated EDID APIs to the new drm_edid API, updating function signatures, and replacing drm_fbdev_generic.h with drm_fbdev_shmem.h. The removal of .lastclose and .date from drm_driver and the addition of DRM_FBDEV_SHMEM_DRIVER_OPS are also correctly implemented. The changes appear to be well-tested and address the compatibility issues effectively.
| const struct drm_edid *drm_edid = priv->drm_edid; | ||
| int count; | ||
|
|
||
| if (!edid) { | ||
| edid = drm_do_get_edid(connector, it66121_get_edid_block, priv); | ||
| if (!edid) | ||
| if (!drm_edid) { | ||
| drm_edid = drm_edid_read_custom(connector, it66121_get_edid_block, priv); | ||
| if (!drm_edid) | ||
| return 0; | ||
|
|
||
| drm_connector_update_edid_property(connector, edid); | ||
|
|
||
| priv->dvi_mode = !drm_detect_hdmi_monitor(edid); | ||
| priv->edid = edid; | ||
| drm_edid_connector_update(connector, drm_edid); | ||
| priv->dvi_mode = !drm_edid_is_digital(drm_edid); | ||
| priv->drm_edid = drm_edid; | ||
| } | ||
|
|
||
| return drm_add_edid_modes(connector, edid); | ||
| count = drm_edid_connector_add_modes(connector); | ||
| return count; |
There was a problem hiding this comment.
The it66121_connector_get_modes function has been updated to use the new drm_edid API. Specifically, drm_do_get_edid is replaced by drm_edid_read_custom, drm_connector_update_edid_property by drm_edid_connector_update, drm_detect_hdmi_monitor by drm_edid_is_digital, and drm_add_edid_modes by drm_edid_connector_add_modes. This is a critical update for compatibility with the new kernel version.
| struct hdmi_avi_infoframe hdmi_avi_infoframe; | ||
|
|
||
| struct edid *edid; | ||
| const struct drm_edid *drm_edid; |
| drm_edid_free(priv->drm_edid); | ||
| priv->drm_edid = NULL; |
|
|
||
| static enum drm_mode_status it66121_connector_mode_valid(struct drm_connector *connector, | ||
| struct drm_display_mode *mode) | ||
| const struct drm_display_mode *mode) |
|
|
||
| /* TODO: rewrite register access properly, add error processing */ | ||
| static int it66121_bridge_attach(struct drm_bridge *bridge, enum drm_bridge_attach_flags flags) | ||
| static int it66121_bridge_attach(struct drm_bridge *bridge, struct drm_encoder *encoder, enum drm_bridge_attach_flags flags) |
| #include <drm/drm_fb_helper.h> | ||
| #include <drm/drm_framebuffer.h> | ||
| #include <drm/drm_fbdev_generic.h> | ||
| #include <drm/drm_fbdev_shmem.h> |
| static struct drm_driver fl2000_drm_driver = { | ||
| .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_ATOMIC, | ||
| .lastclose = drm_fb_helper_lastclose, | ||
| .ioctls = NULL, |
| .release = fl2000_drm_release, | ||
|
|
||
| DRM_GEM_DMA_DRIVER_OPS_VMAP, | ||
| DRM_FBDEV_SHMEM_DRIVER_OPS, |
| .name = DRM_DRIVER_NAME, | ||
| .desc = DRM_DRIVER_DESC, | ||
| .date = DRM_DRIVER_DATE, | ||
| .major = DRM_DRIVER_MAJOR, |
| fl2000_usb_magic(usb_dev); | ||
|
|
||
| drm_fbdev_generic_setup(drm, FL2000_FB_BPP); | ||
| // fbdev setup removed - handled by DRM_FBDEV_SHMEM_DRIVER_OPS |
Tested on Ubuntu 24.04 with kernel 6.17.0-14-generic