diff options
| -rw-r--r-- | drivers/gpu/drm/drm_mm.c | 3 | ||||
| -rw-r--r-- | drivers/gpu/drm/radeon/atom.c | 5 | ||||
| -rw-r--r-- | drivers/gpu/drm/radeon/atombios_dp.c | 2 | ||||
| -rw-r--r-- | drivers/gpu/drm/ttm/ttm_bo.c | 6 |
4 files changed, 13 insertions, 3 deletions
diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm/drm_mm.c index cdec32977129..2ac074c8f5d2 100644 --- a/drivers/gpu/drm/drm_mm.c +++ b/drivers/gpu/drm/drm_mm.c | |||
| @@ -405,7 +405,8 @@ struct drm_mm_node *drm_mm_search_free_in_range(const struct drm_mm *mm, | |||
| 405 | wasted += alignment - tmp; | 405 | wasted += alignment - tmp; |
| 406 | } | 406 | } |
| 407 | 407 | ||
| 408 | if (entry->size >= size + wasted) { | 408 | if (entry->size >= size + wasted && |
| 409 | (entry->start + wasted + size) <= end) { | ||
| 409 | if (!best_match) | 410 | if (!best_match) |
| 410 | return entry; | 411 | return entry; |
| 411 | if (entry->size < best_size) { | 412 | if (entry->size < best_size) { |
diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c index e3b44562d265..2a3df5599ab4 100644 --- a/drivers/gpu/drm/radeon/atom.c +++ b/drivers/gpu/drm/radeon/atom.c | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | 24 | ||
| 25 | #include <linux/module.h> | 25 | #include <linux/module.h> |
| 26 | #include <linux/sched.h> | 26 | #include <linux/sched.h> |
| 27 | #include <asm/unaligned.h> | ||
| 27 | 28 | ||
| 28 | #define ATOM_DEBUG | 29 | #define ATOM_DEBUG |
| 29 | 30 | ||
| @@ -212,7 +213,9 @@ static uint32_t atom_get_src_int(atom_exec_context *ctx, uint8_t attr, | |||
| 212 | case ATOM_ARG_PS: | 213 | case ATOM_ARG_PS: |
| 213 | idx = U8(*ptr); | 214 | idx = U8(*ptr); |
| 214 | (*ptr)++; | 215 | (*ptr)++; |
| 215 | val = le32_to_cpu(ctx->ps[idx]); | 216 | /* get_unaligned_le32 avoids unaligned accesses from atombios |
| 217 | * tables, noticed on a DEC Alpha. */ | ||
| 218 | val = get_unaligned_le32((u32 *)&ctx->ps[idx]); | ||
| 216 | if (print) | 219 | if (print) |
| 217 | DEBUG("PS[0x%02X,0x%04X]", idx, val); | 220 | DEBUG("PS[0x%02X,0x%04X]", idx, val); |
| 218 | break; | 221 | break; |
diff --git a/drivers/gpu/drm/radeon/atombios_dp.c b/drivers/gpu/drm/radeon/atombios_dp.c index b32eeea5bb8b..99915a682d59 100644 --- a/drivers/gpu/drm/radeon/atombios_dp.c +++ b/drivers/gpu/drm/radeon/atombios_dp.c | |||
| @@ -350,7 +350,7 @@ retry: | |||
| 350 | atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); | 350 | atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); |
| 351 | 351 | ||
| 352 | if (args.ucReplyStatus && !args.ucDataOutLen) { | 352 | if (args.ucReplyStatus && !args.ucDataOutLen) { |
| 353 | if (args.ucReplyStatus == 0x20 && retry_count < 10) | 353 | if (args.ucReplyStatus == 0x20 && retry_count++ < 10) |
| 354 | goto retry; | 354 | goto retry; |
| 355 | DRM_DEBUG("failed to get auxch %02x%02x %02x %02x 0x%02x %02x after %d retries\n", | 355 | DRM_DEBUG("failed to get auxch %02x%02x %02x %02x 0x%02x %02x after %d retries\n", |
| 356 | req_bytes[1], req_bytes[0], req_bytes[2], req_bytes[3], | 356 | req_bytes[1], req_bytes[0], req_bytes[2], req_bytes[3], |
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 1a3e909b7bba..c7320ce4567d 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c | |||
| @@ -1020,6 +1020,12 @@ static int ttm_bo_mem_compat(struct ttm_placement *placement, | |||
| 1020 | struct ttm_mem_reg *mem) | 1020 | struct ttm_mem_reg *mem) |
| 1021 | { | 1021 | { |
| 1022 | int i; | 1022 | int i; |
| 1023 | struct drm_mm_node *node = mem->mm_node; | ||
| 1024 | |||
| 1025 | if (node && placement->lpfn != 0 && | ||
| 1026 | (node->start < placement->fpfn || | ||
| 1027 | node->start + node->size > placement->lpfn)) | ||
| 1028 | return -1; | ||
| 1023 | 1029 | ||
| 1024 | for (i = 0; i < placement->num_placement; i++) { | 1030 | for (i = 0; i < placement->num_placement; i++) { |
| 1025 | if ((placement->placement[i] & mem->placement & | 1031 | if ((placement->placement[i] & mem->placement & |
