|
@@ -1466,6 +1466,16 @@ unlock:
|
|
|
*
|
|
|
* While the mapping holds a reference on the contents of the object, it doesn't
|
|
|
* imply a ref on the object itself.
|
|
|
+ *
|
|
|
+ * IMPORTANT:
|
|
|
+ *
|
|
|
+ * DRM driver writers who look a this function as an example for how to do GEM
|
|
|
+ * mmap support, please don't implement mmap support like here. The modern way
|
|
|
+ * to implement DRM mmap support is with an mmap offset ioctl (like
|
|
|
+ * i915_gem_mmap_gtt) and then using the mmap syscall on the DRM fd directly.
|
|
|
+ * That way debug tooling like valgrind will understand what's going on, hiding
|
|
|
+ * the mmap call in a driver private ioctl will break that. The i915 driver only
|
|
|
+ * does cpu mmaps this way because we didn't know better.
|
|
|
*/
|
|
|
int
|
|
|
i915_gem_mmap_ioctl(struct drm_device *dev, void *data,
|