From: Tomi Valkeinen <tomi.valkeinen@ti.com> To: Hans Verkuil <hverkuil@xs4all.nl>, <linux-media@vger.kernel.org> Cc: <dri-devel@lists.freedesktop.org>, Hans Verkuil <hans.verkuil@cisco.com> Subject: Re: [PATCH 6/8] omapdrm: hdmi4: refcount hdmi_power_on/off_core Date: Fri, 28 Apr 2017 14:30:00 +0300 [thread overview] Message-ID: <15b0996c-5756-19ac-7393-11c245417ce4@ti.com> (raw) In-Reply-To: <20170414102512.48834-7-hverkuil@xs4all.nl> [-- Attachment #1.1: Type: text/plain, Size: 1878 bytes --] On 14/04/17 13:25, Hans Verkuil wrote: > From: Hans Verkuil <hans.verkuil@cisco.com> > > The hdmi_power_on/off_core functions can be called multiple times: > when the HPD changes and when the HDMI CEC support needs to power > the HDMI core. > > So use a counter to know when to really power on or off the HDMI core. > > Also call hdmi4_core_powerdown_disable() in hdmi_power_on_core() to > power up the HDMI core (needed for CEC). > > Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> > --- > drivers/gpu/drm/omapdrm/dss/hdmi4.c | 12 +++++++++++- > 1 file changed, 11 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4.c b/drivers/gpu/drm/omapdrm/dss/hdmi4.c > index 4a164dc01f15..e371b47ff6ff 100644 > --- a/drivers/gpu/drm/omapdrm/dss/hdmi4.c > +++ b/drivers/gpu/drm/omapdrm/dss/hdmi4.c > @@ -124,14 +124,19 @@ static int hdmi_power_on_core(struct omap_dss_device *dssdev) > { > int r; > > + if (hdmi.core.core_pwr_cnt++) > + return 0; > + How's the locking between the CEC side and the DRM side? Normally these functions are protected with the DRM modesetting locks, but CEC doesn't come from there. We have the hdmi.lock, did you check that it's held when CEC side calls shared functions? > r = regulator_enable(hdmi.vdda_reg); > if (r) > - return r; > + goto err_reg_enable; > > r = hdmi_runtime_get(); > if (r) > goto err_runtime_get; > > + hdmi4_core_powerdown_disable(&hdmi.core); I'd like to have the powerdown_disable as a separate patch. Also, now that you call it here, I believe it can be dropped from hdmi4_configure(). Hmm, but in hdmi4_configure we call hdmi_core_swreset_assert() before hdmi4_core_powerdown_disable(). I wonder what exactly that does, and whether we end up resetting also the CEC parts when we change the videomode. Tomi [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 819 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Tomi Valkeinen <tomi.valkeinen@ti.com> To: Hans Verkuil <hverkuil@xs4all.nl>, linux-media@vger.kernel.org Cc: dri-devel@lists.freedesktop.org, Hans Verkuil <hans.verkuil@cisco.com> Subject: Re: [PATCH 6/8] omapdrm: hdmi4: refcount hdmi_power_on/off_core Date: Fri, 28 Apr 2017 14:30:00 +0300 [thread overview] Message-ID: <15b0996c-5756-19ac-7393-11c245417ce4@ti.com> (raw) In-Reply-To: <20170414102512.48834-7-hverkuil@xs4all.nl> [-- Attachment #1.1: Type: text/plain, Size: 1878 bytes --] On 14/04/17 13:25, Hans Verkuil wrote: > From: Hans Verkuil <hans.verkuil@cisco.com> > > The hdmi_power_on/off_core functions can be called multiple times: > when the HPD changes and when the HDMI CEC support needs to power > the HDMI core. > > So use a counter to know when to really power on or off the HDMI core. > > Also call hdmi4_core_powerdown_disable() in hdmi_power_on_core() to > power up the HDMI core (needed for CEC). > > Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> > --- > drivers/gpu/drm/omapdrm/dss/hdmi4.c | 12 +++++++++++- > 1 file changed, 11 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4.c b/drivers/gpu/drm/omapdrm/dss/hdmi4.c > index 4a164dc01f15..e371b47ff6ff 100644 > --- a/drivers/gpu/drm/omapdrm/dss/hdmi4.c > +++ b/drivers/gpu/drm/omapdrm/dss/hdmi4.c > @@ -124,14 +124,19 @@ static int hdmi_power_on_core(struct omap_dss_device *dssdev) > { > int r; > > + if (hdmi.core.core_pwr_cnt++) > + return 0; > + How's the locking between the CEC side and the DRM side? Normally these functions are protected with the DRM modesetting locks, but CEC doesn't come from there. We have the hdmi.lock, did you check that it's held when CEC side calls shared functions? > r = regulator_enable(hdmi.vdda_reg); > if (r) > - return r; > + goto err_reg_enable; > > r = hdmi_runtime_get(); > if (r) > goto err_runtime_get; > > + hdmi4_core_powerdown_disable(&hdmi.core); I'd like to have the powerdown_disable as a separate patch. Also, now that you call it here, I believe it can be dropped from hdmi4_configure(). Hmm, but in hdmi4_configure we call hdmi_core_swreset_assert() before hdmi4_core_powerdown_disable(). I wonder what exactly that does, and whether we end up resetting also the CEC parts when we change the videomode. Tomi [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2017-04-28 11:30 UTC|newest] Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top 2017-04-14 10:25 [PATCH 0/8] omapdrm: add OMAP4 CEC support Hans Verkuil 2017-04-14 10:25 ` [PATCH 1/8] arm: omap4: enable CEC pin for Pandaboard A4 and ES Hans Verkuil 2017-04-14 10:25 ` Hans Verkuil 2017-04-28 11:11 ` Tomi Valkeinen 2017-04-28 11:11 ` Tomi Valkeinen 2017-04-28 15:08 ` Tony Lindgren 2017-04-28 18:26 ` Sebastian Reichel 2017-04-28 18:54 ` Tony Lindgren 2017-04-29 20:21 ` Tony Lindgren 2017-06-26 11:07 ` Tony Lindgren 2017-06-27 8:38 ` Hans Verkuil 2017-06-27 8:38 ` Hans Verkuil 2017-06-27 9:14 ` Tony Lindgren 2017-06-27 9:23 ` Jyri Sarha 2017-06-27 9:23 ` Jyri Sarha 2017-06-27 9:27 ` Hans Verkuil 2017-06-27 9:47 ` Jyri Sarha 2017-06-27 9:47 ` Jyri Sarha 2017-06-27 10:09 ` Tony Lindgren 2017-06-27 10:06 ` Tony Lindgren 2017-04-14 10:25 ` [PATCH 2/8] omapdrm: encoder-tpd12s015: keep ls_oe_gpio high if CEC is enabled Hans Verkuil 2017-04-28 11:33 ` Tomi Valkeinen 2017-04-28 11:33 ` Tomi Valkeinen 2017-04-14 10:25 ` [PATCH 3/8] omapdrm: hdmi.h: extend hdmi_core_data with CEC fields Hans Verkuil 2017-04-14 10:25 ` [PATCH 4/8] omapdrm: hdmi4: make low-level functions available Hans Verkuil 2017-04-14 10:25 ` [PATCH 5/8] omapdrm: hdmi4: prepare irq handling for HDMI CEC support Hans Verkuil 2017-04-14 10:25 ` [PATCH 6/8] omapdrm: hdmi4: refcount hdmi_power_on/off_core Hans Verkuil 2017-04-28 11:30 ` Tomi Valkeinen [this message] 2017-04-28 11:30 ` Tomi Valkeinen 2017-05-05 13:04 ` Hans Verkuil 2017-05-05 13:04 ` Hans Verkuil 2017-04-14 10:25 ` [PATCH 7/8] omapdrm: hdmi4_cec: add OMAP4 HDMI CEC support Hans Verkuil 2017-04-14 10:25 ` [PATCH 8/8] omapdrm: hdmi4: hook up the " Hans Verkuil 2017-05-06 11:58 ` Hans Verkuil 2017-05-08 10:26 ` Tomi Valkeinen 2017-05-08 10:26 ` Tomi Valkeinen 2017-05-08 10:46 ` Hans Verkuil 2017-06-08 7:34 ` Hans Verkuil 2017-06-08 9:19 ` Tomi Valkeinen 2017-06-08 9:19 ` Tomi Valkeinen 2017-07-31 7:52 ` Hans Verkuil 2017-04-28 11:52 ` [PATCH 0/8] omapdrm: add OMAP4 " Tomi Valkeinen 2017-04-28 11:52 ` Tomi Valkeinen 2017-04-28 12:05 ` Hans Verkuil 2017-04-28 12:05 ` Hans Verkuil
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=15b0996c-5756-19ac-7393-11c245417ce4@ti.com \ --to=tomi.valkeinen@ti.com \ --cc=dri-devel@lists.freedesktop.org \ --cc=hans.verkuil@cisco.com \ --cc=hverkuil@xs4all.nl \ --cc=linux-media@vger.kernel.org \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.