Bug 942

Summary: Patch to add support for 32bit DRI clients on 64bit machines
Product: DRI Reporter: Egbert Eich <eich>
Component: GeneralAssignee: Egbert Eich <eich>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: high    
Version: XOrg git   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Egbert Eich 2004-07-29 02:04:15 UTC
The patch that will be attached below adds support for 32bit clients on 64bit
platforms. The patch has been developed and tested on AMD64 with the Radeon,
R128 and MGA drivers.
The patch mainly does three things: 
1. It modifies data structures that are passed between a 64bit server and 
   clients (that can be 64 or 32 bit) to contain only data types that have
   the same size in 32 and 64bit.
2. It attempts to hide the drm_handle_t type from the clients.
   This type is used for mapping handles that are passed between kernel, Xserver
   and clients. For convenience reasons the kernel space addresses of the mapped
   areas are used which confines this type to unsigned long. However a 64bit
   unsigned long cannot be used in a 32bit mmap. The new code calculates a 
   32bit unsigned int hash value which identifes the memory area.
   Some dri X drivers (at least in the past) took advantage of the fact that
   these handles are physical addresses in some cases. This has been fixed
   in the Matrox driver but may still be a problem for the drivers that have not
   been tested.
3. It adds ioct32 handlers for those IOCTL structures that contain data types
   that have different size and/or alingment in 32 and 64bit.

Currently the modifications have only been done for Linux. It is expected that
considerable work is required for other platforms that use DRM.
Comment 1 Adam Jackson 2004-08-01 15:11:48 UTC

*** This bug has been marked as a duplicate of 943 ***

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.