dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Matt Roper <matthew.d.roper@intel.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCHv4 06/13] drm: Add primary plane helpers (v2)
Date: Tue, 1 Apr 2014 09:45:47 +0200	[thread overview]
Message-ID: <20140401074547.GG22327@phenom.ffwll.local> (raw)
In-Reply-To: <20140401010324.GJ25785@intel.com>

On Mon, Mar 31, 2014 at 06:03:24PM -0700, Matt Roper wrote:
> On Fri, Mar 28, 2014 at 09:32:06AM +0100, Daniel Vetter wrote:
> > On Thu, Mar 27, 2014 at 05:44:31PM -0700, Matt Roper wrote:
> ...
> > > +	 * N.B., we call set_config() directly here rather than using
> > > +	 * drm_mode_set_config_internal.  We're reprogramming the same
> > > +	 * connectors that were already in use, so we shouldn't need the extra
> > > +	 * cross-CRTC fb refcounting to accomodate stealing connectors.
> > > +	 * drm_mode_setplane() already handles the basic refcounting for the
> > > +	 * framebuffers involved in this operation.
> > 
> > Wrong. The current crtc helper logic disables all disconnected connectors
> > forcefully on each set_config. Nope, I didn't make those semantics ... So
> > I think we need to think a bit harder here again.
> > 
> > See drm_helper_disable_unused_functions.
> 
> I think I'm still missing something here; can you clarify what the
> problematic case would be?
> 
> I only see a call to __drm_helper_disable_unused_functions() in the CRTC
> helper in cases where mode_changed = 1, which I don't believe it ever
> should be through the setplane() calls.  We should just be updating the
> framebuffer (and possibly panning) without touching any of the
> connectors, so I don't see how unrelated CRTC's would get disabled.  Am
> I overlooking another case here that the basic refcounting in setplane
> doesn't already handle?

Looking at drm_helper_disable_unused_functions we'll spot

	list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
		if (!connector->encoder)
			continue;
		if (connector->status == connector_status_disconnected)
			connector->encoder = NULL;
	}


So as soon as a connector is disconnected and you do _any_ kind of
->set_config call with modesetting helpers that crtc gets killed. Even if
it's completely unrelated. Dave originally changed this with an imo rather
thin justification:

commit a3a0544b2c84e1d7a2022b558ecf66d8c6a8dd93
Author: Dave Airlie <airlied@redhat.com>
Date:   Mon Aug 31 15:16:30 2009 +1000

    drm/kms: add explicit encoder disable function and detach harder.
    
    For shared tv-out and VGA encoders, we really need to know if
    the encoder is just being switched off temporarily in blanking
    or if we are really disabling it hard.
    
    Also we need to try harder to disconnect encoders from unused
    connectors so we can share more efficently.
    
    (shared encoders stuff is coming in radeon tv-out support)
    
    Signed-off-by: Dave Airlie <airlied@redhat.com>

To me this always smelled like papering over broken userspace. I've killed
this in the i915 modeset rewrite and we didn't really have angry users
scaling our walls. But I'm not sure what'll happen if we do this for all
other drivers.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

  reply	other threads:[~2014-04-01  7:45 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-28  0:44 [PATCHv4 00/13] Universal plane preparation patches Matt Roper
2014-03-28  0:44 ` [PATCHv4 01/13] drm: Add support for multiple plane types (v2) Matt Roper
2014-03-28  0:44 ` [PATCHv4 02/13] drm/exynos: Restrict plane loops to only operate on overlay planes (v2) Matt Roper
2014-03-28  0:44 ` [PATCHv4 03/13] drm/i915: " Matt Roper
2014-03-28  0:44 ` [PATCHv4 04/13] drm/shmobile: Restrict plane loops to only operate on legacy planes Matt Roper
2014-03-28 15:50   ` Laurent Pinchart
2014-03-28 17:52     ` Daniel Vetter
2014-03-28 17:53       ` Daniel Vetter
2014-04-01 15:27         ` Laurent Pinchart
2014-04-01 21:43           ` Daniel Vetter
2014-03-28  0:44 ` [PATCHv4 05/13] drm: Make drm_crtc_check_viewport non-static Matt Roper
2014-03-28  0:44 ` [PATCHv4 06/13] drm: Add primary plane helpers (v2) Matt Roper
2014-03-28  8:32   ` Daniel Vetter
2014-03-28 15:48     ` Laurent Pinchart
2014-03-28 17:54       ` Daniel Vetter
2014-04-01 15:25         ` Laurent Pinchart
2014-04-01  1:03     ` Matt Roper
2014-04-01  7:45       ` Daniel Vetter [this message]
2014-04-01 11:45         ` Rob Clark
2014-04-01 12:33           ` Daniel Vetter
2014-04-01 19:46         ` Dave Airlie
2014-04-01 21:47           ` Daniel Vetter
2014-04-01  1:04     ` Rob Clark
2014-03-28  0:44 ` [PATCHv4 07/13] drm: Add drm_universal_plane_init() Matt Roper
2014-03-28  0:44 ` [PATCHv4 08/13] drm: Add plane type property (v2) Matt Roper
2014-03-28  0:44 ` [PATCHv4 09/13] drm: Add plane max width/height properties Matt Roper
2014-03-28  8:21   ` Daniel Vetter
2014-03-28  0:44 ` [PATCHv4 10/13] drm: Add drm_crtc_init_with_planes() Matt Roper
2014-03-28  9:11   ` Daniel Vetter
2014-03-28 17:56   ` Daniel Vetter
2014-03-28  0:44 ` [PATCHv4 11/13] drm/msm: Switch to universal plane API's Matt Roper
2014-03-28  0:44 ` [PATCHv4 12/13] drm: Replace crtc fb with primary plane fb (v3) Matt Roper
2014-03-28  8:40   ` Daniel Vetter
2014-03-28  0:44 ` [PATCHv4 13/13] drm: Remove unused drm_crtc->fb Matt Roper
2014-03-28  8:15 ` [Intel-gfx] [PATCHv4 00/13] Universal plane preparation patches 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=20140401074547.GG22327@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=matthew.d.roper@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