public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Jyri Sarha <jsarha@ti.com>
Cc: Jacopo Mondi <jacopo@jmondi.org>,
	dri-devel@lists.freedesktop.org,
	Peter Ujfalusi <peter.ujfalusi@ti.com>,
	Tomi Valkeinen <tomi.valkeinen@ti.com>,
	linux-omap@vger.kernel.org
Subject: Re: [RFC PATCHv2 4/9] drm/tidss: add new driver for TI Keystone platforms
Date: Wed, 07 Nov 2018 15:40:50 +0200	[thread overview]
Message-ID: <2679838.XpYjUPGZL7@avalon> (raw)
In-Reply-To: <3ca2de41-2131-9b47-7e3b-4a7c162c8084@ti.com>

Hi Jyri,

(CC'ing Daniel Vetter)

On Wednesday, 31 October 2018 18:24:28 EET Jyri Sarha wrote:
> Hi Laurent,
> Tomi is busy with other things so I have taken over applying these
> comments. The rest is more or less clear, or commented by Tomi, but this
> is something have not addressed:
> 
> On 30/07/18 17:12, Laurent Pinchart wrote:
> >> +static void tidss_crtc_atomic_flush(struct drm_crtc *crtc,
> >> +				    struct drm_crtc_state *old_crtc_state)
> >> +{
> >> +	struct tidss_crtc *tcrtc = to_tidss_crtc(crtc);
> >> +	struct drm_device *ddev = crtc->dev;
> >> +	struct tidss_device *tidss = ddev->dev_private;
> >> +
> >> +	dev_dbg(ddev->dev, "%s, crtc enabled %d, event %p\n",
> >> +		__func__, tcrtc->enabled, crtc->state->event);
> >> +
> >> +	/* Only flush the CRTC if it is currently enabled. */
> >> +	if (!tcrtc->enabled)
> > 
> > In atomic drivers state should be stored in state structures. You could
> > check old_crtc_state for this and remove the enabled field in struct
> > tidss_crtc.
> 
> The variable is need for tracking the HW state trough the state
> transition. I do not know which state variable I should use to keep that
> state information stored trough the process where one state changes into
> another.
> 
> The drm_crtc_state already contains couple of variables describing
> whether crtc is enabled or not, or if the mode is going to change in the
> state transition (giving a hint that crtc is going go through
> disable-enable cycle). I tried to use all of those, and the old state
> variable, to accomplish the same behaviour as the current code has, but
> I could not.
> 
> One of the problematic cases was a new drm client making an atomic
> commit, the old one being bf-console, with the same mode as the one was
> using. In that situation the crtc goes trough disable-enable cycle, but
> I could not find any way to detect the situation from the old and new
> crtc state. Enable-disable cycle means that we should not flip the
> go-bit, but just configure everything and enable the crtc, e.g skip the
> atomic flush and wait for enable instead.

Thanks for the report. If we can't detect this from the drm_crtc_state, I 
think it's a shortcoming of the KMS core, and should be fixed. Daniel, what's 
your opinion ?

> In any case this is for HW state, not for DRM state tracking. I could
> add a call back to dispc ops for asking if the video port is enabled and
> use that instead if you think that is more formally correct.

I don't think a callback is worth it. The idea behind drm_crtc_state, if I 
understand it correctly, is to track all state, software and hardware. One 
option could be to extent drm_crtc_state (as in subclassing the object) with a 
custom hardware enable field, but I thought this would be covered by the 
standard fields.

-- 
Regards,

Laurent Pinchart



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

  reply	other threads:[~2018-11-07 13:40 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-18 13:22 [RFC PATCHv2 0/9] drm/tidss: new display driver for TI's DSS6 & DSS7 Tomi Valkeinen
2018-06-18 13:22 ` [RFC PATCHv2 1/9] drm: Add support for extracting sync signal drive edge from videomode Tomi Valkeinen
2018-07-10 13:55   ` Thierry Reding
2018-07-24 14:00   ` Laurent Pinchart
2018-06-18 13:22 ` [RFC PATCHv2 2/9] dt-bindings: display/ti: add k2g-dss bindings Tomi Valkeinen
2018-07-24 14:29   ` Laurent Pinchart
2018-07-30 11:29     ` Tomi Valkeinen
2018-06-18 13:22 ` [RFC PATCHv2 3/9] dt-bindings: display/ti: add am65x-dss bindings Tomi Valkeinen
2018-06-25 18:59   ` Rob Herring
2018-06-26  8:15     ` Tomi Valkeinen
2018-07-29 23:04   ` Laurent Pinchart
2018-07-30 11:00     ` Tomi Valkeinen
2018-06-18 13:22 ` [RFC PATCHv2 4/9] drm/tidss: add new driver for TI Keystone platforms Tomi Valkeinen
2018-07-30 14:12   ` Laurent Pinchart
2018-07-31  9:08     ` jacopo mondi
2018-07-31  9:12     ` Tomi Valkeinen
2018-10-31 16:24     ` Jyri Sarha
2018-11-07 13:40       ` Laurent Pinchart [this message]
2018-11-07 14:10         ` Daniel Vetter
2018-11-07 14:12           ` Daniel Vetter
2018-06-18 13:22 ` [RFC PATCHv2 5/9] drm/tidss: Add dispc7 for DSS7 support Tomi Valkeinen
2018-06-18 13:22 ` [RFC PATCHv2 6/9] MAINTAINERS: add entry for tidss Tomi Valkeinen
2018-06-18 13:22 ` [RFC PATCHv2 7/9] drm/panel: simple: add newhaven, nhd-4.3-480272ef-atxl LCD Tomi Valkeinen
2018-07-10 10:11   ` [RFC PATCHv2 7/9] drm/panel: simple: add newhaven,nhd-4.3-480272ef-atxl LCD Thierry Reding
2018-06-18 13:22 ` [RFC PATCHv2 8/9] ARM: dts: keystone-k2g: add DSS node Tomi Valkeinen
2018-06-19  6:19   ` Tony Lindgren
2018-06-19  7:09     ` Tomi Valkeinen
2018-06-19  7:12       ` Tony Lindgren
2018-06-18 13:22 ` [RFC PATCHv2 9/9] ARM: dts: keystone-k2g-evm: add LCD and HDMI displays Tomi Valkeinen
2018-06-19  6:24 ` [RFC PATCHv2 0/9] drm/tidss: new display driver for TI's DSS6 & DSS7 Tony Lindgren
2018-06-19  8:26   ` Tomi Valkeinen
2018-06-20  7:04     ` Tony Lindgren

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=2679838.XpYjUPGZL7@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jacopo@jmondi.org \
    --cc=jsarha@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=peter.ujfalusi@ti.com \
    --cc=tomi.valkeinen@ti.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