mirror of https://gitee.com/openkylin/linux.git
drm/radeon/kms: optimize streamout checking for evergreen
Signed-off-by: Marek Olšák <maraeo@gmail.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
7885713138
commit
7e9fa5f69f
|
@ -797,27 +797,32 @@ static int evergreen_cs_track_validate_texture(struct radeon_cs_parser *p,
|
||||||
static int evergreen_cs_track_check(struct radeon_cs_parser *p)
|
static int evergreen_cs_track_check(struct radeon_cs_parser *p)
|
||||||
{
|
{
|
||||||
struct evergreen_cs_track *track = p->track;
|
struct evergreen_cs_track *track = p->track;
|
||||||
unsigned tmp, i, j;
|
unsigned tmp, i;
|
||||||
int r;
|
int r;
|
||||||
|
unsigned buffer_mask = 0;
|
||||||
|
|
||||||
/* check streamout */
|
/* check streamout */
|
||||||
for (i = 0; i < 4; i++) {
|
if (track->vgt_strmout_config) {
|
||||||
if (track->vgt_strmout_config & (1 << i)) {
|
for (i = 0; i < 4; i++) {
|
||||||
for (j = 0; j < 4; j++) {
|
if (track->vgt_strmout_config & (1 << i)) {
|
||||||
if ((track->vgt_strmout_buffer_config >> (i * 4)) & (1 << j)) {
|
buffer_mask |= (track->vgt_strmout_buffer_config >> (i * 4)) & 0xf;
|
||||||
if (track->vgt_strmout_bo[j]) {
|
}
|
||||||
u64 offset = (u64)track->vgt_strmout_bo_offset[j] +
|
}
|
||||||
(u64)track->vgt_strmout_size[j];
|
|
||||||
if (offset > radeon_bo_size(track->vgt_strmout_bo[i])) {
|
for (i = 0; i < 4; i++) {
|
||||||
DRM_ERROR("streamout %d bo too small: 0x%llx, 0x%lx\n",
|
if (buffer_mask & (1 << i)) {
|
||||||
j, offset,
|
if (track->vgt_strmout_bo[i]) {
|
||||||
radeon_bo_size(track->vgt_strmout_bo[j]));
|
u64 offset = (u64)track->vgt_strmout_bo_offset[i] +
|
||||||
return -EINVAL;
|
(u64)track->vgt_strmout_size[i];
|
||||||
}
|
if (offset > radeon_bo_size(track->vgt_strmout_bo[i])) {
|
||||||
} else {
|
DRM_ERROR("streamout %d bo too small: 0x%llx, 0x%lx\n",
|
||||||
dev_warn(p->dev, "No buffer for streamout %d\n", j);
|
i, offset,
|
||||||
|
radeon_bo_size(track->vgt_strmout_bo[i]));
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
dev_warn(p->dev, "No buffer for streamout %d\n", i);
|
||||||
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue