Merge branch 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6
* 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: drm/radeon/kms: make sure retry count increases. drm/radeon/kms/atom: use get_unaligned_le32() for ctx->ps drm/ttm: Fix a bug occuring when validating a buffer object in a range. drm: Fix a bug in the range manager.
This commit is contained in:
commit
76212a840f
|
@ -405,7 +405,8 @@ struct drm_mm_node *drm_mm_search_free_in_range(const struct drm_mm *mm,
|
||||||
wasted += alignment - tmp;
|
wasted += alignment - tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (entry->size >= size + wasted) {
|
if (entry->size >= size + wasted &&
|
||||||
|
(entry->start + wasted + size) <= end) {
|
||||||
if (!best_match)
|
if (!best_match)
|
||||||
return entry;
|
return entry;
|
||||||
if (entry->size < best_size) {
|
if (entry->size < best_size) {
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
|
#include <asm/unaligned.h>
|
||||||
|
|
||||||
#define ATOM_DEBUG
|
#define ATOM_DEBUG
|
||||||
|
|
||||||
|
@ -212,7 +213,9 @@ static uint32_t atom_get_src_int(atom_exec_context *ctx, uint8_t attr,
|
||||||
case ATOM_ARG_PS:
|
case ATOM_ARG_PS:
|
||||||
idx = U8(*ptr);
|
idx = U8(*ptr);
|
||||||
(*ptr)++;
|
(*ptr)++;
|
||||||
val = le32_to_cpu(ctx->ps[idx]);
|
/* get_unaligned_le32 avoids unaligned accesses from atombios
|
||||||
|
* tables, noticed on a DEC Alpha. */
|
||||||
|
val = get_unaligned_le32((u32 *)&ctx->ps[idx]);
|
||||||
if (print)
|
if (print)
|
||||||
DEBUG("PS[0x%02X,0x%04X]", idx, val);
|
DEBUG("PS[0x%02X,0x%04X]", idx, val);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -350,7 +350,7 @@ retry:
|
||||||
atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
|
atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
|
||||||
|
|
||||||
if (args.ucReplyStatus && !args.ucDataOutLen) {
|
if (args.ucReplyStatus && !args.ucDataOutLen) {
|
||||||
if (args.ucReplyStatus == 0x20 && retry_count < 10)
|
if (args.ucReplyStatus == 0x20 && retry_count++ < 10)
|
||||||
goto retry;
|
goto retry;
|
||||||
DRM_DEBUG("failed to get auxch %02x%02x %02x %02x 0x%02x %02x after %d retries\n",
|
DRM_DEBUG("failed to get auxch %02x%02x %02x %02x 0x%02x %02x after %d retries\n",
|
||||||
req_bytes[1], req_bytes[0], req_bytes[2], req_bytes[3],
|
req_bytes[1], req_bytes[0], req_bytes[2], req_bytes[3],
|
||||||
|
|
|
@ -1020,6 +1020,12 @@ static int ttm_bo_mem_compat(struct ttm_placement *placement,
|
||||||
struct ttm_mem_reg *mem)
|
struct ttm_mem_reg *mem)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
struct drm_mm_node *node = mem->mm_node;
|
||||||
|
|
||||||
|
if (node && placement->lpfn != 0 &&
|
||||||
|
(node->start < placement->fpfn ||
|
||||||
|
node->start + node->size > placement->lpfn))
|
||||||
|
return -1;
|
||||||
|
|
||||||
for (i = 0; i < placement->num_placement; i++) {
|
for (i = 0; i < placement->num_placement; i++) {
|
||||||
if ((placement->placement[i] & mem->placement &
|
if ((placement->placement[i] & mem->placement &
|
||||||
|
|
Loading…
Reference in New Issue