From patchwork Fri Apr 9 02:05:21 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matthew W. S. Bell" X-Patchwork-Id: 91654 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o396UIHi005409 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 9 Apr 2010 06:30:53 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1O07iQ-0002s9-Ns; Fri, 09 Apr 2010 06:29:18 +0000 Received: from sfi-mx-3.v28.ch3.sourceforge.com ([172.29.28.123] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1O03bE-0008AG-Pp for dri-devel@lists.sourceforge.net; Fri, 09 Apr 2010 02:05:36 +0000 X-ACL-Warn: Received: from garuda.bells23.org.uk ([85.13.250.28]) by sfi-mx-3.v28.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) id 1O03bD-0001CT-8w for dri-devel@lists.sourceforge.net; Fri, 09 Apr 2010 02:05:36 +0000 Received: from localhost ([127.0.0.1] helo=garuda.bells23.org.uk) by garuda.bells23.org.uk with esmtp (Exim 4.69) (envelope-from ) id 1O03b5-0004T6-MR; Fri, 09 Apr 2010 03:05:27 +0100 Received: from [92.39.192.175] (port=60794 helo=[192.168.1.230]) by garuda.bells23.org.uk with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1O03b5-0004T2-E9; Fri, 09 Apr 2010 03:05:27 +0100 Subject: [PATCH] drm_handle_t type From: "Matthew W. S. Bell" To: Dave Airlie In-Reply-To: References: <1270259956.4292.6.camel@ibis.bells> <1270300193.20809.13.camel@ibis.bells> Date: Fri, 09 Apr 2010 03:05:21 +0100 Message-ID: <1270778721.20809.31.camel@ibis.bells> Mime-Version: 1.0 X-Mailer: Evolution 2.29.92 X-Spam-Score: 0.0 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. _SUMMARY_ X-Headers-End: 1O03bD-0001CT-8w X-Mailman-Approved-At: Fri, 09 Apr 2010 06:29:17 +0000 Cc: Dave Airlie , dri-devel@lists.sourceforge.net X-BeenThere: dri-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list Reply-To: matthew@bells23.org.uk, dri-devel@lists.sourceforge.net List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 09 Apr 2010 06:30:54 +0000 (UTC) diff --git a/include/drm/drm.h b/include/drm/drm.h index 4822159..e74d6d6 100644 --- a/include/drm/drm.h +++ b/include/drm/drm.h @@ -216,6 +216,8 @@ struct drm_map { enum drm_map_flags flags; /**< Flags */ void *handle; /**< User-space: "Handle" to pass to mmap() */ /**< Kernel-space: kernel-virtual address */ + /** The value herein shall be the size of */ + /** drm_handle_t despite the size of void *. */ int mtrr; /**< MTRR slot used */ /* Private data */ }; diff --git a/xf86drm.c b/xf86drm.c index 220aaa1..012408a 100644 --- a/xf86drm.c +++ b/xf86drm.c @@ -959,7 +959,7 @@ int drmAddMap(int fd, drm_handle_t offset, drmSize size, drmMapType type, if (drmIoctl(fd, DRM_IOCTL_ADD_MAP, &map)) return -errno; if (handle) - *handle = (drm_handle_t)map.handle; + *handle = (uintptr_t)map.handle; return 0; } @@ -2138,7 +2138,7 @@ int drmGetMap(int fd, int idx, drm_handle_t *offset, drmSize *size, *size = map.size; *type = map.type; *flags = map.flags; - *handle = (unsigned long)map.handle; + *handle = (uintptr_t)map.handle; *mtrr = map.mtrr; return 0; }