All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Daniel Vetter <daniel.vetter@intel.com>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	Thierry Reding <treding@nvidia.com>,
	DRI Development <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 08/13] drm/fb-helper: Stop using mode_config.mutex for internals
Date: Tue, 4 Jul 2017 18:40:33 +0300	[thread overview]
Message-ID: <20170704154033.GP12629@intel.com> (raw)
In-Reply-To: <20170704151833.17304-9-daniel.vetter@ffwll.ch>

On Tue, Jul 04, 2017 at 05:18:28PM +0200, Daniel Vetter wrote:
> Those are now all protected using fb_helper->lock.
> 
> v2: We still need to hold mode_config.mutex right around calling
> connector->fill_modes.
> 
> v3: I forgot to hold mode_config.mutex while looking at
> connector->status and the mode list. Also, we need to patch up the
> i915 ->initial_config callback to grab the locks it needs to inspect
> the modeset state recovered from the fw.
> 
> Cc: John Stultz <john.stultz@linaro.org>
> Cc: Thierry Reding <treding@nvidia.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  drivers/gpu/drm/drm_fb_helper.c    | 33 ++++++++-------------------------
>  drivers/gpu/drm/drm_vblank.c       |  2 +-
>  drivers/gpu/drm/i915/intel_fbdev.c | 16 ++++++++++++----
>  3 files changed, 21 insertions(+), 30 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index 400bbb07eff2..59e2916471b2 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
<snip>
> @@ -2296,12 +2284,8 @@ static void drm_setup_crtcs(struct drm_fb_helper *fb_helper,
>  	int i;
>  
>  	DRM_DEBUG_KMS("\n");
> -	if (drm_fb_helper_probe_connector_modes(fb_helper, width, height) == 0)
> -		DRM_DEBUG_KMS("No connectors reported connected with modes\n");
> -
>  	/* prevent concurrent modification of connector_count by hotplug */
>  	lockdep_assert_held(&fb_helper->lock);
> -	lockdep_assert_held(&fb_helper->dev->mode_config.mutex);
>  
>  	crtcs = kcalloc(fb_helper->connector_count,
>  			sizeof(struct drm_fb_helper_crtc *), GFP_KERNEL);
> @@ -2316,7 +2300,10 @@ static void drm_setup_crtcs(struct drm_fb_helper *fb_helper,
>  		goto out;
>  	}
>  
> +	mutex_lock(&fb_helper->dev->mode_config.mutex);
>  	drm_enable_connectors(fb_helper, enabled);
> +	if (drm_fb_helper_probe_connector_modes(fb_helper, width, height) == 0)

This changes the order of these two functions calls. Looks to me like
drm_fb_helper_probe_connector_modes() updates connector->status, and
drm_enable_connectors() depends on it. So either these shouldn't get 
reordered or there's some not immediately obvious reason why that's OK.

> +		DRM_DEBUG_KMS("No connectors reported connected with modes\n");
>  
>  	if (!(fb_helper->funcs->initial_config &&
>  	      fb_helper->funcs->initial_config(fb_helper, crtcs, modes,

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-07-04 15:40 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-04 15:18 [PATCH 00/13] fbdev locking + deferred setup take 3 Daniel Vetter
2017-07-04 15:18 ` [PATCH 01/13] drm/fb-helper: Push down modeset lock into FB helpers Daniel Vetter
2017-07-04 15:18 ` [PATCH 02/13] drm/i915: Drop FBDEV #ifdev in mst code Daniel Vetter
2017-07-04 15:18 ` [PATCH 03/13] drm/fb-helper: Add top-level lock Daniel Vetter
2017-07-04 15:18 ` [PATCH 04/13] drm/fb-helper: Push locking in fb_is_bound Daniel Vetter
2017-07-04 15:18 ` [PATCH 05/13] drm/fb-helper: Drop locking from the vsync wait ioctl code Daniel Vetter
2017-07-04 15:18 ` [PATCH 06/13] drm/fb-helper: Push locking into pan_display_atomic|legacy Daniel Vetter
2017-07-04 15:18 ` [PATCH 07/13] drm/fb-helper: Push locking into restore_fbdev_mode_atomic|legacy Daniel Vetter
2017-07-04 15:18 ` [PATCH 08/13] drm/fb-helper: Stop using mode_config.mutex for internals Daniel Vetter
2017-07-04 15:40   ` Ville Syrjälä [this message]
2017-07-04 16:19     ` Daniel Vetter
2017-07-05  4:56   ` [PATCH] " Daniel Vetter
2017-07-04 15:18 ` [PATCH 09/13] drm/fb-helper: Split dpms handling into legacy and atomic paths Daniel Vetter
2017-07-04 15:18 ` [PATCH 10/13] drm/fb-helper: Support deferred setup Daniel Vetter
2017-07-04 15:29   ` Liviu Dudau
2017-07-05 11:20   ` Maarten Lankhorst
2017-07-04 15:18 ` [PATCH 11/13] drm/i915: Protect against deferred fbdev setup Daniel Vetter
2017-07-05 10:08   ` Maarten Lankhorst
2017-07-05 20:17     ` Daniel Vetter
2017-07-04 15:18 ` [PATCH 12/13] drm/exynos: Remove custom FB helper deferred setup Daniel Vetter
2017-07-06  3:16   ` Inki Dae
2017-07-04 15:18 ` [PATCH 13/13] drm/hisilicon: " Daniel Vetter
2017-07-04 16:39 ` ✓ Fi.CI.BAT: success for fbdev locking + deferred setup take 3 Patchwork
2017-07-05  5:14 ` ✓ Fi.CI.BAT: success for fbdev locking + deferred setup take 3 (rev2) Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2017-06-27 14:59 [PATCH 00/13] fbdev locking rework and deferred setup, take 2 Daniel Vetter
2017-06-27 14:59 ` [PATCH 08/13] drm/fb-helper: Stop using mode_config.mutex for internals 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=20170704154033.GP12629@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=treding@nvidia.com \
    --subject='Re: [PATCH 08/13] drm/fb-helper: Stop using mode_config.mutex for internals' \
    /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

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.