Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 61d0a04d authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'topic/drm-misc-2016-10-24' of git://anongit.freedesktop.org/drm-intel into drm-next

First -misc pull for 4.10:
- drm_format rework from Laurent
- reservation patches from Chris that missed 4.9.
- aspect ratio support in infoframe helpers and drm mode/edid code
  (Shashank Sharma)
- rotation rework from Ville (first parts at least)
- another attempt at the CRC debugfs interface from Tomeu
- piles and piles of misc patches all over

* tag 'topic/drm-misc-2016-10-24' of git://anongit.freedesktop.org/drm-intel: (55 commits)
  drm: Use u64 for intermediate dotclock calculations
  drm/i915: Use the per-plane rotation property
  drm/omap: Use per-plane rotation property
  drm/omap: Set rotation property initial value to BIT(DRM_ROTATE_0) insted of 0
  drm/atmel-hlcdc: Use per-plane rotation property
  drm/arm: Use per-plane rotation property
  drm: Add support for optional per-plane rotation property
  drm/atomic: Reject attempts to use multiple rotation angles at once
  drm: Add drm_rotation_90_or_270()
  dma-buf/sync_file: hold reference to fence when creating sync_file
  drm/virtio: kconfig: Fixup white space.
  drm/fence: release fence reference when canceling event
  drm/i915: Handle early failure during intel_get_load_detect_pipe
  drm/fb_cma_helper: do not free fbdev if there is none
  drm: fix sparse warnings on undeclared symbols in crc debugfs
  gpu: Remove depends on RESET_CONTROLLER when not a provider
  i915: don't call drm_atomic_state_put on invalid pointer
  drm: Don't export the drm_fb_get_bpp_depth() function
  drm/arm: mali-dp: Replace drm_fb_get_bpp_depth() with drm_format_plane_cpp()
  drm: vmwgfx: Replace drm_fb_get_bpp_depth() with drm_format_info()
  ...
parents 07d9a380 8a5bbf32
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -63,6 +63,9 @@ Frame Buffer Functions Reference
DRM Format Handling
DRM Format Handling
===================
===================


.. kernel-doc:: include/drm/drm_fourcc.h
   :internal:

.. kernel-doc:: drivers/gpu/drm/drm_fourcc.c
.. kernel-doc:: drivers/gpu/drm/drm_fourcc.c
   :export:
   :export:


+6 −0
Original line number Original line Diff line number Diff line
@@ -216,3 +216,9 @@ interfaces. Especially since all hardware-acceleration interfaces to
userspace are driver specific for efficiency and other reasons these
userspace are driver specific for efficiency and other reasons these
interfaces can be rather substantial. Hence every driver has its own
interfaces can be rather substantial. Hence every driver has its own
chapter.
chapter.

Testing and validation
======================

.. kernel-doc:: drivers/gpu/drm/drm_debugfs_crc.c
   :doc: CRC ABI
+46 −66
Original line number Original line Diff line number Diff line
@@ -280,18 +280,24 @@ int reservation_object_get_fences_rcu(struct reservation_object *obj,
				      unsigned *pshared_count,
				      unsigned *pshared_count,
				      struct fence ***pshared)
				      struct fence ***pshared)
{
{
	unsigned shared_count = 0;
	struct fence **shared = NULL;
	unsigned retry = 1;
	struct fence *fence_excl;
	struct fence **shared = NULL, *fence_excl = NULL;
	unsigned int shared_count;
	int ret = 0;
	int ret = 1;


	while (retry) {
	do {
		struct reservation_object_list *fobj;
		struct reservation_object_list *fobj;
		unsigned seq;
		unsigned seq;
		unsigned int i;


		seq = read_seqcount_begin(&obj->seq);
		shared_count = i = 0;


		rcu_read_lock();
		rcu_read_lock();
		seq = read_seqcount_begin(&obj->seq);

		fence_excl = rcu_dereference(obj->fence_excl);
		if (fence_excl && !fence_get_rcu(fence_excl))
			goto unlock;


		fobj = rcu_dereference(obj->fence);
		fobj = rcu_dereference(obj->fence);
		if (fobj) {
		if (fobj) {
@@ -309,52 +315,37 @@ int reservation_object_get_fences_rcu(struct reservation_object *obj,
				}
				}


				ret = -ENOMEM;
				ret = -ENOMEM;
				shared_count = 0;
				break;
				break;
			}
			}
			shared = nshared;
			shared = nshared;
			memcpy(shared, fobj->shared, sz);
			shared_count = fobj->shared_count;
			shared_count = fobj->shared_count;
		} else
			shared_count = 0;
		fence_excl = rcu_dereference(obj->fence_excl);

		retry = read_seqcount_retry(&obj->seq, seq);
		if (retry)
			goto unlock;

		if (!fence_excl || fence_get_rcu(fence_excl)) {
			unsigned i;


			for (i = 0; i < shared_count; ++i) {
			for (i = 0; i < shared_count; ++i) {
				if (fence_get_rcu(shared[i]))
				shared[i] = rcu_dereference(fobj->shared[i]);
					continue;
				if (!fence_get_rcu(shared[i]))
					break;
			}
		}


				/* uh oh, refcount failed, abort and retry */
		if (i != shared_count || read_seqcount_retry(&obj->seq, seq)) {
			while (i--)
			while (i--)
				fence_put(shared[i]);
				fence_put(shared[i]);

				if (fence_excl) {
			fence_put(fence_excl);
			fence_put(fence_excl);
					fence_excl = NULL;
			goto unlock;
				}

				retry = 1;
				break;
		}
		}
		} else
			retry = 1;


		ret = 0;
unlock:
unlock:
		rcu_read_unlock();
		rcu_read_unlock();
	} while (ret);

	if (!shared_count) {
		kfree(shared);
		shared = NULL;
	}
	}

	*pshared_count = shared_count;
	*pshared_count = shared_count;
	if (shared_count)
	*pshared = shared;
	*pshared = shared;
	else {
		*pshared = NULL;
		kfree(shared);
	}
	*pfence_excl = fence_excl;
	*pfence_excl = fence_excl;


	return ret;
	return ret;
@@ -397,9 +388,6 @@ long reservation_object_wait_timeout_rcu(struct reservation_object *obj,
		if (fobj)
		if (fobj)
			shared_count = fobj->shared_count;
			shared_count = fobj->shared_count;


		if (read_seqcount_retry(&obj->seq, seq))
			goto unlock_retry;

		for (i = 0; i < shared_count; ++i) {
		for (i = 0; i < shared_count; ++i) {
			struct fence *lfence = rcu_dereference(fobj->shared[i]);
			struct fence *lfence = rcu_dereference(fobj->shared[i]);


@@ -422,9 +410,6 @@ long reservation_object_wait_timeout_rcu(struct reservation_object *obj,
	if (!shared_count) {
	if (!shared_count) {
		struct fence *fence_excl = rcu_dereference(obj->fence_excl);
		struct fence *fence_excl = rcu_dereference(obj->fence_excl);


		if (read_seqcount_retry(&obj->seq, seq))
			goto unlock_retry;

		if (fence_excl &&
		if (fence_excl &&
		    !test_bit(FENCE_FLAG_SIGNALED_BIT, &fence_excl->flags)) {
		    !test_bit(FENCE_FLAG_SIGNALED_BIT, &fence_excl->flags)) {
			if (!fence_get_rcu(fence_excl))
			if (!fence_get_rcu(fence_excl))
@@ -439,6 +424,11 @@ long reservation_object_wait_timeout_rcu(struct reservation_object *obj,


	rcu_read_unlock();
	rcu_read_unlock();
	if (fence) {
	if (fence) {
		if (read_seqcount_retry(&obj->seq, seq)) {
			fence_put(fence);
			goto retry;
		}

		ret = fence_wait_timeout(fence, intr, ret);
		ret = fence_wait_timeout(fence, intr, ret);
		fence_put(fence);
		fence_put(fence);
		if (ret > 0 && wait_all && (i + 1 < shared_count))
		if (ret > 0 && wait_all && (i + 1 < shared_count))
@@ -484,12 +474,13 @@ bool reservation_object_test_signaled_rcu(struct reservation_object *obj,
					  bool test_all)
					  bool test_all)
{
{
	unsigned seq, shared_count;
	unsigned seq, shared_count;
	int ret = true;
	int ret;


	rcu_read_lock();
retry:
retry:
	ret = true;
	shared_count = 0;
	shared_count = 0;
	seq = read_seqcount_begin(&obj->seq);
	seq = read_seqcount_begin(&obj->seq);
	rcu_read_lock();


	if (test_all) {
	if (test_all) {
		unsigned i;
		unsigned i;
@@ -500,46 +491,35 @@ bool reservation_object_test_signaled_rcu(struct reservation_object *obj,
		if (fobj)
		if (fobj)
			shared_count = fobj->shared_count;
			shared_count = fobj->shared_count;


		if (read_seqcount_retry(&obj->seq, seq))
			goto unlock_retry;

		for (i = 0; i < shared_count; ++i) {
		for (i = 0; i < shared_count; ++i) {
			struct fence *fence = rcu_dereference(fobj->shared[i]);
			struct fence *fence = rcu_dereference(fobj->shared[i]);


			ret = reservation_object_test_signaled_single(fence);
			ret = reservation_object_test_signaled_single(fence);
			if (ret < 0)
			if (ret < 0)
				goto unlock_retry;
				goto retry;
			else if (!ret)
			else if (!ret)
				break;
				break;
		}
		}


		/*
		if (read_seqcount_retry(&obj->seq, seq))
		 * There could be a read_seqcount_retry here, but nothing cares
			goto retry;
		 * about whether it's the old or newer fence pointers that are
		 * signaled. That race could still have happened after checking
		 * read_seqcount_retry. If you care, use ww_mutex_lock.
		 */
	}
	}


	if (!shared_count) {
	if (!shared_count) {
		struct fence *fence_excl = rcu_dereference(obj->fence_excl);
		struct fence *fence_excl = rcu_dereference(obj->fence_excl);


		if (read_seqcount_retry(&obj->seq, seq))
			goto unlock_retry;

		if (fence_excl) {
		if (fence_excl) {
			ret = reservation_object_test_signaled_single(
			ret = reservation_object_test_signaled_single(
								fence_excl);
								fence_excl);
			if (ret < 0)
			if (ret < 0)
				goto unlock_retry;
				goto retry;

			if (read_seqcount_retry(&obj->seq, seq))
				goto retry;
		}
		}
	}
	}


	rcu_read_unlock();
	rcu_read_unlock();
	return ret;
	return ret;

unlock_retry:
	rcu_read_unlock();
	goto retry;
}
}
EXPORT_SYMBOL_GPL(reservation_object_test_signaled_rcu);
EXPORT_SYMBOL_GPL(reservation_object_test_signaled_rcu);
+1 −1
Original line number Original line Diff line number Diff line
@@ -79,7 +79,7 @@ struct sync_file *sync_file_create(struct fence *fence)
	if (!sync_file)
	if (!sync_file)
		return NULL;
		return NULL;


	sync_file->fence = fence;
	sync_file->fence = fence_get(fence);


	snprintf(sync_file->name, sizeof(sync_file->name), "%s-%s%llu-%d",
	snprintf(sync_file->name, sizeof(sync_file->name), "%s-%s%llu-%d",
		 fence->ops->get_driver_name(fence),
		 fence->ops->get_driver_name(fence),
+2 −1
Original line number Original line Diff line number Diff line
@@ -9,7 +9,7 @@ drm-y := drm_auth.o drm_bufs.o drm_cache.o \
		drm_scatter.o drm_pci.o \
		drm_scatter.o drm_pci.o \
		drm_platform.o drm_sysfs.o drm_hashtab.o drm_mm.o \
		drm_platform.o drm_sysfs.o drm_hashtab.o drm_mm.o \
		drm_crtc.o drm_fourcc.o drm_modes.o drm_edid.o \
		drm_crtc.o drm_fourcc.o drm_modes.o drm_edid.o \
		drm_info.o drm_debugfs.o drm_encoder_slave.o \
		drm_info.o drm_encoder_slave.o \
		drm_trace_points.o drm_global.o drm_prime.o \
		drm_trace_points.o drm_global.o drm_prime.o \
		drm_rect.o drm_vma_manager.o drm_flip_work.o \
		drm_rect.o drm_vma_manager.o drm_flip_work.o \
		drm_modeset_lock.o drm_atomic.o drm_bridge.o \
		drm_modeset_lock.o drm_atomic.o drm_bridge.o \
@@ -23,6 +23,7 @@ drm-$(CONFIG_PCI) += ati_pcigart.o
drm-$(CONFIG_DRM_PANEL) += drm_panel.o
drm-$(CONFIG_DRM_PANEL) += drm_panel.o
drm-$(CONFIG_OF) += drm_of.o
drm-$(CONFIG_OF) += drm_of.o
drm-$(CONFIG_AGP) += drm_agpsupport.o
drm-$(CONFIG_AGP) += drm_agpsupport.o
drm-$(CONFIG_DEBUG_FS) += drm_debugfs.o drm_debugfs_crc.o


drm_kms_helper-y := drm_crtc_helper.o drm_dp_helper.o drm_probe_helper.o \
drm_kms_helper-y := drm_crtc_helper.o drm_dp_helper.o drm_probe_helper.o \
		drm_plane_helper.o drm_dp_mst_topology.o drm_atomic_helper.o \
		drm_plane_helper.o drm_dp_mst_topology.o drm_atomic_helper.o \
Loading