~proton1980/ubuntu/+source/linux/+git/mirror-drm-intel:topic/connector-locking

Last commit made on 2015-07-22
Get this branch:
git clone -b topic/connector-locking https://git.launchpad.net/~proton1980/ubuntu/+source/linux/+git/mirror-drm-intel
Only Ghz can upload to this branch. If you are Ghz please log in for upload directions.

Branch merges

Branch information

Name:
topic/connector-locking
Repository:
lp:~proton1980/ubuntu/+source/linux/+git/mirror-drm-intel

Recent commits

3fdefa3... by Daniel Vetter

drm: gc now dead mode_group code

Two nice things here:
- drm_dev_register will truly register everything in the right order
  if the driver doesn't have a ->load callback. Before this we had to
  init the primary mode_group after the device nodes where already
  registered.

- Less things to keep track of when reworking the connector locking,
  yay!

Reviewed-by: Maarten Lankhorst <email address hidden>
Signed-off-by: Daniel Vetter <email address hidden>

9c7060f... by Daniel Vetter

drm: Stop filtering according to mode_group in getresources

It's been dead code since forever since mode groups haven't ever been
implemented. On top of that it's also been non-functional since we
only ever filtered the getresources ioctl and not any of the others
nor the mode object lookup code.

Given overwhelming evidence it looks like this isn't a feature we
need, hence remove it.

Reviewed-by: Maarten Lankhorst <email address hidden>
Signed-off-by: Daniel Vetter <email address hidden>

e4f6254... by Daniel Vetter

drm: Roll out drm_for_each_{plane,crtc,encoder}

Remaining manual work in the drm core&helpers. Nothing special here,
no surprises.

Reviewed-by: Maarten Lankhorst <email address hidden>
Signed-off-by: Daniel Vetter <email address hidden>

9e75c0e... by Daniel Vetter

drm/cma-helper: Fix locking in drm_fb_cma_debugfs_show

This function takes two locks, both of them the wrong ones. This
wasn't an oversight from my fb locking rework since both patches
landed in parallel. We really only need fb_lock when walking that
list, since everything we can reach from that is refcounted properly
already.

v2: Drop unused dev spotted by 0day.

Cc: Rob Clark <email address hidden>
Cc: Laurent Pinchart <email address hidden>
Signed-off-by: Daniel Vetter <email address hidden>

9a9f5ce... by Daniel Vetter

drm: Roll out drm_for_each_connector more

Now that we also grab the connection_mutex and so fixed the race with
atomic modeset we can use the iterator there too.

The other special case is drm_connector_unplug_all which would have a
locking inversion with the sysfs store/show functions if we'd grab the
mode_config.mutex around the unplug. We could just grab
connection_mutex instead, but that's a bit too much a dirty trick for
my taste. Also it's only used by udl, which doesn't do any other kind
of connector hotplugging, so should be race-free. Hence just stick
with a comment for now.

Reviewed-by: Maarten Lankhorst <email address hidden>
Signed-off-by: Daniel Vetter <email address hidden>

cff20ba... by Daniel Vetter

drm: Amend connector list locking rules

Now that dp mst hotplug takes all locks we can amend the locking rules
for the iterators. This is needed before we can roll these out in the
atomic code to avoid getting burried in WARNINGs.

v2: Rebase onto the extracted list locking assert and add a comment to
explain the rules.

v3: Fixup German->English translation fail in the comment.

Cc: Chris Wilson <email address hidden>
Reviewed-by: Maarten Lankhorst <email address hidden>
Signed-off-by: Daniel Vetter <email address hidden>

2ee6bcd... by Daniel Vetter

drm/radeon: Take all modeset locks for DP MST hotplug

Similar with the i915 take all modeset locks for mst hotplug. This is
needed to make sure radeon holds both mode_config.mutex and
mode_config.connection_mutex when updating the connector_list, which
is the new (interim) locking regime we want for that.

Reviewed-by: Maarten Lankhorst <email address hidden>
Signed-off-by: Daniel Vetter <email address hidden>

8bb4da1... by Daniel Vetter

drm/i915: Take all modeset locks for DP MST hotplug

While auditing various users of the connector/encoder lists I realized
that the atomic code is a very prolific user of them. And it only ever
grabs the mode_config->connection_mutex, but not the
mode_config->mutex like all the other code walking encoder/connector
lists.

The problem is that we can't grab the mode_config.mutex late in atomic
code since that would lead to locking inversions. And we don't want to
grab it unconditionally like the legacy set_config modeset path since
that would render all the fine-grained locking moot.

Instead just grab more locks in the dp mst hotplug code. Note that
drm_connector_init (which is the one adding the connector to these
lists) already uses drm_modeset_lock_all.

The other reason for grabbing all locks is that the dpms off in the
unplug function amounts to a modeset, so better to take all required
locks for that.

Reviewed-by: Maarten Lankhorst <email address hidden>
Signed-off-by: Daniel Vetter <email address hidden>

4676ba0... by Daniel Vetter

drm: Check locking in drm_for_each_fb

Ever since framebuffers are reference counted we have a special lock
for the global fb list. Make sure users of that list do hold that
lock when using the new iterators.

Reviewed-by: Maarten Lankhorst <email address hidden>
Signed-off-by: Daniel Vetter <email address hidden>

3a58ee1... by Daniel Vetter

drm/i915: Use drm_for_each_fb in i915_debugfs.c

Just so I have a user for this macro.

v2: Use the right macro - somehow I thought gcc should scream at me,
but list_for_each isn't really typesafe unfortunately. Spotted by
Ville.

Cc: Ville Syrjälä <email address hidden>
Reviewed-by: Maarten Lankhorst <email address hidden>
Signed-off-by: Daniel Vetter <email address hidden>