Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vc4/hdmi: Hack: Add option to toggle hotplug periodically #6338

Draft
wants to merge 1 commit into
base: rpi-6.6.y
Choose a base branch
from
Draft
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
8 changes: 7 additions & 1 deletion drivers/gpu/drm/vc4/vc4_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,7 @@
}
}

static uint32_t toggle[2];
static int vc4_hdmi_connector_detect_ctx(struct drm_connector *connector,
struct drm_modeset_acquire_ctx *ctx,
bool force)
Expand All @@ -498,6 +499,10 @@

if (force_hotplug & BIT(vc4_hdmi->encoder.type - VC4_ENCODER_TYPE_HDMI0))
status = connector_status_connected;
else if (force_hotplug & BIT(2 + vc4_hdmi->encoder.type - VC4_ENCODER_TYPE_HDMI0)) {
status = (toggle[vc4_hdmi->encoder.type - VC4_ENCODER_TYPE_HDMI0] & 2) ? connector_status_disconnected : connector_status_connected;

Check failure on line 503 in drivers/gpu/drm/vc4/vc4_hdmi.c

View workflow job for this annotation

GitHub Actions / checkpatch review

WARNING: line length of 148 exceeds 100 columns
toggle[vc4_hdmi->encoder.type - VC4_ENCODER_TYPE_HDMI0]++;
}
else if (vc4_hdmi->hpd_gpio) {
if (gpiod_get_value_cansleep(vc4_hdmi->hpd_gpio))
status = connector_status_connected;
Expand All @@ -507,6 +512,7 @@
status = connector_status_connected;
}

printk("%s:%d: %d (%d)\n", __func__, vc4_hdmi->encoder.type - VC4_ENCODER_TYPE_HDMI0, status, toggle[vc4_hdmi->encoder.type - VC4_ENCODER_TYPE_HDMI0]);

Check failure on line 515 in drivers/gpu/drm/vc4/vc4_hdmi.c

View workflow job for this annotation

GitHub Actions / checkpatch review

WARNING: line length of 159 exceeds 100 columns

Check failure on line 515 in drivers/gpu/drm/vc4/vc4_hdmi.c

View workflow job for this annotation

GitHub Actions / checkpatch review

WARNING: printk() should include KERN_<LEVEL> facility level
vc4_hdmi_handle_hotplug(vc4_hdmi, ctx, status);
pm_runtime_put(&vc4_hdmi->pdev->dev);

Expand Down Expand Up @@ -3005,7 +3011,7 @@
if (ret)
return ret;

connector->polled = DRM_CONNECTOR_POLL_HPD;
connector->polled = connector->polled;
}

return 0;
Expand Down
Loading