Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+99 -8
+37
Documentation/gpu/drm-uapi.rst
··· 156 156 visible to user-space and accessible beyond open-file boundaries, they 157 157 cannot support render nodes. 158 158 159 + Validating changes with IGT 160 + =========================== 161 + 162 + There's a collection of tests that aims to cover the whole functionality of 163 + DRM drivers and that can be used to check that changes to DRM drivers or the 164 + core don't regress existing functionality. This test suite is called IGT and 165 + its code can be found in https://cgit.freedesktop.org/drm/igt-gpu-tools/. 166 + 167 + To build IGT, start by installing its build dependencies. In Debian-based 168 + systems:: 169 + 170 + # apt-get build-dep intel-gpu-tools 171 + 172 + And in Fedora-based systems:: 173 + 174 + # dnf builddep intel-gpu-tools 175 + 176 + Then clone the repository:: 177 + 178 + $ git clone git://anongit.freedesktop.org/drm/igt-gpu-tools 179 + 180 + Configure the build system and start the build:: 181 + 182 + $ cd igt-gpu-tools && ./autogen.sh && make -j6 183 + 184 + Download the piglit dependency:: 185 + 186 + $ ./scripts/run-tests.sh -d 187 + 188 + And run the tests:: 189 + 190 + $ ./scripts/run-tests.sh -t kms -t core -s 191 + 192 + run-tests.sh is a wrapper around piglit that will execute the tests matching 193 + the -t options. A report in HTML format will be available in 194 + ./results/html/index.html. Results can be compared with piglit. 195 + 159 196 VBlank event handling 160 197 ===================== 161 198
+10 -1
drivers/gpu/drm/drm_atomic.c
··· 1609 1609 struct drm_crtc_state *crtc_state; 1610 1610 unsigned plane_mask; 1611 1611 int ret = 0; 1612 - unsigned int i, j; 1612 + unsigned int i, j, k; 1613 1613 1614 1614 /* disallow for drivers not supporting atomic: */ 1615 1615 if (!drm_core_check_feature(dev, DRIVER_ATOMIC)) ··· 1688 1688 if (get_user(prop_id, props_ptr + copied_props)) { 1689 1689 drm_mode_object_unreference(obj); 1690 1690 ret = -EFAULT; 1691 + goto out; 1692 + } 1693 + 1694 + for (k = 0; k < obj->properties->count; k++) 1695 + if (obj->properties->properties[k]->base.id == prop_id) 1696 + break; 1697 + 1698 + if (k == obj->properties->count) { 1699 + ret = -EINVAL; 1691 1700 goto out; 1692 1701 } 1693 1702
+1 -1
drivers/gpu/drm/drm_crtc.c
··· 2044 2044 } 2045 2045 2046 2046 out: 2047 - if (ret) 2047 + if (ret && crtc->funcs->page_flip_target) 2048 2048 drm_crtc_vblank_put(crtc); 2049 2049 if (fb) 2050 2050 drm_framebuffer_unreference(fb);
+1 -1
drivers/gpu/drm/drm_hashtab.c
··· 142 142 unsigned long add) 143 143 { 144 144 int ret; 145 - unsigned long mask = (1 << bits) - 1; 145 + unsigned long mask = (1UL << bits) - 1; 146 146 unsigned long first, unshifted_key; 147 147 148 148 unshifted_key = hash_long(seed, bits);
+18 -5
drivers/gpu/drm/drm_property.c
··· 870 870 for (i = 0; i < property->num_values; i++) 871 871 valid_mask |= (1ULL << property->values[i]); 872 872 return !(value & ~valid_mask); 873 - } else if (drm_property_type_is(property, DRM_MODE_PROP_BLOB) || 874 - drm_property_type_is(property, DRM_MODE_PROP_OBJECT)) { 873 + } else if (drm_property_type_is(property, DRM_MODE_PROP_BLOB)) { 874 + struct drm_property_blob *blob; 875 + 876 + if (value == 0) 877 + return true; 878 + 879 + blob = drm_property_lookup_blob(property->dev, value); 880 + if (blob) { 881 + *ref = &blob->base; 882 + return true; 883 + } else { 884 + return false; 885 + } 886 + } else if (drm_property_type_is(property, DRM_MODE_PROP_OBJECT)) { 875 887 /* a zero value for an object property translates to null: */ 876 888 if (value == 0) 877 889 return true; ··· 900 888 } 901 889 902 890 void drm_property_change_valid_put(struct drm_property *property, 903 - struct drm_mode_object *ref) 891 + struct drm_mode_object *ref) 904 892 { 905 893 if (!ref) 906 894 return; 907 895 908 - if (drm_property_type_is(property, DRM_MODE_PROP_OBJECT) || 909 - drm_property_type_is(property, DRM_MODE_PROP_BLOB)) 896 + if (drm_property_type_is(property, DRM_MODE_PROP_OBJECT)) { 910 897 drm_mode_object_unreference(ref); 898 + } else if (drm_property_type_is(property, DRM_MODE_PROP_BLOB)) 899 + drm_property_unreference_blob(obj_to_blob(ref)); 911 900 }
+16
drivers/gpu/drm/udl/udl_drv.c
··· 16 16 return 0; 17 17 } 18 18 19 + static int udl_usb_suspend(struct usb_interface *interface, 20 + pm_message_t message) 21 + { 22 + return 0; 23 + } 24 + 25 + static int udl_usb_resume(struct usb_interface *interface) 26 + { 27 + struct drm_device *dev = usb_get_intfdata(interface); 28 + 29 + udl_modeset_restore(dev); 30 + return 0; 31 + } 32 + 19 33 static const struct vm_operations_struct udl_gem_vm_ops = { 20 34 .fault = udl_gem_fault, 21 35 .open = drm_gem_vm_open, ··· 136 122 .name = "udl", 137 123 .probe = udl_usb_probe, 138 124 .disconnect = udl_usb_disconnect, 125 + .suspend = udl_usb_suspend, 126 + .resume = udl_usb_resume, 139 127 .id_table = id_table, 140 128 }; 141 129 module_usb_driver(udl_driver);
+2
drivers/gpu/drm/udl/udl_drv.h
··· 52 52 struct device *dev; 53 53 struct drm_device *ddev; 54 54 struct usb_device *udev; 55 + struct drm_crtc *crtc; 55 56 56 57 int sku_pixel_limit; 57 58 ··· 88 87 89 88 /* modeset */ 90 89 int udl_modeset_init(struct drm_device *dev); 90 + void udl_modeset_restore(struct drm_device *dev); 91 91 void udl_modeset_cleanup(struct drm_device *dev); 92 92 int udl_connector_init(struct drm_device *dev, struct drm_encoder *encoder); 93 93
+14
drivers/gpu/drm/udl/udl_modeset.c
··· 309 309 char *wrptr; 310 310 int color_depth = 0; 311 311 312 + udl->crtc = crtc; 313 + 312 314 buf = (char *)udl->mode_buf; 313 315 314 316 /* for now we just clip 24 -> 16 - if we fix that fix this */ ··· 450 448 udl_connector_init(dev, encoder); 451 449 452 450 return 0; 451 + } 452 + 453 + void udl_modeset_restore(struct drm_device *dev) 454 + { 455 + struct udl_device *udl = dev->dev_private; 456 + struct udl_framebuffer *ufb; 457 + 458 + if (!udl->crtc || !udl->crtc->primary->fb) 459 + return; 460 + udl_crtc_commit(udl->crtc); 461 + ufb = to_udl_fb(udl->crtc->primary->fb); 462 + udl_handle_damage(ufb, 0, 0, ufb->base.width, ufb->base.height); 453 463 } 454 464 455 465 void udl_modeset_cleanup(struct drm_device *dev)