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

Commit 1f8ee720 authored by Dave Airlie's avatar Dave Airlie
Browse files

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

* tag 'topic/drm-misc-2016-09-08' of git://anongit.freedesktop.org/drm-intel:
  drm: Fix error path in drm_mode_page_flip_ioctl()
  Revert "drm: Unify handling of blob and object properties"
  drm/udl: implement usb_driver suspend/resume.
  drm: fix signed integer overflow
  drm/atomic: Reject properties not part of the object.
  drm/doc: Add a few words on validation with IGT
parents eb97027f dec90ea1
Loading
Loading
Loading
Loading
+37 −0
Original line number Original line Diff line number Diff line
@@ -156,6 +156,43 @@ other hand, a driver requires shared state between clients which is
visible to user-space and accessible beyond open-file boundaries, they
visible to user-space and accessible beyond open-file boundaries, they
cannot support render nodes.
cannot support render nodes.


Validating changes with IGT
===========================

There's a collection of tests that aims to cover the whole functionality of
DRM drivers and that can be used to check that changes to DRM drivers or the
core don't regress existing functionality. This test suite is called IGT and
its code can be found in https://cgit.freedesktop.org/drm/igt-gpu-tools/.

To build IGT, start by installing its build dependencies. In Debian-based
systems::

	# apt-get build-dep intel-gpu-tools

And in Fedora-based systems::

	# dnf builddep intel-gpu-tools

Then clone the repository::

	$ git clone git://anongit.freedesktop.org/drm/igt-gpu-tools

Configure the build system and start the build::

	$ cd igt-gpu-tools && ./autogen.sh && make -j6

Download the piglit dependency::

	$ ./scripts/run-tests.sh -d

And run the tests::

	$ ./scripts/run-tests.sh -t kms -t core -s

run-tests.sh is a wrapper around piglit that will execute the tests matching
the -t options. A report in HTML format will be available in
./results/html/index.html. Results can be compared with piglit.

VBlank event handling
VBlank event handling
=====================
=====================


+10 −1
Original line number Original line Diff line number Diff line
@@ -1609,7 +1609,7 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,
	struct drm_crtc_state *crtc_state;
	struct drm_crtc_state *crtc_state;
	unsigned plane_mask;
	unsigned plane_mask;
	int ret = 0;
	int ret = 0;
	unsigned int i, j;
	unsigned int i, j, k;


	/* disallow for drivers not supporting atomic: */
	/* disallow for drivers not supporting atomic: */
	if (!drm_core_check_feature(dev, DRIVER_ATOMIC))
	if (!drm_core_check_feature(dev, DRIVER_ATOMIC))
@@ -1691,6 +1691,15 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,
				goto out;
				goto out;
			}
			}


			for (k = 0; k < obj->properties->count; k++)
				if (obj->properties->properties[k]->base.id == prop_id)
					break;

			if (k == obj->properties->count) {
				ret = -EINVAL;
				goto out;
			}

			prop = drm_property_find(dev, prop_id);
			prop = drm_property_find(dev, prop_id);
			if (!prop) {
			if (!prop) {
				drm_mode_object_unreference(obj);
				drm_mode_object_unreference(obj);
+1 −1
Original line number Original line Diff line number Diff line
@@ -2044,7 +2044,7 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
	}
	}


out:
out:
	if (ret)
	if (ret && crtc->funcs->page_flip_target)
		drm_crtc_vblank_put(crtc);
		drm_crtc_vblank_put(crtc);
	if (fb)
	if (fb)
		drm_framebuffer_unreference(fb);
		drm_framebuffer_unreference(fb);
+1 −1
Original line number Original line Diff line number Diff line
@@ -142,7 +142,7 @@ int drm_ht_just_insert_please(struct drm_open_hash *ht, struct drm_hash_item *it
			      unsigned long add)
			      unsigned long add)
{
{
	int ret;
	int ret;
	unsigned long mask = (1 << bits) - 1;
	unsigned long mask = (1UL << bits) - 1;
	unsigned long first, unshifted_key;
	unsigned long first, unshifted_key;


	unshifted_key = hash_long(seed, bits);
	unshifted_key = hash_long(seed, bits);
+18 −5
Original line number Original line Diff line number Diff line
@@ -870,8 +870,20 @@ bool drm_property_change_valid_get(struct drm_property *property,
		for (i = 0; i < property->num_values; i++)
		for (i = 0; i < property->num_values; i++)
			valid_mask |= (1ULL << property->values[i]);
			valid_mask |= (1ULL << property->values[i]);
		return !(value & ~valid_mask);
		return !(value & ~valid_mask);
	} else if (drm_property_type_is(property, DRM_MODE_PROP_BLOB) ||
	} else if (drm_property_type_is(property, DRM_MODE_PROP_BLOB)) {
		   drm_property_type_is(property, DRM_MODE_PROP_OBJECT)) {
		struct drm_property_blob *blob;

		if (value == 0)
			return true;

		blob = drm_property_lookup_blob(property->dev, value);
		if (blob) {
			*ref = &blob->base;
			return true;
		} else {
			return false;
		}
	} else if (drm_property_type_is(property, DRM_MODE_PROP_OBJECT)) {
		/* a zero value for an object property translates to null: */
		/* a zero value for an object property translates to null: */
		if (value == 0)
		if (value == 0)
			return true;
			return true;
@@ -893,7 +905,8 @@ void drm_property_change_valid_put(struct drm_property *property,
	if (!ref)
	if (!ref)
		return;
		return;


	if (drm_property_type_is(property, DRM_MODE_PROP_OBJECT) ||
	if (drm_property_type_is(property, DRM_MODE_PROP_OBJECT)) {
	    drm_property_type_is(property, DRM_MODE_PROP_BLOB))
		drm_mode_object_unreference(ref);
		drm_mode_object_unreference(ref);
	} else if (drm_property_type_is(property, DRM_MODE_PROP_BLOB))
		drm_property_unreference_blob(obj_to_blob(ref));
}
}
Loading