Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 16 additions & 18 deletions bridge/it66121_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ struct it66121_priv {

struct hdmi_avi_infoframe hdmi_avi_infoframe;

struct edid *edid;
const struct drm_edid *drm_edid;

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

The type of edid has been changed from struct edid * to const struct drm_edid *. This is a necessary update to align with the new DRM EDID API, ensuring proper handling of EDID data.

bool dvi_mode;
};

Expand Down Expand Up @@ -311,8 +311,8 @@ static void it66121_intr_work(struct work_struct *work_item)
it66121_is_hpd_detect(priv);
event = true;
if (priv->conn_status == connector_status_disconnected) {
kfree(priv->edid);
priv->edid = NULL;
drm_edid_free(priv->drm_edid);
priv->drm_edid = NULL;
Comment on lines +314 to +315

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

The kfree(priv->edid) and priv->edid = NULL calls have been correctly replaced with drm_edid_free(priv->drm_edid) and priv->drm_edid = NULL. This change is essential for proper memory management when using the new drm_edid API.

}
}

Expand Down Expand Up @@ -395,28 +395,26 @@ static int it66121_get_edid_block(void *context, u8 *buf, unsigned int block, si

return ret;
}

static int it66121_connector_get_modes(struct drm_connector *connector)
{
struct it66121_priv *priv = container_of(connector, struct it66121_priv, connector);
struct edid *edid = priv->edid;
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;
Comment on lines +401 to +413

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

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.

}

static enum drm_mode_status it66121_connector_mode_valid(struct drm_connector *connector,
struct drm_display_mode *mode)
const struct drm_display_mode *mode)

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

The mode parameter in it66121_connector_mode_valid has been correctly updated to const struct drm_display_mode *mode. This change reflects the updated signature for mode_valid in the DRM framework.

{
/* TODO: validate mode */
UNUSED(connector);
Expand Down Expand Up @@ -486,7 +484,7 @@ static const struct component_ops it66121_component_ops = {
};

/* 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)

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

The it66121_bridge_attach function signature has been updated to include a struct drm_encoder *encoder parameter. This is a necessary change to match the new bridge_attach signature in the DRM framework.

{
int ret;
struct it66121_priv *priv = container_of(bridge, struct it66121_priv, bridge);
Expand Down Expand Up @@ -842,7 +840,7 @@ static void __exit it66121_remove(void)

component_del(&priv->client->dev, &it66121_component_ops);

kfree(priv->edid);
drm_edid_free(priv->drm_edid);

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

The kfree(priv->edid) call has been correctly replaced with drm_edid_free(priv->drm_edid). This ensures proper cleanup of EDID data when the driver is removed.


drm_bridge_remove(&priv->bridge);

Expand Down
2 changes: 1 addition & 1 deletion fl2000.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <drm/drm_fourcc.h>
#include <drm/drm_fb_helper.h>
#include <drm/drm_framebuffer.h>
#include <drm/drm_fbdev_generic.h>
#include <drm/drm_fbdev_shmem.h>

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

The include drm/drm_fbdev_generic.h has been correctly replaced with drm/drm_fbdev_shmem.h. This update is necessary for compatibility with the Linux kernel 6.17.

#include <drm/drm_gem_framebuffer_helper.h>
#include <drm/drm_gem_dma_helper.h>
#include <drm/drm_atomic_helper.h>
Expand Down
5 changes: 2 additions & 3 deletions fl2000_drm.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,15 @@ static void fl2000_drm_release(struct drm_device *drm)

static struct drm_driver fl2000_drm_driver = {
.driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_ATOMIC,
.lastclose = drm_fb_helper_lastclose,
.ioctls = NULL,

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

The .lastclose = drm_fb_helper_lastclose field has been removed from fl2000_drm_driver. This is in line with the deprecation of .lastclose in drm_driver.

.fops = &fl2000_drm_driver_fops,
.release = fl2000_drm_release,

DRM_GEM_DMA_DRIVER_OPS_VMAP,
DRM_FBDEV_SHMEM_DRIVER_OPS,

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

The DRM_FBDEV_SHMEM_DRIVER_OPS macro has been added to fl2000_drm_driver. This is a necessary addition to support the new drm_fbdev_shmem API.


.name = DRM_DRIVER_NAME,
.desc = DRM_DRIVER_DESC,
.date = DRM_DRIVER_DATE,
.major = DRM_DRIVER_MAJOR,

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

The .date = DRM_DRIVER_DATE field has been removed from fl2000_drm_driver. This is in line with the deprecation of .date in drm_driver.

.minor = DRM_DRIVER_MINOR,
.patchlevel = DRM_DRIVER_PATCHLEVEL,
Expand Down Expand Up @@ -524,7 +523,7 @@ int fl2000_drm_bind(struct device *master)
fl2000_reset(usb_dev);
fl2000_usb_magic(usb_dev);

drm_fbdev_generic_setup(drm, FL2000_FB_BPP);
// fbdev setup removed - handled by DRM_FBDEV_SHMEM_DRIVER_OPS

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

The call to drm_fbdev_generic_setup has been removed and replaced with a comment indicating that fbdev setup is now handled by DRM_FBDEV_SHMEM_DRIVER_OPS. This is a correct change reflecting the migration to the new fbdev API.


return 0;
}
Expand Down