dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Maxime Ripard <maxime@cerno.tech>,
	Andrzej Hajda <a.hajda@samsung.com>,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
	Daniel Vetter <daniel.vetter@intel.com>,
	David Airlie <airlied@linux.ie>,
	Jernej Skrabec <jernej.skrabec@siol.net>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Neil Armstrong <narmstrong@baylibre.com>,
	Jonas Karlman <jonas@kwiboo.se>
Cc: Tim Gover <tim.gover@raspberrypi.com>,
	Dave Stevenson <dave.stevenson@raspberrypi.com>,
	dri-devel@lists.freedesktop.org,
	bcm-kernel-feedback-list@broadcom.com,
	linux-rpi-kernel@lists.infradead.org,
	Phil Elwell <phil@raspberrypi.com>
Subject: Re: [PATCH 15/18] drm/vc4: hdmi: Rework the infoframe prototype
Date: Wed, 14 Apr 2021 15:58:22 +0200	[thread overview]
Message-ID: <1666ffcd-6dda-68ec-1963-d96d1795b409@suse.de> (raw)
In-Reply-To: <20210317154352.732095-16-maxime@cerno.tech>


[-- Attachment #1.1.1: Type: text/plain, Size: 5721 bytes --]



Am 17.03.21 um 16:43 schrieb Maxime Ripard:
> In order to support a YUV output, we're going to need to have access to
> the bridge state in the vc4_hdmi_set_avi_infoframe function. Since we
> also need the connector state in that function, let's pass the full
> atomic state.
> 
> While we're at it, since all those functions actually need the vc4_hdmi
> structure, let's pass it instead of the drm_encoder.
> 
> Signed-off-by: Maxime Ripard <maxime@cerno.tech>

Acked-by: Thomas Zimmermann <tzimmermann@suse.de>

> ---
>   drivers/gpu/drm/vc4/vc4_hdmi.c | 38 ++++++++++++++++------------------
>   1 file changed, 18 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
> index 56b5654c820f..83e44cf44d65 100644
> --- a/drivers/gpu/drm/vc4/vc4_hdmi.c
> +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
> @@ -330,10 +330,10 @@ static int vc4_hdmi_stop_packet(struct drm_encoder *encoder,
>   			  BIT(packet_id)), 100);
>   }
>   
> -static void vc4_hdmi_write_infoframe(struct drm_encoder *encoder,
> +static void vc4_hdmi_write_infoframe(struct vc4_hdmi *vc4_hdmi,
>   				     union hdmi_infoframe *frame)
>   {
> -	struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
> +	struct drm_encoder *encoder = &vc4_hdmi->encoder.base.base;
>   	u32 packet_id = frame->any.type - 0x80;
>   	const struct vc4_hdmi_register *ram_packet_start =
>   		&vc4_hdmi->variant->registers[HDMI_RAM_PACKET_START];
> @@ -381,11 +381,13 @@ static void vc4_hdmi_write_infoframe(struct drm_encoder *encoder,
>   		DRM_ERROR("Failed to wait for infoframe to start: %d\n", ret);
>   }
>   
> -static void vc4_hdmi_set_avi_infoframe(struct drm_encoder *encoder)
> +static void vc4_hdmi_set_avi_infoframe(struct vc4_hdmi *vc4_hdmi,
> +				       struct drm_atomic_state *state)
>   {
> -	struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
> +	struct drm_encoder *encoder = &vc4_hdmi->encoder.base.base;
>   	struct drm_connector *connector = &vc4_hdmi->connector;
> -	struct drm_connector_state *cstate = connector->state;
> +	struct drm_connector_state *cstate =
> +		drm_atomic_get_new_connector_state(state, connector);
>   	struct drm_crtc *crtc = encoder->crtc;
>   	const struct drm_display_mode *mode = &crtc->state->adjusted_mode;
>   	union hdmi_infoframe frame;
> @@ -406,10 +408,10 @@ static void vc4_hdmi_set_avi_infoframe(struct drm_encoder *encoder)
>   
>   	drm_hdmi_avi_infoframe_bars(&frame.avi, cstate);
>   
> -	vc4_hdmi_write_infoframe(encoder, &frame);
> +	vc4_hdmi_write_infoframe(vc4_hdmi, &frame);
>   }
>   
> -static void vc4_hdmi_set_spd_infoframe(struct drm_encoder *encoder)
> +static void vc4_hdmi_set_spd_infoframe(struct vc4_hdmi *vc4_hdmi)
>   {
>   	union hdmi_infoframe frame;
>   	int ret;
> @@ -422,12 +424,11 @@ static void vc4_hdmi_set_spd_infoframe(struct drm_encoder *encoder)
>   
>   	frame.spd.sdi = HDMI_SPD_SDI_PC;
>   
> -	vc4_hdmi_write_infoframe(encoder, &frame);
> +	vc4_hdmi_write_infoframe(vc4_hdmi, &frame);
>   }
>   
> -static void vc4_hdmi_set_audio_infoframe(struct drm_encoder *encoder)
> +static void vc4_hdmi_set_audio_infoframe(struct vc4_hdmi *vc4_hdmi)
>   {
> -	struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
>   	union hdmi_infoframe frame;
>   
>   	hdmi_audio_infoframe_init(&frame.audio);
> @@ -437,21 +438,19 @@ static void vc4_hdmi_set_audio_infoframe(struct drm_encoder *encoder)
>   	frame.audio.sample_size = HDMI_AUDIO_SAMPLE_SIZE_STREAM;
>   	frame.audio.channels = vc4_hdmi->audio.channels;
>   
> -	vc4_hdmi_write_infoframe(encoder, &frame);
> +	vc4_hdmi_write_infoframe(vc4_hdmi, &frame);
>   }
>   
> -static void vc4_hdmi_set_infoframes(struct drm_encoder *encoder)
> +static void vc4_hdmi_set_infoframes(struct vc4_hdmi *vc4_hdmi, struct drm_atomic_state *state)
>   {
> -	struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
> -
> -	vc4_hdmi_set_avi_infoframe(encoder);
> -	vc4_hdmi_set_spd_infoframe(encoder);
> +	vc4_hdmi_set_avi_infoframe(vc4_hdmi, state);
> +	vc4_hdmi_set_spd_infoframe(vc4_hdmi);
>   	/*
>   	 * If audio was streaming, then we need to reenabled the audio
>   	 * infoframe here during encoder_enable.
>   	 */
>   	if (vc4_hdmi->audio.streaming)
> -		vc4_hdmi_set_audio_infoframe(encoder);
> +		vc4_hdmi_set_audio_infoframe(vc4_hdmi);
>   }
>   
>   static void vc4_hdmi_bridge_post_crtc_disable(struct drm_bridge *bridge,
> @@ -921,7 +920,7 @@ static void vc4_hdmi_bridge_post_crtc_enable(struct 
drm_bridge *bridge,
>   		HDMI_WRITE(HDMI_RAM_PACKET_CONFIG,
>   			   VC4_HDMI_RAM_PACKET_ENABLE);
>   
> -		vc4_hdmi_set_infoframes(encoder);
> +		vc4_hdmi_set_infoframes(vc4_hdmi, state);
>   	}
>   
>   	vc4_hdmi_recenter_fifo(vc4_hdmi);
> @@ -1184,7 +1183,6 @@ static int vc4_hdmi_audio_hw_params(struct snd_pcm_substream *substream,
>   				    struct snd_soc_dai *dai)
>   {
>   	struct vc4_hdmi *vc4_hdmi = dai_to_hdmi(dai);
> -	struct drm_encoder *encoder = &vc4_hdmi->encoder.base.base;
>   	struct device *dev = &vc4_hdmi->pdev->dev;
>   	u32 audio_packet_config, channel_mask;
>   	u32 channel_map;
> @@ -1244,7 +1242,7 @@ static int vc4_hdmi_audio_hw_params(struct snd_pcm_substream *substream,
>   	HDMI_WRITE(HDMI_AUDIO_PACKET_CONFIG, audio_packet_config);
>   	vc4_hdmi_set_n_cts(vc4_hdmi);
>   
> -	vc4_hdmi_set_audio_infoframe(encoder);
> +	vc4_hdmi_set_audio_infoframe(vc4_hdmi);
>   
>   	return 0;
>   }
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2021-04-14 13:58 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-17 15:43 [PATCH 00/18] drm/vc4: hdmi: Add Support for the YUV output Maxime Ripard
2021-03-17 15:43 ` [PATCH 01/18] drm: Introduce new HDMI helpers Maxime Ripard
2021-04-09  7:16   ` Thomas Zimmermann
2021-03-17 15:43 ` [PATCH 02/18] drm/bridge: Add HDMI output fmt helper Maxime Ripard
2021-03-17 16:08   ` Neil Armstrong
2021-03-18 18:31     ` Jernej Škrabec
2021-03-19  9:44       ` Neil Armstrong
2021-03-19 10:09         ` Maxime Ripard
2021-04-09  8:03   ` Thomas Zimmermann
2021-03-17 15:43 ` [PATCH 03/18] drm/bridge: dw-hdmi: Use helpers Maxime Ripard
2021-04-09  8:05   ` Thomas Zimmermann
2021-03-17 15:43 ` [PATCH 04/18] drm/vc4: txp: Properly set the possible_crtcs mask Maxime Ripard
2021-04-09  8:07   ` Thomas Zimmermann
2021-04-09  8:11   ` Thomas Zimmermann
2021-03-17 15:43 ` [PATCH 05/18] drm/vc4: crtc: Skip the TXP Maxime Ripard
2021-04-09  8:10   ` Thomas Zimmermann
2021-03-17 15:43 ` [PATCH 06/18] drm/vc4: Rework the encoder retrieval code Maxime Ripard
2021-04-09  8:54   ` Thomas Zimmermann
2021-03-17 15:43 ` [PATCH 07/18] drm/vc4: hdmi: Add full range RGB helper Maxime Ripard
2021-04-12  9:44   ` Thomas Zimmermann
2021-04-14 13:48     ` Maxime Ripard
2021-03-17 15:43 ` [PATCH 08/18] drm/vc4: hdmi: Use full range helper in csc functions Maxime Ripard
2021-04-12  9:45   ` Thomas Zimmermann
2021-03-17 15:43 ` [PATCH 09/18] drm/vc4: hdmi: Remove limited_rgb_range Maxime Ripard
2021-04-12 10:19   ` Thomas Zimmermann
2021-03-17 15:43 ` [PATCH 10/18] drm/vc4: hdmi: Convert to bridge Maxime Ripard
2021-04-12 10:21   ` Thomas Zimmermann
2021-03-17 15:43 ` [PATCH 11/18] drm/vc4: hdmi: Move XBAR setup to csc_setup Maxime Ripard
2021-04-12 10:28   ` Thomas Zimmermann
2021-03-17 15:43 ` [PATCH 12/18] drm/vc4: hdmi: Replace CSC_CTL hardcoded value by defines Maxime Ripard
2021-04-12 10:28   ` Thomas Zimmermann
2021-03-17 15:43 ` [PATCH 13/18] drm/vc4: hdmi: Define colorspace matrices Maxime Ripard
2021-04-14 13:54   ` Thomas Zimmermann
2021-03-17 15:43 ` [PATCH 14/18] drm/vc4: hdmi: Change CSC callback prototype Maxime Ripard
2021-04-14 13:56   ` Thomas Zimmermann
2021-03-17 15:43 ` [PATCH 15/18] drm/vc4: hdmi: Rework the infoframe prototype Maxime Ripard
2021-04-14 13:58   ` Thomas Zimmermann [this message]
2021-03-17 15:43 ` [PATCH 16/18] drm/vc4: hdmi: Support HDMI YUV output Maxime Ripard
2021-04-15  6:43   ` Thomas Zimmermann
2021-03-17 15:43 ` [PATCH 17/18] drm/vc4: hdmi: Move the pixel rate calculation to a helper Maxime Ripard
2021-04-15  7:19   ` Thomas Zimmermann
2021-03-17 15:43 ` [PATCH 18/18] drm/vc4: hdmi: Force YUV422 if the rate is too high Maxime Ripard
2021-04-15  7:24   ` Thomas Zimmermann
2021-03-18 18:16 ` [PATCH 00/18] drm/vc4: hdmi: Add Support for the YUV output Jernej Škrabec
2021-03-19 10:13   ` Maxime Ripard
2021-04-09  9:47   ` Neil Armstrong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1666ffcd-6dda-68ec-1963-d96d1795b409@suse.de \
    --to=tzimmermann@suse.de \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=a.hajda@samsung.com \
    --cc=airlied@linux.ie \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=daniel.vetter@intel.com \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jernej.skrabec@siol.net \
    --cc=jonas@kwiboo.se \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=maxime@cerno.tech \
    --cc=narmstrong@baylibre.com \
    --cc=phil@raspberrypi.com \
    --cc=tim.gover@raspberrypi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).