]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
drm/edid: Pass connector to AVI infoframe functions
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 8 Jan 2019 17:28:25 +0000 (19:28 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 10 Jan 2019 17:01:06 +0000 (19:01 +0200)
Make life easier for drivers by simply passing the connector
to drm_hdmi_avi_infoframe_from_display_mode() and
drm_hdmi_avi_infoframe_quant_range(). That way drivers don't
need to worry about is_hdmi2_sink mess.

v2: Make is_hdmi2_sink() return true for sil-sii8620
    Adapt to omap/vc4 changes

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: "David (ChunMing) Zhou" <David1.Zhou@amd.com>
Cc: Archit Taneja <architt@codeaurora.org>
Cc: Andrzej Hajda <a.hajda@samsung.com>
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
Cc: Inki Dae <inki.dae@samsung.com>
Cc: Joonyoung Shim <jy0922.shim@samsung.com>
Cc: Seung-Woo Kim <sw0312.kim@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: CK Hu <ck.hu@mediatek.com>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Sandy Huang <hjc@rock-chips.com>
Cc: "Heiko Stübner" <heiko@sntech.de>
Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Cc: Vincent Abriou <vincent.abriou@st.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Eric Anholt <eric@anholt.net>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: amd-gfx@lists.freedesktop.org
Cc: linux-arm-msm@vger.kernel.org
Cc: freedreno@lists.freedesktop.org
Cc: nouveau@lists.freedesktop.org
Cc: linux-tegra@vger.kernel.org
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Acked-by: Russell King <rmk+kernel@armlinux.org.uk>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190108172828.15184-1-ville.syrjala@linux.intel.com
27 files changed:
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
drivers/gpu/drm/bridge/analogix-anx78xx.c
drivers/gpu/drm/bridge/sii902x.c
drivers/gpu/drm/bridge/sil-sii8620.c
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
drivers/gpu/drm/drm_edid.c
drivers/gpu/drm/exynos/exynos_hdmi.c
drivers/gpu/drm/i2c/tda998x_drv.c
drivers/gpu/drm/i915/intel_hdmi.c
drivers/gpu/drm/i915/intel_lspcon.c
drivers/gpu/drm/i915/intel_sdvo.c
drivers/gpu/drm/mediatek/mtk_hdmi.c
drivers/gpu/drm/msm/hdmi/hdmi_bridge.c
drivers/gpu/drm/nouveau/dispnv50/disp.c
drivers/gpu/drm/omapdrm/omap_encoder.c
drivers/gpu/drm/radeon/radeon_audio.c
drivers/gpu/drm/rockchip/inno_hdmi.c
drivers/gpu/drm/sti/sti_hdmi.c
drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
drivers/gpu/drm/tegra/hdmi.c
drivers/gpu/drm/tegra/sor.c
drivers/gpu/drm/vc4/vc4_hdmi.c
drivers/gpu/drm/zte/zx_hdmi.c
include/drm/drm_edid.h

index 4cfecdce29a3c86dc30e509007ecec3a22eda338..1f0426d2fc2a0149529e19dea0fa8cbbb21fd350 100644 (file)
@@ -1682,7 +1682,7 @@ static void dce_v10_0_afmt_setmode(struct drm_encoder *encoder,
        dce_v10_0_audio_write_sad_regs(encoder);
        dce_v10_0_audio_write_latency_fields(encoder, mode);
 
-       err = drm_hdmi_avi_infoframe_from_display_mode(&frame, mode, false);
+       err = drm_hdmi_avi_infoframe_from_display_mode(&frame, connector, mode);
        if (err < 0) {
                DRM_ERROR("failed to setup AVI infoframe: %zd\n", err);
                return;
index 7c868916d90f83a4493ffb27db4e6286430c75f5..2280b971d758457d7a07214687e6d3d6ecc70f78 100644 (file)
@@ -1724,7 +1724,7 @@ static void dce_v11_0_afmt_setmode(struct drm_encoder *encoder,
        dce_v11_0_audio_write_sad_regs(encoder);
        dce_v11_0_audio_write_latency_fields(encoder, mode);
 
-       err = drm_hdmi_avi_infoframe_from_display_mode(&frame, mode, false);
+       err = drm_hdmi_avi_infoframe_from_display_mode(&frame, connector, mode);
        if (err < 0) {
                DRM_ERROR("failed to setup AVI infoframe: %zd\n", err);
                return;
index 17eaaba3601706ce4f8ed9010c9460a5b074e619..db443ec53d3aeb5db36c09fdbf45f9287658f4d2 100644 (file)
@@ -1423,6 +1423,7 @@ static void dce_v6_0_audio_set_avi_infoframe(struct drm_encoder *encoder,
        struct amdgpu_device *adev = dev->dev_private;
        struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder);
        struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv;
+       struct drm_connector *connector = amdgpu_get_connector_for_encoder(encoder);
        struct hdmi_avi_infoframe frame;
        u8 buffer[HDMI_INFOFRAME_HEADER_SIZE + HDMI_AVI_INFOFRAME_SIZE];
        uint8_t *payload = buffer + 3;
@@ -1430,7 +1431,7 @@ static void dce_v6_0_audio_set_avi_infoframe(struct drm_encoder *encoder,
        ssize_t err;
        u32 tmp;
 
-       err = drm_hdmi_avi_infoframe_from_display_mode(&frame, mode, false);
+       err = drm_hdmi_avi_infoframe_from_display_mode(&frame, connector, mode);
        if (err < 0) {
                DRM_ERROR("failed to setup AVI infoframe: %zd\n", err);
                return;
index 8c0576978d36220d305e1b0231764d8b78b2b8ea..13da915991dd4b8bfa0a08236fdc6e485ed0f646 100644 (file)
@@ -1616,7 +1616,7 @@ static void dce_v8_0_afmt_setmode(struct drm_encoder *encoder,
        dce_v8_0_audio_write_sad_regs(encoder);
        dce_v8_0_audio_write_latency_fields(encoder, mode);
 
-       err = drm_hdmi_avi_infoframe_from_display_mode(&frame, mode, false);
+       err = drm_hdmi_avi_infoframe_from_display_mode(&frame, connector, mode);
        if (err < 0) {
                DRM_ERROR("failed to setup AVI infoframe: %zd\n", err);
                return;
index f8433c93f4634620c177c77ac67aea70337288ec..e11309e9bc4f595b1f93de0f9eb73e8a7cea5963 100644 (file)
@@ -1094,8 +1094,9 @@ static void anx78xx_bridge_mode_set(struct drm_bridge *bridge,
 
        mutex_lock(&anx78xx->lock);
 
-       err = drm_hdmi_avi_infoframe_from_display_mode(&frame, adjusted_mode,
-                                                      false);
+       err = drm_hdmi_avi_infoframe_from_display_mode(&frame,
+                                                      &anx78xx->connector,
+                                                      adjusted_mode);
        if (err) {
                DRM_ERROR("Failed to setup AVI infoframe: %d\n", err);
                goto unlock;
index bfa902013aa42e06f3eff686d25ba593cd9b2b89..a9b4f45ae87c95e71ec35960857952d4164dcc67 100644 (file)
@@ -258,7 +258,8 @@ static void sii902x_bridge_mode_set(struct drm_bridge *bridge,
        if (ret)
                return;
 
-       ret = drm_hdmi_avi_infoframe_from_display_mode(&frame, adj, false);
+       ret = drm_hdmi_avi_infoframe_from_display_mode(&frame,
+                                                      &sii902x->connector, adj);
        if (ret < 0) {
                DRM_ERROR("couldn't fill AVI infoframe\n");
                return;
index a6e8f4591e636241c6f1e8515fea33dc9147a7f3..0cc293a6ac246b391e11d6366a157d4326c91668 100644 (file)
@@ -1104,8 +1104,7 @@ static void sii8620_set_infoframes(struct sii8620 *ctx,
        int ret;
 
        ret = drm_hdmi_avi_infoframe_from_display_mode(&frm.avi,
-                                                      mode,
-                                                      true);
+                                                      NULL, mode);
        if (ctx->use_packed_pixel)
                frm.avi.colorspace = HDMI_COLORSPACE_YUV422;
 
index 64c3cf0275182649d9a5572ce6f3d907165f822a..88b720b63126b61a17fa549528db653706355ba6 100644 (file)
@@ -1344,7 +1344,8 @@ static void hdmi_config_AVI(struct dw_hdmi *hdmi, struct drm_display_mode *mode)
        u8 val;
 
        /* Initialise info frame from DRM mode */
-       drm_hdmi_avi_infoframe_from_display_mode(&frame, mode, false);
+       drm_hdmi_avi_infoframe_from_display_mode(&frame,
+                                                &hdmi->connector, mode);
 
        if (hdmi_bus_fmt_is_yuv444(hdmi->hdmi_data.enc_out_bus_format))
                frame.colorspace = HDMI_COLORSPACE_YUV444;
index b506e3622b08f64d5e1bb6d9ece2c716580883a8..cd25bd08bf53278c7a1762637661f6bdcb3683c4 100644 (file)
@@ -4830,19 +4830,32 @@ void drm_set_preferred_mode(struct drm_connector *connector,
 }
 EXPORT_SYMBOL(drm_set_preferred_mode);
 
+static bool is_hdmi2_sink(struct drm_connector *connector)
+{
+       /*
+        * FIXME: sil-sii8620 doesn't have a connector around when
+        * we need one, so we have to be prepared for a NULL connector.
+        */
+       if (!connector)
+               return true;
+
+       return connector->display_info.hdmi.scdc.supported ||
+               connector->display_info.color_formats & DRM_COLOR_FORMAT_YCRCB420;
+}
+
 /**
  * drm_hdmi_avi_infoframe_from_display_mode() - fill an HDMI AVI infoframe with
  *                                              data from a DRM display mode
  * @frame: HDMI AVI infoframe
+ * @connector: the connector
  * @mode: DRM display mode
- * @is_hdmi2_sink: Sink is HDMI 2.0 compliant
  *
  * Return: 0 on success or a negative error code on failure.
  */
 int
 drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
-                                        const struct drm_display_mode *mode,
-                                        bool is_hdmi2_sink)
+                                        struct drm_connector *connector,
+                                        const struct drm_display_mode *mode)
 {
        enum hdmi_picture_aspect picture_aspect;
        int err;
@@ -4864,7 +4877,7 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
         * HDMI 2.0 VIC range: 1 <= VIC <= 107 (CEA-861-F). So we
         * have to make sure we dont break HDMI 1.4 sinks.
         */
-       if (!is_hdmi2_sink && frame->video_code > 64)
+       if (!is_hdmi2_sink(connector) && frame->video_code > 64)
                frame->video_code = 0;
 
        /*
@@ -4923,21 +4936,17 @@ EXPORT_SYMBOL(drm_hdmi_avi_infoframe_from_display_mode);
  * drm_hdmi_avi_infoframe_quant_range() - fill the HDMI AVI infoframe
  *                                        quantization range information
  * @frame: HDMI AVI infoframe
+ * @connector: the connector
  * @mode: DRM display mode
  * @rgb_quant_range: RGB quantization range (Q)
  * @rgb_quant_range_selectable: Sink support selectable RGB quantization range (QS)
- * @is_hdmi2_sink: HDMI 2.0 sink, which has different default recommendations
- *
- * Note that @is_hdmi2_sink can be derived by looking at the
- * &drm_scdc.supported flag stored in &drm_hdmi_info.scdc,
- * &drm_display_info.hdmi, which can be found in &drm_connector.display_info.
  */
 void
 drm_hdmi_avi_infoframe_quant_range(struct hdmi_avi_infoframe *frame,
+                                  struct drm_connector *connector,
                                   const struct drm_display_mode *mode,
                                   enum hdmi_quantization_range rgb_quant_range,
-                                  bool rgb_quant_range_selectable,
-                                  bool is_hdmi2_sink)
+                                  bool rgb_quant_range_selectable)
 {
        /*
         * CEA-861:
@@ -4968,7 +4977,7 @@ drm_hdmi_avi_infoframe_quant_range(struct hdmi_avi_infoframe *frame,
         * we limit non-zero YQ to HDMI 2.0 sinks only as HDMI 2.0 is based
         * on on CEA-861-F.
         */
-       if (!is_hdmi2_sink ||
+       if (!is_hdmi2_sink(connector) ||
            rgb_quant_range == HDMI_QUANTIZATION_RANGE_LIMITED)
                frame->ycc_quantization_range =
                        HDMI_YCC_QUANTIZATION_RANGE_LIMITED;
index 2092a650df7d56b1262fc2f09036eb88ec62ce38..b857df67aff0a4b95aac290844c6ac1d85df8855 100644 (file)
@@ -819,7 +819,8 @@ static void hdmi_reg_infoframes(struct hdmi_context *hdata)
                return;
        }
 
-       ret = drm_hdmi_avi_infoframe_from_display_mode(&frm.avi, m, false);
+       ret = drm_hdmi_avi_infoframe_from_display_mode(&frm.avi,
+                                                      &hdata->connector, m);
        if (!ret)
                ret = hdmi_avi_infoframe_pack(&frm.avi, buf, sizeof(buf));
        if (ret > 0) {
index a7c39f39793ff2c2ce152e3cba3c3036513a7f19..38c66fbc8276bd96416d32855eb8fa6287bce7b3 100644 (file)
@@ -849,7 +849,8 @@ tda998x_write_avi(struct tda998x_priv *priv, struct drm_display_mode *mode)
 {
        union hdmi_infoframe frame;
 
-       drm_hdmi_avi_infoframe_from_display_mode(&frame.avi, mode, false);
+       drm_hdmi_avi_infoframe_from_display_mode(&frame.avi,
+                                                &priv->connector, mode);
        frame.avi.quantization_range = HDMI_QUANTIZATION_RANGE_FULL;
 
        tda998x_write_if(priv, DIP_IF_FLAGS_IF2, REG_IF2_HB0, &frame);
index e2c6a2b3e8f2591da7a2652c26955421f702e816..8a260bd6954c228a8c075f6686c26befe6385cef 100644 (file)
@@ -465,15 +465,12 @@ static void intel_hdmi_set_avi_infoframe(struct intel_encoder *encoder,
        struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base);
        const struct drm_display_mode *adjusted_mode =
                &crtc_state->base.adjusted_mode;
-       struct drm_connector *connector = &intel_hdmi->attached_connector->base;
-       bool is_hdmi2_sink = connector->display_info.hdmi.scdc.supported ||
-          connector->display_info.color_formats & DRM_COLOR_FORMAT_YCRCB420;
        union hdmi_infoframe frame;
        int ret;
 
        ret = drm_hdmi_avi_infoframe_from_display_mode(&frame.avi,
-                                                      adjusted_mode,
-                                                      is_hdmi2_sink);
+                                                      conn_state->connector,
+                                                      adjusted_mode);
        if (ret < 0) {
                DRM_ERROR("couldn't fill AVI infoframe\n");
                return;
@@ -486,12 +483,13 @@ static void intel_hdmi_set_avi_infoframe(struct intel_encoder *encoder,
        else
                frame.avi.colorspace = HDMI_COLORSPACE_RGB;
 
-       drm_hdmi_avi_infoframe_quant_range(&frame.avi, adjusted_mode,
+       drm_hdmi_avi_infoframe_quant_range(&frame.avi,
+                                          conn_state->connector,
+                                          adjusted_mode,
                                           crtc_state->limited_color_range ?
                                           HDMI_QUANTIZATION_RANGE_LIMITED :
                                           HDMI_QUANTIZATION_RANGE_FULL,
-                                          intel_hdmi->rgb_quant_range_selectable,
-                                          is_hdmi2_sink);
+                                          intel_hdmi->rgb_quant_range_selectable);
 
        drm_hdmi_avi_infoframe_content_type(&frame.avi,
                                            conn_state);
index 96a8d9524b0c24445972e99c5a3bc958f379b739..c18f14d41f1d1f2391af3e9ae60a268e4a7808f8 100644 (file)
@@ -462,10 +462,8 @@ void lspcon_set_infoframes(struct intel_encoder *encoder,
        uint8_t buf[VIDEO_DIP_DATA_SIZE];
        struct intel_digital_port *dig_port = enc_to_dig_port(&encoder->base);
        struct intel_lspcon *lspcon = &dig_port->lspcon;
-       struct intel_dp *intel_dp = &dig_port->dp;
-       struct drm_connector *connector = &intel_dp->attached_connector->base;
-       const struct drm_display_mode *mode = &crtc_state->base.adjusted_mode;
-       bool is_hdmi2_sink = connector->display_info.hdmi.scdc.supported;
+       const struct drm_display_mode *adjusted_mode =
+               &crtc_state->base.adjusted_mode;
 
        if (!lspcon->active) {
                DRM_ERROR("Writing infoframes while LSPCON disabled ?\n");
@@ -473,7 +471,8 @@ void lspcon_set_infoframes(struct intel_encoder *encoder,
        }
 
        ret = drm_hdmi_avi_infoframe_from_display_mode(&frame.avi,
-                                                      mode, is_hdmi2_sink);
+                                                      conn_state->connector,
+                                                      adjusted_mode);
        if (ret < 0) {
                DRM_ERROR("couldn't fill AVI infoframe\n");
                return;
@@ -488,11 +487,13 @@ void lspcon_set_infoframes(struct intel_encoder *encoder,
                frame.avi.colorspace = HDMI_COLORSPACE_RGB;
        }
 
-       drm_hdmi_avi_infoframe_quant_range(&frame.avi, mode,
+       drm_hdmi_avi_infoframe_quant_range(&frame.avi,
+                                          conn_state->connector,
+                                          adjusted_mode,
                                           crtc_state->limited_color_range ?
                                           HDMI_QUANTIZATION_RANGE_LIMITED :
                                           HDMI_QUANTIZATION_RANGE_FULL,
-                                          false, is_hdmi2_sink);
+                                          false);
 
        ret = hdmi_infoframe_pack(&frame, buf, sizeof(buf));
        if (ret < 0) {
index 5805ec1aba122495736167c0f66ee86cd5da249d..1277d31adb54a95f5eb2de92fa54927989ac039d 100644 (file)
@@ -981,7 +981,8 @@ static bool intel_sdvo_write_infoframe(struct intel_sdvo *intel_sdvo,
 }
 
 static bool intel_sdvo_set_avi_infoframe(struct intel_sdvo *intel_sdvo,
-                                        const struct intel_crtc_state *pipe_config)
+                                        const struct intel_crtc_state *pipe_config,
+                                        const struct drm_connector_state *conn_state)
 {
        uint8_t sdvo_data[HDMI_INFOFRAME_SIZE(AVI)];
        union hdmi_infoframe frame;
@@ -989,8 +990,8 @@ static bool intel_sdvo_set_avi_infoframe(struct intel_sdvo *intel_sdvo,
        ssize_t len;
 
        ret = drm_hdmi_avi_infoframe_from_display_mode(&frame.avi,
-                                                      &pipe_config->base.adjusted_mode,
-                                                      false);
+                                                      conn_state->connector,
+                                                      &pipe_config->base.adjusted_mode);
        if (ret < 0) {
                DRM_ERROR("couldn't fill AVI infoframe\n");
                return false;
@@ -1316,7 +1317,8 @@ static void intel_sdvo_pre_enable(struct intel_encoder *intel_encoder,
                intel_sdvo_set_encode(intel_sdvo, SDVO_ENCODE_HDMI);
                intel_sdvo_set_colorimetry(intel_sdvo,
                                           SDVO_COLORIMETRY_RGB256);
-               intel_sdvo_set_avi_infoframe(intel_sdvo, crtc_state);
+               intel_sdvo_set_avi_infoframe(intel_sdvo,
+                                            crtc_state, conn_state);
        } else
                intel_sdvo_set_encode(intel_sdvo, SDVO_ENCODE_DVI);
 
index 862f3ec221318800f9850755e2ec2d89deec7df4..f3ef7bf80563fcfe68e67ed2c7922805a268d1a7 100644 (file)
@@ -981,7 +981,8 @@ static int mtk_hdmi_setup_avi_infoframe(struct mtk_hdmi *hdmi,
        u8 buffer[17];
        ssize_t err;
 
-       err = drm_hdmi_avi_infoframe_from_display_mode(&frame, mode, false);
+       err = drm_hdmi_avi_infoframe_from_display_mode(&frame,
+                                                      &hdmi->conn, mode);
        if (err < 0) {
                dev_err(hdmi->dev,
                        "Failed to get AVI infoframe from mode: %zd\n", err);
index 7e357077ed2634dadb2436c6c5abfb0d6625583b..5ed4cab2819f5a77edbf2718a0bae1880862909a 100644 (file)
@@ -101,7 +101,8 @@ static void msm_hdmi_config_avi_infoframe(struct hdmi *hdmi)
        u32 val;
        int len;
 
-       drm_hdmi_avi_infoframe_from_display_mode(&frame.avi, mode, false);
+       drm_hdmi_avi_infoframe_from_display_mode(&frame.avi,
+                                                hdmi->connector, mode);
 
        len = hdmi_infoframe_pack(&frame, buffer, sizeof(buffer));
        if (len < 0) {
index 4a56841958c8557ae9ed0d9b6bb7b4156c767f9d..f36146d4d9b7fe506836dee2a5182ab29f011990 100644 (file)
@@ -554,7 +554,7 @@ nv50_hdmi_enable(struct drm_encoder *encoder, struct drm_display_mode *mode)
        u32 max_ac_packet;
        union hdmi_infoframe avi_frame;
        union hdmi_infoframe vendor_frame;
-       bool scdc_supported, high_tmds_clock_ratio = false, scrambling = false;
+       bool high_tmds_clock_ratio = false, scrambling = false;
        u8 config;
        int ret;
        int size;
@@ -564,10 +564,9 @@ nv50_hdmi_enable(struct drm_encoder *encoder, struct drm_display_mode *mode)
                return;
 
        hdmi = &nv_connector->base.display_info.hdmi;
-       scdc_supported = hdmi->scdc.supported;
 
-       ret = drm_hdmi_avi_infoframe_from_display_mode(&avi_frame.avi, mode,
-                                                      scdc_supported);
+       ret = drm_hdmi_avi_infoframe_from_display_mode(&avi_frame.avi,
+                                                      &nv_connector->base, mode);
        if (!ret) {
                /* We have an AVI InfoFrame, populate it to the display */
                args.pwr.avi_infoframe_length
index 452e625f6ce331a24a13afe8c40209cab5e0b0d1..4566e0a75cb8bb660d602d2067d0d5aa207e9a1d 100644 (file)
@@ -128,8 +128,8 @@ static void omap_encoder_mode_set(struct drm_encoder *encoder,
        if (hdmi_mode && dssdev->ops->hdmi.set_infoframe) {
                struct hdmi_avi_infoframe avi;
 
-               r = drm_hdmi_avi_infoframe_from_display_mode(&avi, adjusted_mode,
-                                                            false);
+               r = drm_hdmi_avi_infoframe_from_display_mode(&avi, connector,
+                                                            adjusted_mode);
                if (r == 0)
                        dssdev->ops->hdmi.set_infoframe(dssdev, &avi);
        }
index 770e31f5fd1b0c720762aeb8b9eee949c5c01aa0..5a7d48339b32c7cd09525f99270753a76d87e793 100644 (file)
@@ -516,7 +516,7 @@ static int radeon_audio_set_avi_packet(struct drm_encoder *encoder,
        if (!connector)
                return -EINVAL;
 
-       err = drm_hdmi_avi_infoframe_from_display_mode(&frame, mode, false);
+       err = drm_hdmi_avi_infoframe_from_display_mode(&frame, connector, mode);
        if (err < 0) {
                DRM_ERROR("failed to setup AVI infoframe: %d\n", err);
                return err;
index 1c02b3e61299c800549519a9f065ac2691f665fc..27c945e030a0baa766694a4f0402666fe94c1659 100644 (file)
@@ -295,7 +295,9 @@ static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi,
        union hdmi_infoframe frame;
        int rc;
 
-       rc = drm_hdmi_avi_infoframe_from_display_mode(&frame.avi, mode, false);
+       rc = drm_hdmi_avi_infoframe_from_display_mode(&frame.avi,
+                                                     &hdmi->connector,
+                                                     mode);
 
        if (hdmi->hdmi_data.enc_out_format == HDMI_COLORSPACE_YUV444)
                frame.avi.colorspace = HDMI_COLORSPACE_YUV444;
index ccf718404a1c23e557dd6ff097d779f3bff9729c..4b86878f8ddfa2281ad5fe77502b6a04ec884447 100644 (file)
@@ -434,7 +434,8 @@ static int hdmi_avi_infoframe_config(struct sti_hdmi *hdmi)
 
        DRM_DEBUG_DRIVER("\n");
 
-       ret = drm_hdmi_avi_infoframe_from_display_mode(&infoframe, mode, false);
+       ret = drm_hdmi_avi_infoframe_from_display_mode(&infoframe,
+                                                      hdmi->drm_connector, mode);
        if (ret < 0) {
                DRM_ERROR("failed to setup AVI infoframe: %d\n", ret);
                return ret;
index 061d2e0d9011ee88991b3f0fb1b4e2dd54925bee..554a6f4561f3cfc47b7f4250722e5a92ba857451 100644 (file)
@@ -52,7 +52,8 @@ static int sun4i_hdmi_setup_avi_infoframes(struct sun4i_hdmi *hdmi,
        u8 buffer[17];
        int i, ret;
 
-       ret = drm_hdmi_avi_infoframe_from_display_mode(&frame, mode, false);
+       ret = drm_hdmi_avi_infoframe_from_display_mode(&frame,
+                                                      &hdmi->connector, mode);
        if (ret < 0) {
                DRM_ERROR("Failed to get infoframes from mode\n");
                return ret;
index 0082468f703c8c12ec89b142142b61b84b22fe89..a7566c67bfb05685dc8281c700196e10d4610022 100644 (file)
@@ -741,7 +741,8 @@ static void tegra_hdmi_setup_avi_infoframe(struct tegra_hdmi *hdmi,
        u8 buffer[17];
        ssize_t err;
 
-       err = drm_hdmi_avi_infoframe_from_display_mode(&frame, mode, false);
+       err = drm_hdmi_avi_infoframe_from_display_mode(&frame,
+                                                      &hdmi->output.connector, mode);
        if (err < 0) {
                dev_err(hdmi->dev, "failed to setup AVI infoframe: %zd\n", err);
                return;
index b129da2e5afd5ede520bb60e442cc18fb5624d46..d90bf5f6a67a014957efe8eeb8214bc208c9e025 100644 (file)
@@ -2116,7 +2116,8 @@ tegra_sor_hdmi_setup_avi_infoframe(struct tegra_sor *sor,
        value &= ~INFOFRAME_CTRL_ENABLE;
        tegra_sor_writel(sor, value, SOR_HDMI_AVI_INFOFRAME_CTRL);
 
-       err = drm_hdmi_avi_infoframe_from_display_mode(&frame, mode, false);
+       err = drm_hdmi_avi_infoframe_from_display_mode(&frame,
+                                                      &sor->output.connector, mode);
        if (err < 0) {
                dev_err(sor->dev, "failed to setup AVI infoframe: %d\n", err);
                return err;
index 2f276222e30fa6d130711124ab06c91538520e3f..4f9a80f7f2427134dbe78d883a9821ee5b8044cc 100644 (file)
@@ -424,18 +424,19 @@ static void vc4_hdmi_set_avi_infoframe(struct drm_encoder *encoder)
        union hdmi_infoframe frame;
        int ret;
 
-       ret = drm_hdmi_avi_infoframe_from_display_mode(&frame.avi, mode, false);
+       ret = drm_hdmi_avi_infoframe_from_display_mode(&frame.avi,
+                                                      hdmi->connector, mode);
        if (ret < 0) {
                DRM_ERROR("couldn't fill AVI infoframe\n");
                return;
        }
 
-       drm_hdmi_avi_infoframe_quant_range(&frame.avi, mode,
+       drm_hdmi_avi_infoframe_quant_range(&frame.avi,
+                                          hdmi->connector, mode,
                                           vc4_encoder->limited_rgb_range ?
                                           HDMI_QUANTIZATION_RANGE_LIMITED :
                                           HDMI_QUANTIZATION_RANGE_FULL,
-                                          vc4_encoder->rgb_range_selectable,
-                                          false);
+                                          vc4_encoder->rgb_range_selectable);
 
        frame.avi.right_bar = cstate->tv.margins.right;
        frame.avi.left_bar = cstate->tv.margins.left;
index 78655269d84343d683fc2278740ff21e075c3d1d..9fc98bb4f3d9e452128ab104e803540f4ced1d39 100644 (file)
@@ -125,7 +125,9 @@ static int zx_hdmi_config_video_avi(struct zx_hdmi *hdmi,
        union hdmi_infoframe frame;
        int ret;
 
-       ret = drm_hdmi_avi_infoframe_from_display_mode(&frame.avi, mode, false);
+       ret = drm_hdmi_avi_infoframe_from_display_mode(&frame.avi,
+                                                      &hdmi->connector,
+                                                      mode);
        if (ret) {
                DRM_DEV_ERROR(hdmi->dev, "failed to get avi infoframe: %d\n",
                              ret);
index e3c40483311569f26bac07cfbe007986860d22d0..9db6f130df65b30ec679216a9d2a6aaab0691eb6 100644 (file)
@@ -352,18 +352,18 @@ drm_load_edid_firmware(struct drm_connector *connector)
 
 int
 drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
-                                        const struct drm_display_mode *mode,
-                                        bool is_hdmi2_sink);
+                                        struct drm_connector *connector,
+                                        const struct drm_display_mode *mode);
 int
 drm_hdmi_vendor_infoframe_from_display_mode(struct hdmi_vendor_infoframe *frame,
                                            struct drm_connector *connector,
                                            const struct drm_display_mode *mode);
 void
 drm_hdmi_avi_infoframe_quant_range(struct hdmi_avi_infoframe *frame,
+                                  struct drm_connector *connector,
                                   const struct drm_display_mode *mode,
                                   enum hdmi_quantization_range rgb_quant_range,
-                                  bool rgb_quant_range_selectable,
-                                  bool is_hdmi2_sink);
+                                  bool rgb_quant_range_selectable);
 
 /**
  * drm_eld_mnl - Get ELD monitor name length in bytes.