Author: dumbbell
Date: Sun Aug 25 00:34:44 2013
New Revision: 254822
URL: http://svnweb.freebsd.org/changeset/base/254822

Log:
  drm: In drm_mmap_single, try ttm_bo_mmap_single() before drm_gem_mmap_single()
  
  In drivers such as the Radeon driver, the DRIVER_GEM features flag is
  set but TTM is used to mmap buffer object.

Modified:
  head/sys/dev/drm2/drmP.h
  head/sys/dev/drm2/drm_drv.c

Modified: head/sys/dev/drm2/drmP.h
==============================================================================
--- head/sys/dev/drm2/drmP.h    Sun Aug 25 00:22:34 2013        (r254821)
+++ head/sys/dev/drm2/drmP.h    Sun Aug 25 00:34:44 2013        (r254822)
@@ -913,7 +913,7 @@ struct drm_device {
        struct drm_minor *control;              /**< Control node for card */
        struct drm_minor *primary;              /**< render type primary screen 
head */
 
-       void              *drm_ttm_bo;
+       void              *drm_ttm_bdev;
        struct unrhdr     *drw_unrhdr;
        /* RB tree of drawable infos */
        RB_HEAD(drawable_tree, bsd_drm_drawable_info) drw_head;

Modified: head/sys/dev/drm2/drm_drv.c
==============================================================================
--- head/sys/dev/drm2/drm_drv.c Sun Aug 25 00:22:34 2013        (r254821)
+++ head/sys/dev/drm2/drm_drv.c Sun Aug 25 00:34:44 2013        (r254822)
@@ -993,11 +993,11 @@ drm_mmap_single(struct cdev *kdev, vm_oo
        struct drm_device *dev;
 
        dev = drm_get_device_from_kdev(kdev);
-       if ((dev->driver->driver_features & DRIVER_GEM) != 0) {
-               return (drm_gem_mmap_single(dev, offset, size, obj_res, nprot));
-       } else if (dev->drm_ttm_bo != NULL) {
-               return (ttm_bo_mmap_single(dev->drm_ttm_bo, offset, size,
+       if (dev->drm_ttm_bdev != NULL) {
+               return (ttm_bo_mmap_single(dev->drm_ttm_bdev, offset, size,
                    obj_res, nprot));
+       } else if ((dev->driver->driver_features & DRIVER_GEM) != 0) {
+               return (drm_gem_mmap_single(dev, offset, size, obj_res, nprot));
        } else {
                return (ENODEV);
        }
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to