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

Takashi Iwai tiwai at suse.de
Mon Feb 16 08:00:52 PST 2015


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
+
 #include "dumb_bo.h"
 
 #include <errno.h>
-- 
2.3.0



More information about the xorg-devel mailing list