Updated from Linux LTS 3.10.21 to 3.10.22
This commit is contained in:
@@ -7163,7 +7163,9 @@ static void i9xx_update_cursor(struct drm_crtc *crtc, u32 base)
|
||||
intel_crtc->cursor_visible = visible;
|
||||
}
|
||||
/* and commit changes on next vblank */
|
||||
POSTING_READ(CURCNTR(pipe));
|
||||
I915_WRITE(CURBASE(pipe), base);
|
||||
POSTING_READ(CURBASE(pipe));
|
||||
}
|
||||
|
||||
static void ivb_update_cursor(struct drm_crtc *crtc, u32 base)
|
||||
@@ -7192,7 +7194,9 @@ static void ivb_update_cursor(struct drm_crtc *crtc, u32 base)
|
||||
intel_crtc->cursor_visible = visible;
|
||||
}
|
||||
/* and commit changes on next vblank */
|
||||
POSTING_READ(CURCNTR_IVB(pipe));
|
||||
I915_WRITE(CURBASE_IVB(pipe), base);
|
||||
POSTING_READ(CURBASE_IVB(pipe));
|
||||
}
|
||||
|
||||
/* If no-part of the cursor is visible on the framebuffer, then the GPU may hang... */
|
||||
|
||||
@@ -91,7 +91,7 @@ static void qxl_fb_dirty_flush(struct fb_info *info)
|
||||
u32 x1, x2, y1, y2;
|
||||
|
||||
/* TODO: hard coding 32 bpp */
|
||||
int stride = qfbdev->qfb.base.pitches[0] * 4;
|
||||
int stride = qfbdev->qfb.base.pitches[0];
|
||||
|
||||
x1 = qfbdev->dirty.x1;
|
||||
x2 = qfbdev->dirty.x2;
|
||||
|
||||
@@ -1683,7 +1683,7 @@ static int radeon_atom_pick_pll(struct drm_crtc *crtc)
|
||||
if (pll != ATOM_PPLL_INVALID)
|
||||
return pll;
|
||||
}
|
||||
} else {
|
||||
} else if (!ASIC_IS_DCE41(rdev)) { /* Don't share PLLs on DCE4.1 chips */
|
||||
/* use the same PPLL for all monitors with the same clock */
|
||||
pll = radeon_get_shared_nondp_ppll(crtc);
|
||||
if (pll != ATOM_PPLL_INVALID)
|
||||
|
||||
@@ -219,8 +219,7 @@ void evergreen_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode
|
||||
/* fglrx clears sth in AFMT_AUDIO_PACKET_CONTROL2 here */
|
||||
|
||||
WREG32(HDMI_ACR_PACKET_CONTROL + offset,
|
||||
HDMI_ACR_AUTO_SEND | /* allow hw to sent ACR packets when required */
|
||||
HDMI_ACR_SOURCE); /* select SW CTS value */
|
||||
HDMI_ACR_AUTO_SEND); /* allow hw to sent ACR packets when required */
|
||||
|
||||
evergreen_hdmi_update_ACR(encoder, mode->clock);
|
||||
|
||||
|
||||
@@ -57,15 +57,15 @@ enum r600_hdmi_iec_status_bits {
|
||||
static const struct radeon_hdmi_acr r600_hdmi_predefined_acr[] = {
|
||||
/* 32kHz 44.1kHz 48kHz */
|
||||
/* Clock N CTS N CTS N CTS */
|
||||
{ 25174, 4576, 28125, 7007, 31250, 6864, 28125 }, /* 25,20/1.001 MHz */
|
||||
{ 25175, 4576, 28125, 7007, 31250, 6864, 28125 }, /* 25,20/1.001 MHz */
|
||||
{ 25200, 4096, 25200, 6272, 28000, 6144, 25200 }, /* 25.20 MHz */
|
||||
{ 27000, 4096, 27000, 6272, 30000, 6144, 27000 }, /* 27.00 MHz */
|
||||
{ 27027, 4096, 27027, 6272, 30030, 6144, 27027 }, /* 27.00*1.001 MHz */
|
||||
{ 54000, 4096, 54000, 6272, 60000, 6144, 54000 }, /* 54.00 MHz */
|
||||
{ 54054, 4096, 54054, 6272, 60060, 6144, 54054 }, /* 54.00*1.001 MHz */
|
||||
{ 74175, 11648, 210937, 17836, 234375, 11648, 140625 }, /* 74.25/1.001 MHz */
|
||||
{ 74176, 11648, 210937, 17836, 234375, 11648, 140625 }, /* 74.25/1.001 MHz */
|
||||
{ 74250, 4096, 74250, 6272, 82500, 6144, 74250 }, /* 74.25 MHz */
|
||||
{ 148351, 11648, 421875, 8918, 234375, 5824, 140625 }, /* 148.50/1.001 MHz */
|
||||
{ 148352, 11648, 421875, 8918, 234375, 5824, 140625 }, /* 148.50/1.001 MHz */
|
||||
{ 148500, 4096, 148500, 6272, 165000, 6144, 148500 }, /* 148.50 MHz */
|
||||
{ 0, 4096, 0, 6272, 0, 6144, 0 } /* Other */
|
||||
};
|
||||
@@ -75,8 +75,15 @@ static const struct radeon_hdmi_acr r600_hdmi_predefined_acr[] = {
|
||||
*/
|
||||
static void r600_hdmi_calc_cts(uint32_t clock, int *CTS, int N, int freq)
|
||||
{
|
||||
if (*CTS == 0)
|
||||
*CTS = clock * N / (128 * freq) * 1000;
|
||||
u64 n;
|
||||
u32 d;
|
||||
|
||||
if (*CTS == 0) {
|
||||
n = (u64)clock * (u64)N * 1000ULL;
|
||||
d = 128 * freq;
|
||||
do_div(n, d);
|
||||
*CTS = n;
|
||||
}
|
||||
DRM_DEBUG("Using ACR timing N=%d CTS=%d for frequency %d\n",
|
||||
N, *CTS, freq);
|
||||
}
|
||||
@@ -313,8 +320,8 @@ void r600_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode *mod
|
||||
}
|
||||
|
||||
WREG32(HDMI0_ACR_PACKET_CONTROL + offset,
|
||||
HDMI0_ACR_AUTO_SEND | /* allow hw to sent ACR packets when required */
|
||||
HDMI0_ACR_SOURCE); /* select SW CTS value */
|
||||
HDMI0_ACR_SOURCE | /* select SW CTS value - XXX verify that hw CTS works on all families */
|
||||
HDMI0_ACR_AUTO_SEND); /* allow hw to sent ACR packets when required */
|
||||
|
||||
WREG32(HDMI0_VBI_PACKET_CONTROL + offset,
|
||||
HDMI0_NULL_SEND | /* send null packets when required */
|
||||
|
||||
@@ -1157,6 +1157,8 @@ int radeon_vm_bo_update_pte(struct radeon_device *rdev,
|
||||
return -ENOMEM;
|
||||
|
||||
r = radeon_ib_get(rdev, ridx, &ib, NULL, ndw * 4);
|
||||
if (r)
|
||||
return r;
|
||||
ib.length_dw = 0;
|
||||
|
||||
r = radeon_vm_update_pdes(rdev, vm, &ib, bo_va->soffset, bo_va->eoffset);
|
||||
|
||||
@@ -422,6 +422,7 @@ int radeon_crtc_do_set_base(struct drm_crtc *crtc,
|
||||
/* Pin framebuffer & get tilling informations */
|
||||
obj = radeon_fb->obj;
|
||||
rbo = gem_to_radeon_bo(obj);
|
||||
retry:
|
||||
r = radeon_bo_reserve(rbo, false);
|
||||
if (unlikely(r != 0))
|
||||
return r;
|
||||
@@ -430,6 +431,33 @@ int radeon_crtc_do_set_base(struct drm_crtc *crtc,
|
||||
&base);
|
||||
if (unlikely(r != 0)) {
|
||||
radeon_bo_unreserve(rbo);
|
||||
|
||||
/* On old GPU like RN50 with little vram pining can fails because
|
||||
* current fb is taking all space needed. So instead of unpining
|
||||
* the old buffer after pining the new one, first unpin old one
|
||||
* and then retry pining new one.
|
||||
*
|
||||
* As only master can set mode only master can pin and it is
|
||||
* unlikely the master client will race with itself especialy
|
||||
* on those old gpu with single crtc.
|
||||
*
|
||||
* We don't shutdown the display controller because new buffer
|
||||
* will end up in same spot.
|
||||
*/
|
||||
if (!atomic && fb && fb != crtc->fb) {
|
||||
struct radeon_bo *old_rbo;
|
||||
unsigned long nsize, osize;
|
||||
|
||||
old_rbo = gem_to_radeon_bo(to_radeon_framebuffer(fb)->obj);
|
||||
osize = radeon_bo_size(old_rbo);
|
||||
nsize = radeon_bo_size(rbo);
|
||||
if (nsize <= osize && !radeon_bo_reserve(old_rbo, false)) {
|
||||
radeon_bo_unpin(old_rbo);
|
||||
radeon_bo_unreserve(old_rbo);
|
||||
fb = NULL;
|
||||
goto retry;
|
||||
}
|
||||
}
|
||||
return -EINVAL;
|
||||
}
|
||||
radeon_bo_get_tiling_flags(rbo, &tiling_flags, NULL);
|
||||
|
||||
@@ -242,6 +242,8 @@ void radeon_uvd_free_handles(struct radeon_device *rdev, struct drm_file *filp)
|
||||
if (handle != 0 && rdev->uvd.filp[i] == filp) {
|
||||
struct radeon_fence *fence;
|
||||
|
||||
radeon_uvd_note_usage(rdev);
|
||||
|
||||
r = radeon_uvd_get_destroy_msg(rdev,
|
||||
R600_RING_TYPE_UVD_INDEX, handle, &fence);
|
||||
if (r) {
|
||||
|
||||
@@ -247,7 +247,7 @@
|
||||
#define NOOFGROUPS_SHIFT 12
|
||||
#define NOOFGROUPS_MASK 0x00001000
|
||||
|
||||
#define MC_SEQ_TRAIN_WAKEUP_CNTL 0x2808
|
||||
#define MC_SEQ_TRAIN_WAKEUP_CNTL 0x28e8
|
||||
#define TRAIN_DONE_D0 (1 << 30)
|
||||
#define TRAIN_DONE_D1 (1 << 31)
|
||||
|
||||
|
||||
@@ -1076,24 +1076,32 @@ out_unlock:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int ttm_bo_mem_compat(struct ttm_placement *placement,
|
||||
struct ttm_mem_reg *mem)
|
||||
static bool ttm_bo_mem_compat(struct ttm_placement *placement,
|
||||
struct ttm_mem_reg *mem,
|
||||
uint32_t *new_flags)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (mem->mm_node && placement->lpfn != 0 &&
|
||||
(mem->start < placement->fpfn ||
|
||||
mem->start + mem->num_pages > placement->lpfn))
|
||||
return -1;
|
||||
return false;
|
||||
|
||||
for (i = 0; i < placement->num_placement; i++) {
|
||||
if ((placement->placement[i] & mem->placement &
|
||||
TTM_PL_MASK_CACHING) &&
|
||||
(placement->placement[i] & mem->placement &
|
||||
TTM_PL_MASK_MEM))
|
||||
return i;
|
||||
*new_flags = placement->placement[i];
|
||||
if ((*new_flags & mem->placement & TTM_PL_MASK_CACHING) &&
|
||||
(*new_flags & mem->placement & TTM_PL_MASK_MEM))
|
||||
return true;
|
||||
}
|
||||
return -1;
|
||||
|
||||
for (i = 0; i < placement->num_busy_placement; i++) {
|
||||
*new_flags = placement->busy_placement[i];
|
||||
if ((*new_flags & mem->placement & TTM_PL_MASK_CACHING) &&
|
||||
(*new_flags & mem->placement & TTM_PL_MASK_MEM))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
int ttm_bo_validate(struct ttm_buffer_object *bo,
|
||||
@@ -1102,6 +1110,7 @@ int ttm_bo_validate(struct ttm_buffer_object *bo,
|
||||
bool no_wait_gpu)
|
||||
{
|
||||
int ret;
|
||||
uint32_t new_flags;
|
||||
|
||||
BUG_ON(!ttm_bo_is_reserved(bo));
|
||||
/* Check that range is valid */
|
||||
@@ -1112,8 +1121,7 @@ int ttm_bo_validate(struct ttm_buffer_object *bo,
|
||||
/*
|
||||
* Check whether we need to move buffer.
|
||||
*/
|
||||
ret = ttm_bo_mem_compat(placement, &bo->mem);
|
||||
if (ret < 0) {
|
||||
if (!ttm_bo_mem_compat(placement, &bo->mem, &new_flags)) {
|
||||
ret = ttm_bo_move_buffer(bo, placement, interruptible,
|
||||
no_wait_gpu);
|
||||
if (ret)
|
||||
@@ -1123,7 +1131,7 @@ int ttm_bo_validate(struct ttm_buffer_object *bo,
|
||||
* Use the access and other non-mapping-related flag bits from
|
||||
* the compatible memory placement flags to the active flags
|
||||
*/
|
||||
ttm_flag_masked(&bo->mem.placement, placement->placement[ret],
|
||||
ttm_flag_masked(&bo->mem.placement, new_flags,
|
||||
~TTM_PL_MASK_MEMTYPE);
|
||||
}
|
||||
/*
|
||||
|
||||
@@ -343,19 +343,25 @@ int ttm_bo_move_memcpy(struct ttm_buffer_object *bo,
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
/*
|
||||
* Single TTM move. NOP.
|
||||
*/
|
||||
if (old_iomap == NULL && new_iomap == NULL)
|
||||
goto out2;
|
||||
|
||||
/*
|
||||
* Move nonexistent data. NOP.
|
||||
*/
|
||||
if (old_iomap == NULL && ttm == NULL)
|
||||
goto out2;
|
||||
|
||||
if (ttm->state == tt_unpopulated) {
|
||||
/*
|
||||
* TTM might be null for moves within the same region.
|
||||
*/
|
||||
if (ttm && ttm->state == tt_unpopulated) {
|
||||
ret = ttm->bdev->driver->ttm_tt_populate(ttm);
|
||||
if (ret) {
|
||||
/* if we fail here don't nuke the mm node
|
||||
* as the bo still owns it */
|
||||
old_copy.mm_node = NULL;
|
||||
if (ret)
|
||||
goto out1;
|
||||
}
|
||||
}
|
||||
|
||||
add = 0;
|
||||
@@ -381,11 +387,8 @@ int ttm_bo_move_memcpy(struct ttm_buffer_object *bo,
|
||||
prot);
|
||||
} else
|
||||
ret = ttm_copy_io_page(new_iomap, old_iomap, page);
|
||||
if (ret) {
|
||||
/* failing here, means keep old copy as-is */
|
||||
old_copy.mm_node = NULL;
|
||||
if (ret)
|
||||
goto out1;
|
||||
}
|
||||
}
|
||||
mb();
|
||||
out2:
|
||||
@@ -403,7 +406,12 @@ out1:
|
||||
ttm_mem_reg_iounmap(bdev, old_mem, new_iomap);
|
||||
out:
|
||||
ttm_mem_reg_iounmap(bdev, &old_copy, old_iomap);
|
||||
ttm_bo_mem_put(bo, &old_copy);
|
||||
|
||||
/*
|
||||
* On error, keep the mm node!
|
||||
*/
|
||||
if (!ret)
|
||||
ttm_bo_mem_put(bo, &old_copy);
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(ttm_bo_move_memcpy);
|
||||
|
||||
Reference in New Issue
Block a user