Skip to content

Commit 83bc5fd

Browse files
danvetairlied
authored andcommitted
drm/sis: fixup sis_mm ioctl structs
Userspace uses long in quite a few places more than the kernel. Which gives me neat proof that I'm the only guy on this side of the galaxy who ever tried to run glxgears on a 64bit machine with sis graphics on linux. Note that the longs in drm_sis_mem_t aren't aligned properly, so this won't even work with 32bit userspace on 64bit kernel as-is. Hence the patch can't break that, either. Nope, I'm not nuts enough to write the 32bit ioctl compat layer for this and test it with some wine app. Even though hunting the ebay dungeons for a sis card actually supported by the mesa drivers casts some doubts on this ... Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Dave Airlie <airlied@redhat.com>
1 parent 26587e6 commit 83bc5fd

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

‎drivers/gpu/drm/sis/sis_mm.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ static int sis_fb_init(struct drm_device *dev, void *data, struct drm_file *file
7474
dev_priv->vram_offset = fb->offset;
7575

7676
mutex_unlock(&dev->struct_mutex);
77-
DRM_DEBUG("offset = %u, size = %u\n", fb->offset, fb->size);
77+
DRM_DEBUG("offset = %lu, size = %lu\n", fb->offset, fb->size);
7878

7979
return 0;
8080
}
@@ -161,7 +161,7 @@ static int sis_drm_alloc(struct drm_device *dev, struct drm_file *file,
161161
mem->size = 0;
162162
mem->free = 0;
163163

164-
DRM_DEBUG("alloc %d, size = %d, offset = %d\n", pool, mem->size,
164+
DRM_DEBUG("alloc %d, size = %ld, offset = %ld\n", pool, mem->size,
165165
mem->offset);
166166

167167
return retval;
@@ -215,7 +215,7 @@ static int sis_ioctl_agp_init(struct drm_device *dev, void *data,
215215
dev_priv->agp_offset = agp->offset;
216216
mutex_unlock(&dev->struct_mutex);
217217

218-
DRM_DEBUG("offset = %u, size = %u\n", agp->offset, agp->size);
218+
DRM_DEBUG("offset = %lu, size = %lu\n", agp->offset, agp->size);
219219
return 0;
220220
}
221221

‎include/drm/sis_drm.h‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,17 @@
5151

5252
typedef struct {
5353
int context;
54-
unsigned int offset;
55-
unsigned int size;
54+
unsigned long offset;
55+
unsigned long size;
5656
unsigned long free;
5757
} drm_sis_mem_t;
5858

5959
typedef struct {
60-
unsigned int offset, size;
60+
unsigned long offset, size;
6161
} drm_sis_agp_t;
6262

6363
typedef struct {
64-
unsigned int offset, size;
64+
unsigned long offset, size;
6565
} drm_sis_fb_t;
6666

6767
struct sis_file_private {

0 commit comments

Comments
 (0)