35 #include "r200_reg_safe.h"
39 static int r200_get_vtx_size_0(
uint32_t vtx_fmt_0)
63 for (i = 0; i < 8; i++) {
64 int color_size = (vtx_fmt_0 >> (11 + 2*
i)) & 0x3;
67 case 1: vtx_size++;
break;
68 case 2: vtx_size += 3;
break;
69 case 3: vtx_size += 4;
break;
86 unsigned num_gpu_pages,
100 DRM_ERROR(
"radeon: moving bo (%d).\n", r);
106 for (i = 0; i < num_loops; i++) {
108 if (cur_size > 0x1FFFFF) {
116 src_offset += cur_size;
117 dst_offset += cur_size;
129 static int r200_get_vtx_size_1(
uint32_t vtx_fmt_1)
131 int vtx_size,
i, tex_size;
133 for (i = 0; i < 6; i++) {
134 tex_size = (vtx_fmt_1 >> (i * 3)) & 0x7;
137 vtx_size += tex_size;
144 unsigned idx,
unsigned reg)
163 DRM_ERROR(
"No reloc for ib[%d]=0x%04X\n",
180 DRM_ERROR(
"No reloc for ib[%d]=0x%04X\n",
185 track->
zb.robj = reloc->
robj;
186 track->
zb.offset = idx_value;
188 ib[
idx] = idx_value + ((
u32)reloc->
lobj.gpu_offset);
193 DRM_ERROR(
"No reloc for ib[%d]=0x%04X\n",
198 track->
cb[0].robj = reloc->
robj;
199 track->
cb[0].offset = idx_value;
201 ib[
idx] = idx_value + ((
u32)reloc->
lobj.gpu_offset);
212 DRM_ERROR(
"No reloc for ib[%d]=0x%04X\n",
223 tmp = idx_value & ~(0x7 << 2);
225 ib[
idx] = tmp + ((
u32)reloc->
lobj.gpu_offset);
227 ib[
idx] = idx_value + ((
u32)reloc->
lobj.gpu_offset);
265 DRM_ERROR(
"No reloc for ib[%d]=0x%04X\n",
270 track->
textures[
i].cube_info[face - 1].offset = idx_value;
271 ib[
idx] = idx_value + ((
u32)reloc->
lobj.gpu_offset);
276 track->
maxy = ((idx_value >> 16) & 0x7FF);
283 DRM_ERROR(
"No reloc for ib[%d]=0x%04X\n",
295 tmp = idx_value & ~(0x7 << 16);
315 track->
cb[0].cpp = 1;
320 track->
cb[0].cpp = 2;
323 track->
cb[0].cpp = 4;
326 DRM_ERROR(
"Invalid color buffer format (%d) !\n",
331 DRM_ERROR(
"No support for depth xy offset in kms\n");
340 switch (idx_value & 0xf) {
360 DRM_ERROR(
"No reloc for ib[%d]=0x%04X\n",
365 ib[
idx] = idx_value + ((
u32)reloc->
lobj.gpu_offset);
371 track->
textures[i].enabled = !!(temp & (1 << i));
383 track->
vtx_size = r200_get_vtx_size_0(idx_value);
386 track->
vtx_size += r200_get_vtx_size_1(idx_value);
406 track->
textures[
i].pitch = idx_value + 32;
418 tmp = (idx_value >> 23) & 0x7;
419 if (tmp == 2 || tmp == 6)
421 tmp = (idx_value >> 27) & 0x7;
422 if (tmp == 2 || tmp == 6)
441 track->
textures[
i].txdepth = idx_value & 0x7;
442 tmp = (idx_value >> 16) & 0x3;
480 track->
textures[
i].lookup_disable =
true;
518 track->
textures[
i].cube_info[4].width = 1 << ((idx_value >> 16) & 0xf);
519 track->
textures[
i].cube_info[4].height = 1 << ((idx_value >> 20) & 0xf);
530 for (face = 0; face < 4; face++) {
531 track->
textures[
i].cube_info[face].width = 1 << ((tmp >> (face * 8)) & 0xf);
532 track->
textures[
i].cube_info[face].height = 1 << ((tmp >> ((face * 8) + 4)) & 0xf);
546 rdev->
config.
r100.reg_safe_bm = r200_reg_safe_bm;