From owner-svn-src-head@FreeBSD.ORG Sun Aug 25 00:34:45 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9A017E64; Sun, 25 Aug 2013 00:34:45 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 87EB72D34; Sun, 25 Aug 2013 00:34:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7P0Yjbv082833; Sun, 25 Aug 2013 00:34:45 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7P0Yjru082831; Sun, 25 Aug 2013 00:34:45 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201308250034.r7P0Yjru082831@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Sun, 25 Aug 2013 00:34:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254822 - head/sys/dev/drm2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Aug 2013 00:34:45 -0000 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); }