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 fixes for 6.12 #6485

Merged
merged 4 commits into from
Nov 22, 2024
Merged
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
15 changes: 14 additions & 1 deletion drivers/gpu/drm/display/drm_hdmi_state_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ void __drm_atomic_helper_connector_hdmi_reset(struct drm_connector *connector,
unsigned int max_bpc = connector->max_bpc;

new_conn_state->max_bpc = max_bpc;
new_conn_state->max_requested_bpc = max_bpc;
new_conn_state->max_requested_bpc = 8;
new_conn_state->hdmi.broadcast_rgb = DRM_HDMI_BROADCAST_RGB_AUTO;
}
EXPORT_SYMBOL(__drm_atomic_helper_connector_hdmi_reset);
Expand Down Expand Up @@ -294,6 +294,11 @@ hdmi_compute_format(const struct drm_connector *connector,
return 0;
}

if (hdmi_try_format_bpc(connector, conn_state, mode, bpc, HDMI_COLORSPACE_YUV422)) {
conn_state->hdmi.output_format = HDMI_COLORSPACE_YUV422;
return 0;
}

drm_dbg_kms(dev, "Failed. No Format Supported for that bpc count.\n");

return -EINVAL;
Expand Down Expand Up @@ -347,6 +352,8 @@ static int hdmi_generate_avi_infoframe(const struct drm_connector *connector,
is_limited_range ? HDMI_QUANTIZATION_RANGE_LIMITED : HDMI_QUANTIZATION_RANGE_FULL;
int ret;

infoframe->set = false;

ret = drm_hdmi_avi_infoframe_from_display_mode(frame, connector, mode);
if (ret)
return ret;
Expand Down Expand Up @@ -376,6 +383,8 @@ static int hdmi_generate_spd_infoframe(const struct drm_connector *connector,
&infoframe->data.spd;
int ret;

infoframe->set = false;

ret = hdmi_spd_infoframe_init(frame,
connector->hdmi.vendor,
connector->hdmi.product);
Expand All @@ -398,6 +407,8 @@ static int hdmi_generate_hdr_infoframe(const struct drm_connector *connector,
&infoframe->data.drm;
int ret;

infoframe->set = false;

if (connector->max_bpc < 10)
return 0;

Expand Down Expand Up @@ -425,6 +436,8 @@ static int hdmi_generate_hdmi_vendor_infoframe(const struct drm_connector *conne
&infoframe->data.vendor.hdmi;
int ret;

infoframe->set = false;

if (!info->has_hdmi_infoframe)
return 0;

Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/drm_connector.c
Original file line number Diff line number Diff line change
Expand Up @@ -2723,8 +2723,8 @@ int drm_connector_attach_max_bpc_property(struct drm_connector *connector,
}

drm_object_attach_property(&connector->base, prop, max);
connector->state->max_requested_bpc = max;
connector->state->max_bpc = max;
connector->state->max_requested_bpc = min;
connector->state->max_bpc = min;

return 0;
}
Expand Down
19 changes: 19 additions & 0 deletions drivers/gpu/drm/vc4/vc4_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,24 @@ static int vc4_hdmi_write_infoframe(struct drm_connector *connector,
return ret;
}

static int vc4_hdmi_clear_infoframe(struct drm_connector *connector,
enum hdmi_infoframe_type type)
{
struct vc4_hdmi *vc4_hdmi = connector_to_vc4_hdmi(connector);
struct drm_device *drm = connector->dev;
int ret;
int idx;

if (!drm_dev_enter(drm, &idx))
return 0;

ret = vc4_hdmi_stop_packet(vc4_hdmi, type, true);
if (ret)
drm_err(drm, "Failed to wait for infoframe to go idle: %d\n", ret);

drm_dev_exit(idx);
return ret;
}
#define SCRAMBLING_POLLING_DELAY_MS 1000

static void vc4_hdmi_enable_scrambling(struct drm_encoder *encoder)
Expand Down Expand Up @@ -1739,6 +1757,7 @@ vc4_hdmi_connector_clock_valid(const struct drm_connector *connector,
static const struct drm_connector_hdmi_funcs vc4_hdmi_hdmi_connector_funcs = {
.tmds_char_rate_valid = vc4_hdmi_connector_clock_valid,
.write_infoframe = vc4_hdmi_write_infoframe,
.clear_infoframe = vc4_hdmi_clear_infoframe,
};

#define WIFI_2_4GHz_CH1_MIN_FREQ 2400000000ULL
Expand Down