diff options
Diffstat (limited to 'drivers/gpu/drm/drm_bufs.c')
-rw-r--r-- | drivers/gpu/drm/drm_bufs.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/gpu/drm/drm_bufs.c b/drivers/gpu/drm/drm_bufs.c index 3e257a50bf56..61e1ef90d4e5 100644 --- a/drivers/gpu/drm/drm_bufs.c +++ b/drivers/gpu/drm/drm_bufs.c | |||
@@ -46,10 +46,11 @@ static struct drm_map_list *drm_find_matching_map(struct drm_device *dev, | |||
46 | list_for_each_entry(entry, &dev->maplist, head) { | 46 | list_for_each_entry(entry, &dev->maplist, head) { |
47 | /* | 47 | /* |
48 | * Because the kernel-userspace ABI is fixed at a 32-bit offset | 48 | * Because the kernel-userspace ABI is fixed at a 32-bit offset |
49 | * while PCI resources may live above that, we ignore the map | 49 | * while PCI resources may live above that, we only compare the |
50 | * offset for maps of type _DRM_FRAMEBUFFER or _DRM_REGISTERS. | 50 | * lower 32 bits of the map offset for maps of type |
51 | * It is assumed that each driver will have only one resource of | 51 | * _DRM_FRAMEBUFFER or _DRM_REGISTERS. |
52 | * each type. | 52 | * It is assumed that if a driver have more than one resource |
53 | * of each type, the lower 32 bits are different. | ||
53 | */ | 54 | */ |
54 | if (!entry->map || | 55 | if (!entry->map || |
55 | map->type != entry->map->type || | 56 | map->type != entry->map->type || |
@@ -59,9 +60,12 @@ static struct drm_map_list *drm_find_matching_map(struct drm_device *dev, | |||
59 | case _DRM_SHM: | 60 | case _DRM_SHM: |
60 | if (map->flags != _DRM_CONTAINS_LOCK) | 61 | if (map->flags != _DRM_CONTAINS_LOCK) |
61 | break; | 62 | break; |
63 | return entry; | ||
62 | case _DRM_REGISTERS: | 64 | case _DRM_REGISTERS: |
63 | case _DRM_FRAME_BUFFER: | 65 | case _DRM_FRAME_BUFFER: |
64 | return entry; | 66 | if ((entry->map->offset & 0xffffffff) == |
67 | (map->offset & 0xffffffff)) | ||
68 | return entry; | ||
65 | default: /* Make gcc happy */ | 69 | default: /* Make gcc happy */ |
66 | ; | 70 | ; |
67 | } | 71 | } |
@@ -183,9 +187,6 @@ static int drm_addmap_core(struct drm_device * dev, resource_size_t offset, | |||
183 | return -EINVAL; | 187 | return -EINVAL; |
184 | } | 188 | } |
185 | #endif | 189 | #endif |
186 | #ifdef __alpha__ | ||
187 | map->offset += dev->hose->mem_space->start; | ||
188 | #endif | ||
189 | /* Some drivers preinitialize some maps, without the X Server | 190 | /* Some drivers preinitialize some maps, without the X Server |
190 | * needing to be aware of it. Therefore, we just return success | 191 | * needing to be aware of it. Therefore, we just return success |
191 | * when the server tries to create a duplicate map. | 192 | * when the server tries to create a duplicate map. |