[PATCH 1/4] modesetting: Fix 32bit breakage
Michel Dänzer
michel at daenzer.net
Mon Feb 16 22:32:57 PST 2015
On 17.02.2015 15:13, Takashi Iwai wrote:
> At Tue, 17 Feb 2015 12:15:04 +0900,
> Michel Dänzer wrote:
>>
>> 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?
>
> I guess it would work, too, but this touches all over the code, so I'm
> afraid of a possible regression somewhere. That's why I took a
> band-aid fix at this time.
I think the risk is pretty low, and since we're at the start of the
merge window, it's a good time to make the change and deal with any fallout.
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
More information about the xorg-devel
mailing list