Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 200721
b: refs/heads/master
c: 37cf6b0
h: refs/heads/master
i:
  200719: 266e3b3
v: v3
  • Loading branch information
Roland Scheidegger authored and Dave Airlie committed Jul 1, 2010
1 parent 8ebae9b commit 29e639b
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 28 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 688acaa2897462e4c5e2482496e2868db0760809
refs/heads/master: 37cf6b03f9f28c62dafb0b9ce5f1ba29c8baffa9
58 changes: 31 additions & 27 deletions trunk/drivers/gpu/drm/radeon/r100.c
Original file line number Diff line number Diff line change
Expand Up @@ -3158,33 +3158,6 @@ static inline void r100_cs_track_texture_print(struct r100_cs_track_texture *t)
DRM_ERROR("compress format %d\n", t->compress_format);
}

static int r100_cs_track_cube(struct radeon_device *rdev,
struct r100_cs_track *track, unsigned idx)
{
unsigned face, w, h;
struct radeon_bo *cube_robj;
unsigned long size;

for (face = 0; face < 5; face++) {
cube_robj = track->textures[idx].cube_info[face].robj;
w = track->textures[idx].cube_info[face].width;
h = track->textures[idx].cube_info[face].height;

size = w * h;
size *= track->textures[idx].cpp;

size += track->textures[idx].cube_info[face].offset;

if (size > radeon_bo_size(cube_robj)) {
DRM_ERROR("Cube texture offset greater than object size %lu %lu\n",
size, radeon_bo_size(cube_robj));
r100_cs_track_texture_print(&track->textures[idx]);
return -1;
}
}
return 0;
}

static int r100_track_compress_size(int compress_format, int w, int h)
{
int block_width, block_height, block_bytes;
Expand Down Expand Up @@ -3215,6 +3188,37 @@ static int r100_track_compress_size(int compress_format, int w, int h)
return sz;
}

static int r100_cs_track_cube(struct radeon_device *rdev,
struct r100_cs_track *track, unsigned idx)
{
unsigned face, w, h;
struct radeon_bo *cube_robj;
unsigned long size;
unsigned compress_format = track->textures[idx].compress_format;

for (face = 0; face < 5; face++) {
cube_robj = track->textures[idx].cube_info[face].robj;
w = track->textures[idx].cube_info[face].width;
h = track->textures[idx].cube_info[face].height;

if (compress_format) {
size = r100_track_compress_size(compress_format, w, h);
} else
size = w * h;
size *= track->textures[idx].cpp;

size += track->textures[idx].cube_info[face].offset;

if (size > radeon_bo_size(cube_robj)) {
DRM_ERROR("Cube texture offset greater than object size %lu %lu\n",
size, radeon_bo_size(cube_robj));
r100_cs_track_texture_print(&track->textures[idx]);
return -1;
}
}
return 0;
}

static int r100_cs_track_texture_check(struct radeon_device *rdev,
struct r100_cs_track *track)
{
Expand Down

0 comments on commit 29e639b

Please sign in to comment.