Jani Nikula
2023-Mar-30 15:39 UTC
[Nouveau] [PATCH 00/12] drm: reduce drm_detect_monitor_audio/drm_detect_hdmi_monitor/edid_blob_ptr usage
THIS IS UNTESTED for anything other than i915. Use previously parsed EDID where possible for display audio/hdmi detection. This in turn reduces edid_blob_ptr usage in a number of places. Further reduce edid_blob_ptr usage, and document that it should not be used by drivers directly. BR, Jani. Cc: Alain Volmat <alain.volmat at foss.st.com> Cc: Alex Deucher <alexander.deucher at amd.com> Cc: amd-gfx at lists.freedesktop.org Cc: Ben Skeggs <bskeggs at redhat.com> Cc: Christian K?nig <christian.koenig at amd.com> Cc: Heiko St?bner <heiko at sntech.de> Cc: Inki Dae <inki.dae at samsung.com> Cc: Karol Herbst <kherbst at redhat.com> Cc: Kyungmin Park <kyungmin.park at samsung.com> Cc: Lyude Paul <lyude at redhat.com> Cc: nouveau at lists.freedesktop.org Cc: Pan, Xinhui <Xinhui.Pan at amd.com> Cc: Russell King <linux at armlinux.org.uk> Cc: Sandy Huang <hjc at rock-chips.com> Cc: Seung-Woo Kim <sw0312.kim at samsung.com> Jani Nikula (12): drm/edid: parse display info has_audio similar to is_hdmi drm/nouveau: convert to using is_hdmi and has_audio from display info drm/radeon: convert to using is_hdmi and has_audio from display info drm/radeon: remove radeon_connector_edid() and stop using edid_blob_ptr drm/amdgpu: remove amdgpu_connector_edid() and stop using edid_blob_ptr drm/i915/debugfs: stop using edid_blob_ptr drm/exynos: fix is_hdmi usage drm/i2c/tda998x: convert to using has_audio from display_info drm/sti/sti_hdmi: convert to using is_hdmi from display info drm/rockchip: cdn-dp: call drm_connector_update_edid_property() unconditionally drm/rockchip: convert to using has_audio from display_info drm/connector: update edid_blob_ptr documentation .../gpu/drm/amd/amdgpu/amdgpu_connectors.c | 15 ----------- .../gpu/drm/amd/amdgpu/amdgpu_connectors.h | 1 - drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 4 +-- drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 4 +-- drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 4 +-- drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 4 +-- drivers/gpu/drm/drm_edid.c | 6 +++++ drivers/gpu/drm/exynos/exynos_hdmi.c | 3 ++- drivers/gpu/drm/i2c/tda998x_drv.c | 2 +- .../drm/i915/display/intel_display_debugfs.c | 10 +++---- drivers/gpu/drm/nouveau/dispnv50/disp.c | 8 +++--- drivers/gpu/drm/nouveau/dispnv50/head.c | 8 +----- drivers/gpu/drm/nouveau/nouveau_connector.c | 2 +- drivers/gpu/drm/radeon/atombios_encoders.c | 10 +++---- drivers/gpu/drm/radeon/evergreen_hdmi.c | 5 ++-- drivers/gpu/drm/radeon/radeon_audio.c | 11 ++++---- drivers/gpu/drm/radeon/radeon_connectors.c | 27 +++++-------------- drivers/gpu/drm/radeon/radeon_display.c | 2 +- drivers/gpu/drm/radeon/radeon_encoders.c | 4 +-- drivers/gpu/drm/radeon/radeon_mode.h | 2 -- drivers/gpu/drm/rockchip/cdn-dp-core.c | 7 +++-- drivers/gpu/drm/rockchip/inno_hdmi.c | 3 ++- drivers/gpu/drm/sti/sti_hdmi.c | 11 ++++---- drivers/gpu/drm/sti/sti_hdmi.h | 2 -- include/drm/drm_connector.h | 14 +++++++++- 25 files changed, 73 insertions(+), 96 deletions(-) -- 2.39.2
Jani Nikula
2023-Mar-30 15:39 UTC
[Nouveau] [PATCH 02/12] drm/nouveau: convert to using is_hdmi and has_audio from display info
Prefer the parsed results for is_hdmi and has_audio in display info over calling drm_detect_hdmi_monitor() and drm_detect_monitor_audio(), respectively. Conveniently, this also removes the need to use edid_blob_ptr. Cc: Ben Skeggs <bskeggs at redhat.com> Cc: Karol Herbst <kherbst at redhat.com> Cc: Lyude Paul <lyude at redhat.com> Cc: nouveau at lists.freedesktop.org Signed-off-by: Jani Nikula <jani.nikula at intel.com> --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 8 ++++---- drivers/gpu/drm/nouveau/dispnv50/head.c | 8 +------- drivers/gpu/drm/nouveau/nouveau_connector.c | 2 +- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c index ed9d374147b8..6c41e0316043 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c @@ -713,7 +713,7 @@ nv50_audio_enable(struct drm_encoder *encoder, struct nouveau_crtc *nv_crtc, struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); struct nvif_outp *outp = &nv_encoder->outp; - if (!nv50_audio_supported(encoder) || !drm_detect_monitor_audio(nv_connector->edid)) + if (!nv50_audio_supported(encoder) || !nv_connector->base.display_info.has_audio) return; mutex_lock(&drm->audio.lock); @@ -1555,13 +1555,13 @@ nv50_sor_atomic_enable(struct drm_encoder *encoder, struct drm_atomic_state *sta if ((disp->disp->object.oclass == GT214_DISP || disp->disp->object.oclass >= GF110_DISP) && - drm_detect_monitor_audio(nv_connector->edid)) + nv_connector->base.display_info.has_audio) hda = true; switch (nv_encoder->dcb->type) { case DCB_OUTPUT_TMDS: if (disp->disp->object.oclass == NV50_DISP || - !drm_detect_hdmi_monitor(nv_connector->edid)) + !nv_connector->base.display_info.is_hdmi) nvif_outp_acquire_tmds(outp, nv_crtc->index, false, 0, 0, 0, false); else nv50_hdmi_enable(encoder, nv_crtc, nv_connector, state, mode, hda); @@ -1576,7 +1576,7 @@ nv50_sor_atomic_enable(struct drm_encoder *encoder, struct drm_atomic_state *sta */ if (mode->clock >= 165000 && nv_encoder->dcb->duallink_possible && - !drm_detect_hdmi_monitor(nv_connector->edid)) + !nv_connector->base.display_info.is_hdmi) proto = NV507D_SOR_SET_CONTROL_PROTOCOL_DUAL_TMDS; } else { proto = NV507D_SOR_SET_CONTROL_PROTOCOL_SINGLE_TMDS_B; diff --git a/drivers/gpu/drm/nouveau/dispnv50/head.c b/drivers/gpu/drm/nouveau/dispnv50/head.c index 5f490fbf1877..628db44af891 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/head.c +++ b/drivers/gpu/drm/nouveau/dispnv50/head.c @@ -126,14 +126,8 @@ nv50_head_atomic_check_view(struct nv50_head_atom *armh, struct drm_display_mode *omode = &asyh->state.adjusted_mode; struct drm_display_mode *umode = &asyh->state.mode; int mode = asyc->scaler.mode; - struct edid *edid; int umode_vdisplay, omode_hdisplay, omode_vdisplay; - if (connector->edid_blob_ptr) - edid = (struct edid *)connector->edid_blob_ptr->data; - else - edid = NULL; - if (!asyc->scaler.full) { if (mode == DRM_MODE_SCALE_NONE) omode = umode; @@ -161,7 +155,7 @@ nv50_head_atomic_check_view(struct nv50_head_atom *armh, */ if ((asyc->scaler.underscan.mode == UNDERSCAN_ON || (asyc->scaler.underscan.mode == UNDERSCAN_AUTO && - drm_detect_hdmi_monitor(edid)))) { + connector->display_info.is_hdmi))) { u32 bX = asyc->scaler.underscan.hborder; u32 bY = asyc->scaler.underscan.vborder; u32 r = (asyh->view.oH << 19) / asyh->view.oW; diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c index 086b66b60d91..3143d2083c6d 100644 --- a/drivers/gpu/drm/nouveau/nouveau_connector.c +++ b/drivers/gpu/drm/nouveau/nouveau_connector.c @@ -1012,7 +1012,7 @@ get_tmds_link_bandwidth(struct drm_connector *connector) unsigned duallink_scale nouveau_duallink && nv_encoder->dcb->duallink_possible ? 2 : 1; - if (drm_detect_hdmi_monitor(nv_connector->edid)) { + if (nv_connector->base.display_info.is_hdmi) { info = &nv_connector->base.display_info; duallink_scale = 1; } -- 2.39.2
Apparently Analagous Threads
- [PATCH 1/6] drm/nouveau: convert to using is_hdmi and has_audio from display info
- [PATCH 1/6] drm/nouveau: convert to using is_hdmi and has_audio from display info
- [RESEND 0/6] drm, nouveau/radeon/amdpgu: edid_blob_ptr cleanups
- [PATCH v2 0/4] drm/connector: Provide generic support for underscan
- [PATCH 0/6] drm/nouveau: Enable HDMI Stereoscopy