Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Aug 2013 00:34:45 +0000 (UTC)
From:      Jean-Sebastien Pedron <dumbbell@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r254822 - head/sys/dev/drm2
Message-ID:  <201308250034.r7P0Yjru082831@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308250034.r7P0Yjru082831>