drm/radeon/r200: handle more hw tex coord types
Subsystems (2)
PATCH 1/2 drm/radeon/r200: handle more hw tex coord types
From: Roland Scheidegger <[email protected]>
Code did not handle projected 2d and depth coordinates, meaning potentially set 3d or cube special handling might stick.
(Not sure what depth coord actually does, but I guess handling it like a normal coordinate is the right thing to do.)
Might be related to https://bugs.freedesktop.org/show_bug.cgi?id=26428
Signed-off-by [email protected]
Signed-off-by Alex Deucher <[email protected]>
Cc stable <[email protected]>
--- drivers/gpu/drm/radeon/r200.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/gpu/drm/radeon/r200.c +2 -0
@@ -415,6 +415,8 @@ int r200_packet0_check(struct radeon_cs_parser *p,/* 2D, 3D, CUBE */ switch (tmp) {case 0 : +case 3 : +case 4 :case 5 :case 6 :case 7 :
Signature · 1 line
1.7.0.1
PATCH 2/2 drm/radeon/r100/r200: fix calculation of compressed cube maps
From: Roland Scheidegger <[email protected]>
This needs similar handling to other compressed textures. Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=26428
Signed-off-by [email protected]
Signed-off-by Alex Deucher <[email protected]>
Cc stable <[email protected]>
--- drivers/gpu/drm/radeon/r100.c | 58 ++++++++++++++++++++++------------------- 1 files changed, 31 insertions(+), 27 deletions(-)
drivers/gpu/drm/radeon/r100.c +31 -27
@@ -3150,33 +3150,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;
@@ -3207,6 +3180,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) {
Signature · 1 line
1.7.0.1