dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Jyri Sarha <jsarha@ti.com>
Cc: fabrizio.castro@bp.renesas.com, devicetree@vger.kernel.org,
	Songjun.Wu@atmel.com, tony@atomide.com,
	dri-devel@lists.freedesktop.org, peter.ujfalusi@ti.com,
	tomi.valkeinen@ti.com, voice.shen@atmel.com
Subject: Re: [PATCH v2 2/5] drm/bridge: sii902x: Set output mode to HDMI or DVI according to EDID
Date: Mon, 4 Mar 2019 14:52:01 +0200	[thread overview]
Message-ID: <20190304125201.GN6325@pendragon.ideasonboard.com> (raw)
In-Reply-To: <08d50e5eec760273a3b3699ea98732f5ec66ad25.1551303673.git.jsarha@ti.com>

Hi Jyri,

Thank you for the patch.
On Wed, Feb 27, 2019 at 11:54:20PM +0200, Jyri Sarha wrote:
> Set output mode to HDMI or DVI according to EDID HDMI signature.
> 
> Signed-off-by: Jyri Sarha <jsarha@ti.com>
> Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
> ---
>  drivers/gpu/drm/bridge/sii902x.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c
> index 1afa000141d5..0e21fa419d27 100644
> --- a/drivers/gpu/drm/bridge/sii902x.c
> +++ b/drivers/gpu/drm/bridge/sii902x.c
> @@ -181,11 +181,15 @@ static int sii902x_get_modes(struct drm_connector *connector)
>  	struct sii902x *sii902x = connector_to_sii902x(connector);
>  	u32 bus_format = MEDIA_BUS_FMT_RGB888_1X24;
>  	struct edid *edid;
> +	u8 output_mode = SII902X_SYS_CTRL_OUTPUT_DVI;

I'd move this one line up, but that's certainly a matter of taste :-)
>  	int num = 0, ret;
>  
>  	edid = drm_get_edid(connector, sii902x->i2cmux->adapter[0]);
>  	drm_connector_update_edid_property(connector, edid);
>  	if (edid) {
> +	        if (drm_detect_hdmi_monitor(edid))
> +			output_mode = SII902X_SYS_CTRL_OUTPUT_HDMI;
> +
>  		num = drm_add_edid_modes(connector, edid);
>  		kfree(edid);
>  	}
> @@ -195,6 +199,11 @@ static int sii902x_get_modes(struct drm_connector *connector)
>  	if (ret)
>  		return ret;
>  
> +	ret = regmap_update_bits(sii902x->regmap, SII902X_SYS_CTRL_DATA,
> +				 SII902X_SYS_CTRL_OUTPUT_MODE, output_mode);
> +	if (ret)
> +		return ret;
> +

Is this the right place to update the register, shouldn't this be done
in sii902x_bridge_enable() instead ? I could foresee cases where the
chip could be powered down between get_modes() and enable(), losing its
internal state.

>  	return num;
>  }
>  

-- 
Regards,

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

  reply	other threads:[~2019-03-04 12:52 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-27 21:54 [PATCH v2 0/5] drm/bridge: sii902x: HDMI-audio support and some fixes Jyri Sarha
2019-02-27 21:54 ` [PATCH v2 1/5] drm/bridge: sii902x: add input_bus_flags Jyri Sarha
2019-03-04 12:48   ` Laurent Pinchart
2019-02-27 21:54 ` [PATCH v2 2/5] drm/bridge: sii902x: Set output mode to HDMI or DVI according to EDID Jyri Sarha
2019-03-04 12:52   ` Laurent Pinchart [this message]
2019-03-04 14:15     ` Jyri Sarha
2019-02-27 21:54 ` [PATCH v2 3/5] drm/bridge: sii902x: pixel clock unit is 10kHz instead of 1kHz Jyri Sarha
2019-03-04 15:59   ` Laurent Pinchart
2019-02-27 21:54 ` [PATCH v2 4/5] drm/bridge: sii902x: Select I2C_MUX Jyri Sarha
2019-03-04  8:54   ` Andrzej Hajda
2019-03-04 16:05   ` Laurent Pinchart
2019-02-27 21:54 ` [PATCH v2 5/5] drm/bridge: sii902x: Implement HDMI audio support Jyri Sarha
2019-03-04  9:26   ` Andrzej Hajda
2019-03-12 16:11   ` Rob Herring
2019-03-04 12:42 ` [PATCH v2 0/5] drm/bridge: sii902x: HDMI-audio support and some fixes Laurent Pinchart
2019-03-04 14:29   ` Jyri Sarha
2019-03-04 16:10     ` Laurent Pinchart
2019-03-06 14:18     ` Olivier MOYSAN

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=20190304125201.GN6325@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=Songjun.Wu@atmel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=fabrizio.castro@bp.renesas.com \
    --cc=jsarha@ti.com \
    --cc=peter.ujfalusi@ti.com \
    --cc=tomi.valkeinen@ti.com \
    --cc=tony@atomide.com \
    --cc=voice.shen@atmel.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