[PATCH 1/4] modesetting: Fix 32bit breakage

Michel Dänzer michel at daenzer.net
Mon Feb 16 19:15:04 PST 2015


On 17.02.2015 01:00, Takashi Iwai wrote:
> The current modesetting driver fails with cirrus KMS and others on
> 32bit architecture.  It aborts at mmap() call failure in dumb_bo.c,
> and it's because the offset is passed as 32bit off_t; this truncates
> DRM_FILE_PAGE_OFFSET bit and the KMS driver refuses the value.
> 
> This is an ad hoc fix just to let 64bit off_t being used for mmap() by
> adding _FILE_OFFSET_BITS=64.
> 
> Signed-off-by: Takashi Iwai <tiwai at suse.de>
> ---
>  hw/xfree86/drivers/modesetting/dumb_bo.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/hw/xfree86/drivers/modesetting/dumb_bo.c b/hw/xfree86/drivers/modesetting/dumb_bo.c
> index 58d420e07568..29948d453a1a 100644
> --- a/hw/xfree86/drivers/modesetting/dumb_bo.c
> +++ b/hw/xfree86/drivers/modesetting/dumb_bo.c
> @@ -25,6 +25,8 @@
>   *
>   */
>  
> +#define _FILE_OFFSET_BITS	64
> +

This is what AC_SYS_LARGEFILE is for in configure.ac. Does this work
instead?


diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index 1aa77a5..b0eb696 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -388,9 +388,15 @@
 /* Vendor name */
 #undef XVENDORNAME

+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
 /* Enable GNU and other extensions to the C environment for GLIBC */
 #undef _GNU_SOURCE

+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
+
 /* Define to empty if `const' does not conform to ANSI C. */
 #undef const



-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer


More information about the xorg-devel mailing list