summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/sun4i
diff options
context:
space:
mode:
authorDmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>2026-01-07 20:15:03 +0200
committerDmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>2026-01-19 13:11:46 +0200
commite802c783be94bf71541a7e2ac8b1b5486aad10db (patch)
treef2e9e228c1c9a30d0bff4db593317bcc06c16e22 /drivers/gpu/drm/sun4i
parentb626b1a1c9ccadd8861870a2a450f02e0c61ab88 (diff)
drm/display: hdmi_state_helper: split InfoFrame functions per type
Havign a single set of InfoFrame callbacks doesn't provide enough information to the DRM framework about the InfoFrame types that are actually supported. Also it's not really future-proof: it provides a way to program only a single Vendor-Specific frame, however we might need to support multiple VSIs at the same time (e.g. HDMI vs HDMI Forum VSIs). Provide separate sets of callbacks, one per the InfoFrame type. Acked-by: Maxime Ripard <mripard@kernel.org> Link: https://patch.msgid.link/20260107-limit-infoframes-2-v4-6-213d0d3bd490@oss.qualcomm.com Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Diffstat (limited to 'drivers/gpu/drm/sun4i')
-rw-r--r--drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c39
1 files changed, 26 insertions, 13 deletions
diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
index 6263ee15880a..a50f260c73e4 100644
--- a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
+++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
@@ -40,27 +40,19 @@
#define drm_connector_to_sun4i_hdmi(c) \
container_of_const(c, struct sun4i_hdmi, connector)
-static int sun4i_hdmi_clear_infoframe(struct drm_connector *connector,
- enum hdmi_infoframe_type type)
+static int sun4i_hdmi_clear_avi_infoframe(struct drm_connector *connector)
{
drm_warn_once(connector->dev, "clearing of AVI infoframe is not implemented\n");
return 0;
}
-static int sun4i_hdmi_write_infoframe(struct drm_connector *connector,
- enum hdmi_infoframe_type type,
- const u8 *buffer, size_t len)
+static int sun4i_hdmi_write_avi_infoframe(struct drm_connector *connector,
+ const u8 *buffer, size_t len)
{
struct sun4i_hdmi *hdmi = drm_connector_to_sun4i_hdmi(connector);
int i;
- if (type != HDMI_INFOFRAME_TYPE_AVI) {
- drm_err(connector->dev,
- "Unsupported infoframe type: %u\n", type);
- return 0;
- }
-
for (i = 0; i < len; i++)
writeb(buffer[i], hdmi->base + SUN4I_HDMI_AVI_INFOFRAME_REG(i));
@@ -68,6 +60,21 @@ static int sun4i_hdmi_write_infoframe(struct drm_connector *connector,
}
+static int sun4i_hdmi_clear_hdmi_infoframe(struct drm_connector *connector)
+{
+ drm_warn_once(connector->dev, "HDMI VSI not implemented\n");
+
+ return 0;
+}
+
+static int sun4i_hdmi_write_hdmi_infoframe(struct drm_connector *connector,
+ const u8 *buffer, size_t len)
+{
+ drm_warn_once(connector->dev, "HDMI VSI not implemented\n");
+
+ return 0;
+}
+
static void sun4i_hdmi_disable(struct drm_encoder *encoder,
struct drm_atomic_state *state)
{
@@ -244,8 +251,14 @@ static struct i2c_adapter *sun4i_hdmi_get_ddc(struct device *dev)
static const struct drm_connector_hdmi_funcs sun4i_hdmi_hdmi_connector_funcs = {
.tmds_char_rate_valid = sun4i_hdmi_connector_clock_valid,
- .clear_infoframe = sun4i_hdmi_clear_infoframe,
- .write_infoframe = sun4i_hdmi_write_infoframe,
+ .avi = {
+ .clear_infoframe = sun4i_hdmi_clear_avi_infoframe,
+ .write_infoframe = sun4i_hdmi_write_avi_infoframe,
+ },
+ .hdmi = {
+ .clear_infoframe = sun4i_hdmi_clear_hdmi_infoframe,
+ .write_infoframe = sun4i_hdmi_write_hdmi_infoframe,
+ },
};
static const struct drm_connector_helper_funcs sun4i_hdmi_connector_helper_funcs = {