linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Jose Abreu <Jose.Abreu@synopsys.com>
Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	"Carlos Palminha" <CARLOS.PALMINHA@synopsys.com>,
	"Alexey Brodkin" <Alexey.Brodkin@synopsys.com>,
	"Daniel Vetter" <daniel.vetter@ffwll.ch>,
	"Dave Airlie" <airlied@linux.ie>,
	"Andrzej Hajda" <a.hajda@samsung.com>,
	"Archit Taneja" <architt@codeaurora.org>
Subject: Re: [PATCH 4/5] drm: Use mode_valid() in atomic modeset
Date: Mon, 8 May 2017 09:55:49 +0200	[thread overview]
Message-ID: <20170508075549.lympqv4bfby63np3@phenom.ffwll.local> (raw)
In-Reply-To: <4c645b70-5aa7-aecd-87f7-3fef47c303b3@synopsys.com>

On Thu, May 04, 2017 at 04:13:51PM +0100, Jose Abreu wrote:
> On 04-05-2017 15:40, Ville Syrjälä wrote:
> > On Thu, May 04, 2017 at 03:11:41PM +0100, Jose Abreu wrote:
> >> +					    struct drm_encoder *encoder,
> >> +					    struct drm_crtc *crtc,
> >> +					    struct drm_display_mode *mode)
> >> +{
> >> +	const struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private;
> >> +	const struct drm_connector_helper_funcs *connector_funcs =
> >> +		connector->helper_private;
> >> +	const struct drm_encoder_helper_funcs *encoder_funcs =
> >> +		encoder->helper_private;
> >> +	enum drm_mode_status ret = MODE_OK;
> >> +
> >> +	if (connector_funcs && connector_funcs->mode_valid)
> >> +		ret = connector_funcs->mode_valid(connector, mode);
> > As I mentioned earlier, this would break i915. We either can't call the 
> > connector hook at all here, or we have to make it somehow opt-in if some
> > drivers really want to do it.
> 
> Ok. You said you let users exceed the limits, but why doesn't it
> fail in atomic_check and will fail in mode_valid? I guess I can
> remove it, but this can lead to lots of confusion, i.e. with this
> series the mode_valid callbacks for all components are called, if
> I remove just one call the whole point will fall apart.
> 
> Can we think about something else ? I think making it opt-in is
> not ideal, if the helper is there then it should be used, but if
> thats the best solution then shall we add a flag which will call
> or not *all* the mode_valid callbacks in this stage
> (drm_device.allow_modevalid_call, ...) ?

This is a general issue, not a driver opt-in. With your new callbacks
ideally we'll have:
- all the source checks (clock limits, size limits) are in the
  crtc/encoder/bridge callbacks
- only the sink limit checks (derived from edid or DP aux) are in the
  connector callback

Letting userspace overwrite these seems like a reasonable idea that we
should support in general I think. See also my comment on patch 1 for the
connector's mode_valid kerneldoc.

For arcpgu that might mean that you need to move part of the connector's
mode_valid checks into the encoder, but since all the encoder modeset is
in there already, that seems like a good cleanup of the drm modeset
framework.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

  reply	other threads:[~2017-05-08  7:55 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-04 14:11 [PATCH 0/5] Introduce new mode validation callbacks Jose Abreu
2017-05-04 14:11 ` [PATCH 1/5] drm: Add crtc/encoder/bridge->mode_valid() callbacks Jose Abreu
2017-05-08  7:52   ` Daniel Vetter
2017-05-04 14:11 ` [PATCH 2/5] drm: Use new mode_valid() helpers in connector probe helper Jose Abreu
2017-05-04 14:32   ` Ville Syrjälä
2017-05-04 14:53     ` Jose Abreu
2017-05-08  7:50   ` Daniel Vetter
2017-05-08 10:13     ` Jose Abreu
2017-05-08 18:28       ` Daniel Vetter
2017-05-04 14:11 ` [PATCH 3/5] drm: Introduce drm_bridge_mode_valid() Jose Abreu
2017-05-04 14:11 ` [PATCH 4/5] drm: Use mode_valid() in atomic modeset Jose Abreu
2017-05-04 14:40   ` Ville Syrjälä
2017-05-04 15:13     ` Jose Abreu
2017-05-08  7:55       ` Daniel Vetter [this message]
2017-05-04 14:11 ` [PATCH 5/5] drm: arc: Use crtc->mode_valid() callback Jose Abreu
2017-05-08  7:58 ` [PATCH 0/5] Introduce new mode validation callbacks Daniel Vetter

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=20170508075549.lympqv4bfby63np3@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=Alexey.Brodkin@synopsys.com \
    --cc=CARLOS.PALMINHA@synopsys.com \
    --cc=Jose.Abreu@synopsys.com \
    --cc=a.hajda@samsung.com \
    --cc=airlied@linux.ie \
    --cc=architt@codeaurora.org \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ville.syrjala@linux.intel.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).