From: "Matthew W. S. Bell" Subject: [PATCH] drm_handle_t type Date: Fri, 09 Apr 2010 03:05:21 +0100 Message-ID: <1270778721.20809.31.camel@ibis.bells> References: <1270259956.4292.6.camel@ibis.bells> <1270300193.20809.13.camel@ibis.bells> Reply-To: matthew@bells23.org.uk, dri-devel@lists.sourceforge.net Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1336751975253862082==" Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.sourceforge.net To: Dave Airlie Cc: Dave Airlie , dri-devel@lists.sourceforge.net List-Id: dri-devel@lists.freedesktop.org --===============1336751975253862082== Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-8tFnt5cZHTrBcZ9OvANN" --=-8tFnt5cZHTrBcZ9OvANN Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 2010-04-05 at 17:46 +1000, Dave Airlie wrote: > Its probably not documented well anywhere, though I think the handles are > 32-bit is written down somewhere. Well, here's a patch that silences the warnings and adds a little note. Matthew --- =46rom 9111cd82560052a329b78cff8d7e45c6815e0276 Mon Sep 17 00:00:00 2001 From: Matthew W. S. Bell Date: Fri, 9 Apr 2010 02:58:42 +0100 Add a comment about content of void* variable exchanged with kernel. Add casts to silence warnings about pointer to integer of a different size assignment. --- include/drm/drm.h | 2 ++ xf86drm.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) 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 =3D (drm_handle_t)map.handle; + *handle =3D (uintptr_t)map.handle; return 0; } =20 @@ -2138,7 +2138,7 @@ int drmGetMap(int fd, int idx, drm_handle_t *offset, = drmSize *size, *size =3D map.size; *type =3D map.type; *flags =3D map.flags; - *handle =3D (unsigned long)map.handle; + *handle =3D (uintptr_t)map.handle; *mtrr =3D map.mtrr; return 0; } --=20 1.7.0 --=-8tFnt5cZHTrBcZ9OvANN Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iQEcBAABAgAGBQJLvoteAAoJEDyn+gO8EoIoPlgH/1KzgzNSwycxs3dbFezfzLt6 1G5Ij5jd3vXlpyKByJx0dE69piPdA4puY6BY+KfTxDKG74N6eWKYPXKz6b8ByKjS 0PBzbzuhqzlVTk/3UW4rWQA415NkU8qN4qGVpjdy27bWDRvvlP4MxWY71/yaOSGT 8AN/uNua9uttmbMZbHkzz/KKg3k8C5mZYuXQrbBzWNSmW9XCQ6YNgRcHe/eoZKJw n4dbj30RtfHkusaAHbqm4ybeaiXhEsWf+lGnBbiSYVoFHMnoo2h8H0jJVxl9yrDH Kc67y4CCpiEciU5wTP8B6qkhaz6mY1R+IcsRs3PZL80GPpvlYjy6+Tf5XcYYyAM= =Zj6c -----END PGP SIGNATURE----- --=-8tFnt5cZHTrBcZ9OvANN-- --===============1336751975253862082== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev --===============1336751975253862082== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline -- _______________________________________________ Dri-devel mailing list Dri-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dri-devel --===============1336751975253862082==--